MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BackupImpl.hpp
1 /*
2  Copyright (C) 2003-2006, 2008 MySQL AB, 2008 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 BACKUP_IMPL_HPP
20 #define BACKUP_IMPL_HPP
21 
22 #include "SignalData.hpp"
23 #include <NodeBitmask.hpp>
24 
29  friend class BackupMaster;
30 
34  friend class Backup;
35  friend class Dblqh;
36 
37  friend bool printDEFINE_BACKUP_REQ(FILE *, const Uint32 *, Uint32, Uint16);
38 public:
39  STATIC_CONST( SignalLength = 9 + NdbNodeBitmask::Size);
40 
41 private:
45  Uint32 backupPtr;
46 
47  Uint32 backupId;
48  Uint32 clientRef;
49  Uint32 clientData;
50  Uint32 senderRef;
51 
55  NdbNodeBitmask nodes;
56 
60  Uint32 backupKey[2];
61 
65  Uint32 backupDataLen;
66 
70  /* & 0x3 - waitCompleted
71  * & 0x4 - Use undo log
72  */
73  Uint32 flags;
74 };
75 
80  friend class Backup;
81  friend class Dblqh;
82 
86  friend class BackupMaster;
87 
88  friend bool printDEFINE_BACKUP_REF(FILE *, const Uint32 *, Uint32, Uint16);
89 public:
90  STATIC_CONST( SignalLength = 4 );
91 
92  enum ErrorCode {
93  Undefined = 1340,
94  FailedToAllocateBuffers = 1342,
95  FailedToSetupFsBuffers = 1343,
96  FailedToAllocateTables = 1344,
97  FailedInsertFileHeader = 1345,
98  FailedInsertTableList = 1346,
99  FailedAllocateTableMem = 1347,
100  FailedToAllocateFileRecord = 1348,
101  FailedToAllocateAttributeRecord = 1349,
102  FailedForBackupFilesAleadyExist = 1350
103  };
104 private:
105  Uint32 backupId;
106  Uint32 backupPtr;
107  Uint32 errorCode;
108  Uint32 nodeId;
109 };
110 
115  friend class Backup;
116  friend class Dblqh;
117 
121  friend class BackupMaster;
122 
123  friend bool printDEFINE_BACKUP_CONF(FILE *, const Uint32 *, Uint32, Uint16);
124 public:
125  STATIC_CONST( SignalLength = 2 );
126 
127 private:
128  Uint32 backupId;
129  Uint32 backupPtr;
130 };
131 
136  friend class BackupMaster;
137 
141  friend class Backup;
142 
143  friend bool printSTART_BACKUP_REQ(FILE *, const Uint32 *, Uint32, Uint16);
144 public:
145 
146  STATIC_CONST( SignalLength = 2 );
147 
148 private:
149  Uint32 backupId;
150  Uint32 backupPtr;
151 };
152 
157  friend class Backup;
158 
162  friend class BackupMaster;
163 
164  friend bool printSTART_BACKUP_REF(FILE *, const Uint32 *, Uint32, Uint16);
165 public:
166  STATIC_CONST( SignalLength = 4 );
167 
168  enum ErrorCode {
169  FailedToAllocateTriggerRecord = 1
170  };
171 private:
172  Uint32 backupId;
173  Uint32 backupPtr;
174  Uint32 errorCode;
175  Uint32 nodeId;
176 };
177 
182  friend class Backup;
183 
187  friend class BackupMaster;
188 
189  friend bool printSTART_BACKUP_CONF(FILE *, const Uint32 *, Uint32, Uint16);
190 public:
191  STATIC_CONST( SignalLength = 2 );
192 
193 private:
194  Uint32 backupId;
195  Uint32 backupPtr;
196 };
197 
202  friend class BackupMaster;
203 
207  friend class Backup;
208  friend class Dblqh;
209 
210  friend bool printBACKUP_FRAGMENT_REQ(FILE *, const Uint32 *, Uint32, Uint16);
211 public:
212  STATIC_CONST( SignalLength = 5 );
213 
214 private:
215  Uint32 backupId;
216  Uint32 backupPtr;
217  Uint32 tableId;
218  Uint32 fragmentNo;
219  Uint32 count;
220 };
221 
226  friend class Backup;
227  friend class Dblqh;
228 
232  friend class BackupMaster;
233 
234  friend bool printBACKUP_FRAGMENT_REF(FILE *, const Uint32 *, Uint32, Uint16);
235 public:
236  STATIC_CONST( SignalLength = 5 );
237 
238 private:
239  Uint32 backupId;
240  Uint32 backupPtr;
241  Uint32 errorCode;
242  Uint32 nodeId;
243 };
244 
249  friend class Backup;
250  friend class Dblqh;
251 
255  friend class BackupMaster;
256 
257  friend bool printBACKUP_FRAGMENT_CONF(FILE *, const Uint32 *, Uint32, Uint16);
258 public:
259  STATIC_CONST( SignalLength = 8 );
260 
261 private:
262  Uint32 backupId;
263  Uint32 backupPtr;
264  Uint32 tableId;
265  Uint32 fragmentNo;
266  Uint32 noOfRecordsLow;
267  Uint32 noOfBytesLow;
268  Uint32 noOfRecordsHigh;
269  Uint32 noOfBytesHigh;
270 };
271 
273 public:
274  STATIC_CONST( SignalLength = 8 );
275 
276  Uint32 backupId;
277  Uint32 backupPtr;
278  Uint32 tableId;
279  Uint32 fragmentNo;
280  Uint32 noOfTableRowsLow;
281  Uint32 noOfFragmentRowsLow;
282  Uint32 noOfTableRowsHigh;
283  Uint32 noOfFragmentRowsHigh;
284 };
285 
290  friend class BackupMaster;
291 
295  friend class Backup;
296 
297  friend bool printSTOP_BACKUP_REQ(FILE *, const Uint32 *, Uint32, Uint16);
298 public:
299  STATIC_CONST( SignalLength = 4 );
300 
301 private:
302  Uint32 backupId;
303  Uint32 backupPtr;
304  Uint32 startGCP;
305  Uint32 stopGCP;
306 };
307 
312  friend class Backup;
313 
317  friend class BackupMaster;
318 
319  friend bool printSTOP_BACKUP_REF(FILE *, const Uint32 *, Uint32, Uint16);
320 public:
321  STATIC_CONST( SignalLength = 4 );
322 
323 private:
324  Uint32 backupId;
325  Uint32 backupPtr;
326  Uint32 errorCode;
327  Uint32 nodeId;
328 };
329 
334  friend class Backup;
335 
339  friend class BackupMaster;
340 
341  friend bool printSTOP_BACKUP_CONF(FILE *, const Uint32 *, Uint32, Uint16);
342 public:
343  STATIC_CONST( SignalLength = 4 );
344 
345 private:
346  Uint32 backupId;
347  Uint32 backupPtr;
348  Uint32 noOfLogBytes;
349  Uint32 noOfLogRecords;
350 };
351 
356  friend class BackupMaster;
357 
361  friend class Backup;
362 
363  friend bool printBACKUP_STATUS_REQ(FILE *, const Uint32 *, Uint32, Uint16);
364 public:
365  STATIC_CONST( SignalLength = 1 );
366 
367 private:
368 };
369 
374  friend class Backup;
375 
379  friend class BackupMaster;
380 
381  friend bool printBACKUP_STATUS_CONF(FILE *, const Uint32 *, Uint32, Uint16);
382 public:
383  STATIC_CONST( SignalLength = 1 );
384 
385 private:
386 };
387 
388 
389 #endif