MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GCP.cpp
1 /*
2  Copyright (C) 2003, 2005-2007 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/GCP.hpp>
21 #include <RefConvert.hpp>
22 
23 bool
24 printGCPSaveReq(FILE * output,
25  const Uint32 * theData,
26  Uint32 len,
27  Uint16 receiverBlockNo){
28 
29  GCPSaveReq * sr = (GCPSaveReq*)theData;
30 
31  fprintf(output, " dihBlockRef = (%d, %d) dihPtr = %d gci = %d\n",
32  refToBlock(sr->dihBlockRef), refToNode(sr->dihBlockRef),
33  sr->dihPtr, sr->gci);
34 
35  return true;
36 }
37 
38 bool
39 printGCPSaveRef(FILE * output,
40  const Uint32 * theData,
41  Uint32 len,
42  Uint16 receiverBlockNo){
43 
44  GCPSaveRef * sr = (GCPSaveRef*)theData;
45 
46  fprintf(output, " nodeId = %d dihPtr = %d gci = %d reason: ",
47  sr->nodeId,
48  sr->dihPtr, sr->gci);
49 
50  switch(sr->errorCode){
51  case GCPSaveRef::NodeShutdownInProgress:
52  fprintf(output, "NodeShutdownInProgress\n");
53  break;
54  case GCPSaveRef::FakedSignalDueToNodeFailure:
55  fprintf(output, "FakedSignalDueToNodeFailure\n");
56  break;
57  default:
58  fprintf(output, "Unknown reason: %d\n", sr->errorCode);
59  return false;
60  }
61 
62  return true;
63 }
64 
65 bool
66 printGCPSaveConf(FILE * output,
67  const Uint32 * theData,
68  Uint32 len,
69  Uint16 receiverBlockNo){
70 
71  GCPSaveConf * sr = (GCPSaveConf*)theData;
72 
73  fprintf(output, " nodeId = %d dihPtr = %d gci = %d\n",
74  sr->nodeId,
75  sr->dihPtr, sr->gci);
76 
77  return true;
78 }
79 
80