~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to storage/ndb/src/common/debugger/signaldata/BackupSignalData.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-03-17 14:56:02 UTC
  • Revision ID: james.westby@ubuntu.com-20100317145602-x7e30l1b2sb5s6w6
Tags: upstream-5.1.45
ImportĀ upstreamĀ versionĀ 5.1.45

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (C) 2003 MySQL AB
 
2
 
 
3
   This program is free software; you can redistribute it and/or modify
 
4
   it under the terms of the GNU General Public License as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
 
 
17
#include <signaldata/BackupSignalData.hpp>
 
18
 
 
19
bool 
 
20
printBACKUP_REQ(FILE * output, const Uint32 * theData, Uint32 len, Uint16 bno){
 
21
  BackupReq* sig = (BackupReq*)theData;
 
22
  fprintf(output, " senderData: %d DataLength: %d flags: %d\n", 
 
23
          sig->senderData,
 
24
          sig->backupDataLen,
 
25
          sig->flags);
 
26
  return true;
 
27
}
 
28
 
 
29
bool 
 
30
printBACKUP_DATA(FILE * output, const Uint32 * theData, Uint32 len, Uint16 bno){
 
31
  BackupData * sig = (BackupData*)theData;
 
32
  if(sig->requestType == BackupData::ClientToMaster){
 
33
    fprintf(output, " ClientToMaster: senderData: %d backupId: %d\n",
 
34
            sig->senderData, sig->backupId);
 
35
  } else if(sig->requestType == BackupData::MasterToSlave){
 
36
    fprintf(output, " MasterToSlave: backupPtr: %d backupId: %d\n",
 
37
            sig->backupPtr, sig->backupId);
 
38
  }
 
39
  return false;
 
40
}
 
41
 
 
42
bool 
 
43
printBACKUP_REF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 bno){
 
44
 
 
45
  BackupRef* sig = (BackupRef*)theData;
 
46
  fprintf(output, " senderData: %d errorCode: %d masterRef: %d\n",
 
47
          sig->senderData,
 
48
          sig->errorCode,
 
49
          sig->masterRef);
 
50
  return true;
 
51
}
 
52
 
 
53
bool 
 
54
printBACKUP_CONF(FILE * output, const Uint32 * theData, Uint32 len, Uint16 bno){
 
55
  BackupConf* sig = (BackupConf*)theData;
 
56
  fprintf(output, " senderData: %d backupId: %d\n",
 
57
          sig->senderData,
 
58
          sig->backupId);
 
59
  return true;
 
60
}
 
61
 
 
62
bool 
 
63
printBACKUP_ABORT_REP(FILE * out, const Uint32 * data, Uint32 len, Uint16 bno){
 
64
  BackupAbortRep* sig = (BackupAbortRep*)data;
 
65
  fprintf(out, " senderData: %d backupId: %d reason: %d\n",
 
66
          sig->senderData,
 
67
          sig->backupId,
 
68
          sig->reason);
 
69
  return true;
 
70
}
 
71
 
 
72
bool 
 
73
printBACKUP_COMPLETE_REP(FILE * out, const Uint32 * data, Uint32 len, Uint16 b){
 
74
  BackupCompleteRep* sig = (BackupCompleteRep*)data;
 
75
  fprintf(out, " senderData: %d backupId: %d records: %llu bytes: %llu\n",
 
76
          sig->senderData,
 
77
          sig->backupId,
 
78
          sig->noOfRecordsLow + (((Uint64)sig->noOfRecordsHigh) << 32),
 
79
          sig->noOfBytesLow + (((Uint64)sig->noOfBytesHigh) << 32));
 
80
  return true;
 
81
}
 
82
 
 
83
bool 
 
84
printBACKUP_NF_COMPLETE_REP(FILE*, const Uint32*, Uint32, Uint16){
 
85
  return false;
 
86
}
 
87
 
 
88
bool 
 
89
printABORT_BACKUP_ORD(FILE * out, const Uint32 * data, Uint32 len, Uint16 b){
 
90
  AbortBackupOrd* sig = (AbortBackupOrd*)data;
 
91
 
 
92
  AbortBackupOrd::RequestType rt =(AbortBackupOrd::RequestType)sig->requestType;
 
93
  switch(rt){
 
94
  case AbortBackupOrd::ClientAbort:
 
95
    fprintf(out, " ClientAbort: senderData: %d backupId: %d\n",
 
96
            sig->senderData, sig->backupId);
 
97
    return true;
 
98
    break;
 
99
  case AbortBackupOrd::BackupComplete:
 
100
    fprintf(out, " BackupComplete: backupPtr: %d backupId: %d\n",
 
101
            sig->backupPtr, sig->backupId);
 
102
    return true;
 
103
  case AbortBackupOrd::BackupFailure:
 
104
    fprintf(out, " BackupFailure: backupPtr: %d backupId: %d\n",
 
105
            sig->backupPtr, sig->backupId);
 
106
    return true;
 
107
  case AbortBackupOrd::LogBufferFull:
 
108
    fprintf(out, " LogBufferFull: backupPtr: %d backupId: %d\n",
 
109
            sig->backupPtr, sig->backupId);
 
110
    return true;
 
111
    break;
 
112
  case AbortBackupOrd::FileOrScanError:
 
113
    fprintf(out, " FileOrScanError: backupPtr: %d backupId: %d\n",
 
114
            sig->backupPtr, sig->backupId);
 
115
    return true;
 
116
    break;
 
117
  case AbortBackupOrd::BackupFailureDueToNodeFail:
 
118
    fprintf(out, " BackupFailureDueToNodeFail: backupPtr: %d backupId: %d\n",
 
119
            sig->backupPtr, sig->backupId);
 
120
    return true;
 
121
    break;
 
122
  case AbortBackupOrd::OkToClean:
 
123
    fprintf(out, " OkToClean: backupPtr: %d backupId: %d\n",
 
124
            sig->backupPtr, sig->backupId);
 
125
    return true;
 
126
    break;
 
127
  case AbortBackupOrd::AbortScan:
 
128
  case AbortBackupOrd::IncompatibleVersions:
 
129
    return false;
 
130
  }
 
131
  return false;
 
132
}