MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BackupSignalData.hpp
1 /*
2  Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; version 2 of the License.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #ifndef BACKUP_HPP
19 #define BACKUP_HPP
20 
21 #include "SignalData.hpp"
22 #include <NodeBitmask.hpp>
23 
27 class BackupReq {
31  friend class MgmtSrvr;
32 
36  friend class Backup;
37 
38  friend bool printBACKUP_REQ(FILE *, const Uint32 *, Uint32, Uint16);
39 public:
40  STATIC_CONST( SignalLength = 4 );
41  STATIC_CONST( WAITCOMPLETED = 0x3 );
42  STATIC_CONST( USE_UNDO_LOG = 0x4 );
43 
44 private:
45  Uint32 senderData;
46  Uint32 backupDataLen;
47  /* & 0x3 - waitCompleted
48  * & 0x4 - use undo log
49  */
50  Uint32 flags;
51  Uint32 inputBackupId;
52 };
53 
54 class BackupData {
58  friend class BackupMaster;
59 
63  friend class Backup;
64 
65  friend bool printBACKUP_DATA(FILE *, const Uint32 *, Uint32, Uint16);
66 public:
67  STATIC_CONST( SignalLength = 25 );
68 
69  enum KeyValues {
73  BufferSize = 1, // In MB
74  BlockSize = 2, // Write in chunks of this (in bytes)
75  MinWrite = 3, // Minimum write as multiple of blocksize
76  MaxWrite = 4, // Maximum write as multiple of blocksize
77 
78  // Max throughput
79  // Parallell files
80 
81  NoOfTables = 1000,
82  TableName = 1001 // char*
83  };
84 private:
85  enum RequestType {
86  ClientToMaster = 1,
87  MasterToSlave = 2
88  };
89  Uint32 requestType;
90 
91  union {
92  Uint32 backupPtr;
93  Uint32 senderData;
94  };
95  Uint32 backupId;
96 
101  Uint32 totalLen_offset;
102 
107  Uint32 backupData[21];
108 };
109 
113 class BackupRef {
117  friend class Backup;
118 
122  friend class MgmtSrvr;
123 
124  friend bool printBACKUP_REF(FILE *, const Uint32 *, Uint32, Uint16);
125 public:
126  STATIC_CONST( SignalLength = 3 );
127 
128 private:
129  enum ErrorCodes {
130  Undefined = 1300,
131  IAmNotMaster = 1301,
132  OutOfBackupRecord = 1302,
133  OutOfResources = 1303,
134  SequenceFailure = 1304,
135  BackupDefinitionNotImplemented = 1305,
136  CannotBackupDiskless = 1306
137  };
138  Uint32 senderData;
139  Uint32 errorCode;
140  union {
141  Uint32 masterRef;
142  };
143 };
144 
148 class BackupConf {
152  friend class Backup;
153 
157  friend class MgmtSrvr;
158 
159  friend bool printBACKUP_CONF(FILE *, const Uint32 *, Uint32, Uint16);
160 public:
161  STATIC_CONST( SignalLength = 2 + NdbNodeBitmask::Size );
162 
163 private:
164  Uint32 senderData;
165  Uint32 backupId;
166  NdbNodeBitmaskPOD nodes;
167 };
168 
176  friend class Backup;
177 
181  friend class MgmtSrvr;
182 
183  friend bool printBACKUP_ABORT_REP(FILE *, const Uint32 *, Uint32, Uint16);
184 public:
185  STATIC_CONST( SignalLength = 3 );
186 
187 private:
188  Uint32 senderData;
189  Uint32 backupId;
190  Uint32 reason;
191 };
192 
200  friend class Backup;
201 
205  friend class MgmtSrvr;
206 
207  friend bool printBACKUP_COMPLETE_REP(FILE *, const Uint32 *, Uint32, Uint16);
208 public:
209  STATIC_CONST( SignalLength = 10 + NdbNodeBitmask::Size );
210 private:
211  Uint32 senderData;
212  Uint32 backupId;
213  Uint32 startGCP;
214  Uint32 stopGCP;
215  Uint32 noOfBytesLow;
216  Uint32 noOfRecordsLow;
217  Uint32 noOfLogBytes;
218  Uint32 noOfLogRecords;
219  NdbNodeBitmaskPOD nodes;
220  Uint32 noOfBytesHigh;
221  Uint32 noOfRecordsHigh;
222 };
223 
228  friend bool printBACKUP_NF_COMPLETE_REP(FILE*, const Uint32*, Uint32, Uint16);
229 };
230 
238  friend class Backup;
239  friend class MgmtSrvr;
240 
241  friend bool printABORT_BACKUP_ORD(FILE *, const Uint32 *, Uint32, Uint16);
242 public:
243  STATIC_CONST( SignalLength = 3 );
244 
245  enum RequestType {
246  ClientAbort = 1321,
247  BackupComplete = 1322,
248  BackupFailure = 1323, // General backup failure coordinator -> slave
249  LogBufferFull = 1324, // slave -> coordinator
250  FileOrScanError = 1325, // slave -> coordinator
251  BackupFailureDueToNodeFail = 1326, // slave -> slave
252  OkToClean = 1327 // master -> slave
253 
254  ,AbortScan = 1328
255  ,IncompatibleVersions = 1329
256  };
257 private:
258  Uint32 requestType;
259  Uint32 backupId;
260  union {
261  Uint32 backupPtr;
262  Uint32 senderData;
263  };
264 };
265 
266 #endif