MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NdbBackup.hpp
1 /*
2  Copyright (C) 2003-2006 MySQL AB, 2008, 2009 Sun Microsystems, Inc.
3  All rights reserved. Use is subject to license terms.
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; version 2 of the License.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
19 #ifndef NDBT_BACKUP_HPP
20 #define NDBT_BACKUP_HPP
21 
22 #include <mgmapi.h>
23 #include <Vector.hpp>
24 #include "NdbConfig.hpp"
25 #include <NdbRestarter.hpp>
26 
27 class NdbBackup : public NdbConfig {
28 public:
29  NdbBackup(int _own_id, const char* _addr = 0)
30  : NdbConfig(_own_id, _addr) {};
31 
32  int start(unsigned & _backup_id,
33  int flags = 2,
34  unsigned int user_backup_id= 0,
35  unsigned int logtype= 0);
36  int start() { unsigned unused =0; return start(unused); }
37  int restore(unsigned _backup_id);
38 
39  int NFMaster(NdbRestarter& _restarter);
40  int NFMasterAsSlave(NdbRestarter& _restarter);
41  int NFSlave(NdbRestarter& _restarter);
42  int NF(NdbRestarter& _restarter, int *NFDuringBackup_codes, const int sz, bool onMaster);
43 
44  int FailMaster(NdbRestarter& _restarter);
45  int FailMasterAsSlave(NdbRestarter& _restarter);
46  int FailSlave(NdbRestarter& _restarter);
47  int Fail(NdbRestarter& _restarter, int *Fail_codes, const int sz, bool onMaster);
48  int startLogEvent();
49  int checkBackupStatus();
50 
51  int clearOldBackups();
52 
53 private:
54 
55  int execRestore(bool _restore_data,
56  bool _restore_meta,
57  int _node_id,
58  unsigned _backup_id);
59 
60  const char * getBackupDataDirForNode(int _node_id);
61  NdbLogEventHandle log_handle;
62 
63 };
64 
65 #endif