MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StartRec.cpp
1 /*
2  Copyright (C) 2003, 2005-2007 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 
20 #include <RefConvert.hpp>
21 #include <signaldata/StartRec.hpp>
22 #include <signaldata/StartFragReq.hpp>
23 
24 bool
25 printSTART_REC_REQ(FILE * output,
26  const Uint32 * theData,
27  Uint32 len,
28  Uint16 recBlockNo){
29  StartRecReq * sig = (StartRecReq *) theData;
30 
31  if (len != StartRecReq::SignalLength)
32  return false;
33 
34  fprintf(output, " receivingNodeId: %d senderRef: (%d, %d)\n",
35  sig->receivingNodeId,
36  refToNode(sig->senderRef),
37  refToBlock(sig->senderRef));
38 
39  fprintf(output,
40  " keepGci: %d lastCompletedGci: %d newestGci: %d senderData: %x\n",
41  sig->keepGci,
42  sig->lastCompletedGci,
43  sig->newestGci,
44  sig->senderData);
45 
46  NdbNodeBitmask mask;
47  mask.assign(NdbNodeBitmask::Size, sig->sr_nodes);
48 
49  char buf[100];
50  fprintf(output,
51  " sr_nodes: %s\n", mask.getText(buf));
52 
53  return true;
54 }
55 
56 bool
57 printSTART_REC_CONF(FILE * output,
58  const Uint32 * theData,
59  Uint32 len,
60  Uint16 recBlockNo){
61  StartRecConf * sig = (StartRecConf *) theData;
62 
63  if (len != StartRecConf::SignalLength)
64  return false;
65 
66  fprintf(output, " startingNodeId: %d senderData: %u\n",
67  sig->startingNodeId,
68  sig->senderData);
69 
70  return true;
71 }
72 
73 bool
74 printSTART_FRAG_REQ(FILE * output,
75  const Uint32 * theData,
76  Uint32 len,
77  Uint16 recBlockNo)
78 {
79  StartFragReq* sig = (StartFragReq*)theData;
80 
81  fprintf(output, " table: %d frag: %d lcpId: %d lcpNo: %d #nodes: %d \n",
82  sig->tableId, sig->fragId, sig->lcpId, sig->lcpNo,
83  sig->noOfLogNodes);
84 
85  for(Uint32 i = 0; i<sig->noOfLogNodes; i++)
86  {
87  fprintf(output, " (node: %d startGci: %d lastGci: %d)",
88  sig->lqhLogNode[i],
89  sig->startGci[i],
90  sig->lastGci[i]);
91  }
92 
93  fprintf(output, "\n");
94  return true;
95 }