MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
BackupSignalData.cpp
1 /*
2  Copyright (C) 2003, 2005, 2006 MySQL AB
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 
20 #include <signaldata/BackupSignalData.hpp>
21 
22 bool
23 printBACKUP_REQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 bno){
24  BackupReq* sig = (BackupReq*)theData;
25  fprintf(output, " senderData: %d DataLength: %d flags: %d\n",
26  sig->senderData,
27  sig->backupDataLen,
28  sig->flags);
29  return true;
30 }
31 
32 bool
33 printBACKUP_DATA(FILE * output, const Uint32 * theData, Uint32 len, Uint16 bno){
34  BackupData * sig = (BackupData*)theData;
35  if(sig->requestType == BackupData::ClientToMaster){
36  fprintf(output, " ClientToMaster: senderData: %d backupId: %d\n",
37  sig->senderData, sig->backupId);
38  } else if(sig->requestType == BackupData::MasterToSlave){
39  fprintf(output, " MasterToSlave: backupPtr: %d backupId: %d\n",
40  sig->backupPtr, sig->backupId);
41  }
42  return false;
43 }
44 
45 bool
46 printBACKUP_REF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 bno){
47 
48  BackupRef* sig = (BackupRef*)theData;
49  fprintf(output, " senderData: %d errorCode: %d masterRef: %d\n",
50  sig->senderData,
51  sig->errorCode,
52  sig->masterRef);
53  return true;
54 }
55 
56 bool
57 printBACKUP_CONF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 bno){
58  BackupConf* sig = (BackupConf*)theData;
59  fprintf(output, " senderData: %d backupId: %d\n",
60  sig->senderData,
61  sig->backupId);
62  return true;
63 }
64 
65 bool
66 printBACKUP_ABORT_REP(FILE * out, const Uint32 * data, Uint32 len, Uint16 bno){
67  BackupAbortRep* sig = (BackupAbortRep*)data;
68  fprintf(out, " senderData: %d backupId: %d reason: %d\n",
69  sig->senderData,
70  sig->backupId,
71  sig->reason);
72  return true;
73 }
74 
75 bool
76 printBACKUP_COMPLETE_REP(FILE * out, const Uint32 * data, Uint32 len, Uint16 b){
78  fprintf(out, " senderData: %d backupId: %d records: %llu bytes: %llu\n",
79  sig->senderData,
80  sig->backupId,
81  sig->noOfRecordsLow + (((Uint64)sig->noOfRecordsHigh) << 32),
82  sig->noOfBytesLow + (((Uint64)sig->noOfBytesHigh) << 32));
83  return true;
84 }
85 
86 bool
87 printBACKUP_NF_COMPLETE_REP(FILE*, const Uint32*, Uint32, Uint16){
88  return false;
89 }
90 
91 bool
92 printABORT_BACKUP_ORD(FILE * out, const Uint32 * data, Uint32 len, Uint16 b){
93  AbortBackupOrd* sig = (AbortBackupOrd*)data;
94 
95  AbortBackupOrd::RequestType rt =(AbortBackupOrd::RequestType)sig->requestType;
96  switch(rt){
97  case AbortBackupOrd::ClientAbort:
98  fprintf(out, " ClientAbort: senderData: %d backupId: %d\n",
99  sig->senderData, sig->backupId);
100  return true;
101  break;
102  case AbortBackupOrd::BackupComplete:
103  fprintf(out, " BackupComplete: backupPtr: %d backupId: %d\n",
104  sig->backupPtr, sig->backupId);
105  return true;
106  case AbortBackupOrd::BackupFailure:
107  fprintf(out, " BackupFailure: backupPtr: %d backupId: %d\n",
108  sig->backupPtr, sig->backupId);
109  return true;
110  case AbortBackupOrd::LogBufferFull:
111  fprintf(out, " LogBufferFull: backupPtr: %d backupId: %d\n",
112  sig->backupPtr, sig->backupId);
113  return true;
114  break;
115  case AbortBackupOrd::FileOrScanError:
116  fprintf(out, " FileOrScanError: backupPtr: %d backupId: %d\n",
117  sig->backupPtr, sig->backupId);
118  return true;
119  break;
120  case AbortBackupOrd::BackupFailureDueToNodeFail:
121  fprintf(out, " BackupFailureDueToNodeFail: backupPtr: %d backupId: %d\n",
122  sig->backupPtr, sig->backupId);
123  return true;
124  break;
125  case AbortBackupOrd::OkToClean:
126  fprintf(out, " OkToClean: backupPtr: %d backupId: %d\n",
127  sig->backupPtr, sig->backupId);
128  return true;
129  break;
130  case AbortBackupOrd::AbortScan:
131  case AbortBackupOrd::IncompatibleVersions:
132  return false;
133  }
134  return false;
135 }