mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / storage / ndb / include / kernel / signaldata / CmRegSignalData.hpp
blob8db1a394890457e0302d153d6e8a096ccca9afc3
1 /* Copyright (c) 2003, 2005, 2006 MySQL AB
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.
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.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */
16 #ifndef CM_REG_HPP
17 #define CM_REG_HPP
19 #include <NodeBitmask.hpp>
21 /**
22 * This is the first distributed signal
23 * (the node tries to register in the cluster)
25 class CmRegReq {
26 /**
27 * Sender(s) & Reciver(s)
29 friend class Qmgr;
31 public:
32 STATIC_CONST( SignalLength = 5 + NdbNodeBitmask::Size );
33 private:
35 Uint32 blockRef;
36 Uint32 nodeId;
37 Uint32 version; // See ndb_version.h
39 Uint32 start_type; // As specified by cmd-line or mgm, NodeState::StartType
40 Uint32 latest_gci; // 0 means no fs
41 Uint32 skip_nodes[NdbNodeBitmask::Size]; // Nodes that does not _need_
42 // to be part of restart
45 /**
46 * The node receving this signal has been accepted into the cluster
48 class CmRegConf {
49 /**
50 * Sender(s) & Reciver(s)
52 friend class Qmgr;
54 public:
55 STATIC_CONST( SignalLength = 4 + NdbNodeBitmask::Size );
56 private:
58 Uint32 presidentBlockRef;
59 Uint32 presidentNodeId;
60 Uint32 presidentVersion;
62 /**
63 * The dynamic id that the node reciving this signal has
65 Uint32 dynamicId;
66 Uint32 allNdbNodes[NdbNodeBitmask::Size];
69 /**
72 class CmRegRef {
73 /**
74 * Sender(s) & Reciver(s)
76 friend class Qmgr;
78 public:
79 STATIC_CONST( SignalLength = 7 + NdbNodeBitmask::Size );
81 enum ErrorCode {
82 ZBUSY = 0, /* Only the president can send this */
83 ZBUSY_PRESIDENT = 1,/* Only the president can send this */
84 ZBUSY_TO_PRES = 2, /* Only the president can send this */
85 ZNOT_IN_CFG = 3, /* Only the president can send this */
86 ZELECTION = 4, /* Receiver is definitely not president,
87 * but we are not sure if sender ends up
88 * as president. */
89 ZNOT_PRESIDENT = 5, /* We are not president */
90 ZNOT_DEAD = 6, /* We are not dead when we are starting */
91 ZINCOMPATIBLE_VERSION = 7,
92 ZINCOMPATIBLE_START_TYPE = 8,
93 ZSINGLE_USER_MODE = 9, /* The cluster is in single user mode,
94 * data node is not allowed to get added
95 * in the cluster while in single user mode */
96 ZGENERIC = 100 /* The generic error code */
98 private:
100 Uint32 blockRef;
101 Uint32 nodeId;
102 Uint32 errorCode;
104 * Applicable if ZELECTION
106 Uint32 presidentCandidate;
107 Uint32 candidate_latest_gci; // 0 means non
110 * Data for sending node sending node
112 Uint32 latest_gci;
113 Uint32 start_type;
114 Uint32 skip_nodes[NdbNodeBitmask::Size]; // Nodes that does not _need_
115 // to be part of restart
118 class CmAdd {
120 * Sender(s) & Reciver(s)
122 friend class Qmgr;
124 public:
125 STATIC_CONST( SignalLength = 3 );
127 private:
128 enum RequestType {
129 Prepare = 0,
130 AddCommit = 1,
131 CommitNew = 2
134 Uint32 requestType;
135 Uint32 startingNodeId;
136 Uint32 startingVersion;
139 class CmAckAdd {
141 * Sender(s) & Reciver(s)
143 friend class Qmgr;
145 public:
146 STATIC_CONST( SignalLength = 3 );
148 private:
149 Uint32 senderNodeId;
150 Uint32 requestType; // see CmAdd::RequestType
151 Uint32 startingNodeId;
154 class CmNodeInfoReq {
156 * Sender(s) & Reciver(s)
158 friend class Qmgr;
160 public:
161 STATIC_CONST( SignalLength = 3 );
163 private:
165 * This is information for sending node (starting node)
167 Uint32 nodeId;
168 Uint32 dynamicId;
169 Uint32 version;
172 class CmNodeInfoRef {
174 * Sender(s) & Reciver(s)
176 friend class Qmgr;
178 public:
179 STATIC_CONST( SignalLength = 3 );
181 enum ErrorCode {
182 NotRunning = 1
185 private:
186 Uint32 nodeId;
187 Uint32 errorCode;
190 class CmNodeInfoConf {
192 * Sender(s) & Reciver(s)
194 friend class Qmgr;
196 public:
197 STATIC_CONST( SignalLength = 3 );
199 private:
200 Uint32 nodeId;
201 Uint32 dynamicId;
202 Uint32 version;
205 #endif