MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CntrStart.hpp
1 /*
2  Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; version 2 of the License.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #ifndef CNTR_START_HPP
19 #define CNTR_START_HPP
20 
21 #include <NodeBitmask.hpp>
22 
26 class CntrStartReq {
30  friend class Ndbcntr;
31 
32  friend bool printCNTR_START_REQ(FILE*, const Uint32 *, Uint32, Uint16);
33 
34 public:
35  STATIC_CONST( SignalLength = 3 );
36 private:
37 
38  Uint32 nodeId;
39  Uint32 startType;
40  Uint32 lastGci;
41 };
42 
43 class CntrStartRef {
47  friend class Ndbcntr;
48 
49  friend bool printCNTR_START_REF(FILE*, const Uint32 *, Uint32, Uint16);
50 public:
51  STATIC_CONST( SignalLength = 2 );
52 
53  enum ErrorCode {
54  OK = 0,
55  NotMaster = 1,
56  StopInProgress = 2
57  };
58 private:
59 
60  Uint32 errorCode;
61  Uint32 masterNodeId;
62 };
63 
68  friend class Ndbcntr;
69  friend struct UpgradeStartup;
70 
71  friend bool printCNTR_START_CONF(FILE*, const Uint32 *, Uint32, Uint16);
72 
73 public:
74  STATIC_CONST( SignalLength = 4 + 2 * NdbNodeBitmask::Size );
75 
76 private:
77 
78  Uint32 startType;
79  Uint32 startGci;
80  Uint32 masterNodeId;
81  Uint32 noStartNodes;
82  Uint32 startedNodes[NdbNodeBitmask::Size];
83  Uint32 startingNodes[NdbNodeBitmask::Size];
84 };
85 
87 {
88  Uint32 nodeId;
89  Uint32 waitPoint;
90  Uint32 request;
91  Uint32 sp;
92 
93  enum Request
94  {
95  WaitFor = 1,
96  Grant = 2
97  };
98 
99  STATIC_CONST( SignalLength = 4 );
100 
101  enum WaitPos
102  {
103  ZWAITPOINT_4_1 = 1
104  ,ZWAITPOINT_4_2 = 2
105  ,ZWAITPOINT_5_1 = 3
106  ,ZWAITPOINT_5_2 = 4
107  ,ZWAITPOINT_6_1 = 5
108  ,ZWAITPOINT_6_2 = 6
109  ,ZWAITPOINT_7_1 = 7
110  ,ZWAITPOINT_7_2 = 8
111  ,ZWAITPOINT_4_2_TO = 9 // We are forced to TO (during SR)
112  };
113 };
114 
115 #endif