MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Cmvmi.hpp
1 /*
2  Copyright (c) 2003, 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 Cmvmi_H_
19 #define Cmvmi_H_
20 
21 #include <pc.hpp>
22 #include <SimulatedBlock.hpp>
23 #include <LogLevel.hpp>
24 
25 #include <DLList.hpp>
26 
30 class Cmvmi : public SimulatedBlock {
31 public:
33  virtual ~Cmvmi();
34 
35 private:
42  void execDISCONNECT_REP(Signal*);
43  void execCONNECT_REP(Signal*);
44 
45 private:
46  BLOCK_DEFINES(Cmvmi);
47 
48  // The signal processing functions
49  void execNDB_TAMPER(Signal* signal);
50  void execSET_LOGLEVELORD(Signal* signal);
51  void execEVENT_REP(Signal* signal);
52  void execREAD_CONFIG_REQ(Signal* signal);
53  void execSTTOR(Signal* signal);
54  void execCLOSE_COMREQ(Signal* signal);
55  void execENABLE_COMREQ(Signal* signal);
56  void execOPEN_COMREQ(Signal* signal);
57  void execSIZEALT_ACK(Signal* signal);
58  void execTEST_ORD(Signal* signal);
59 
60  void execSTOP_ORD(Signal* signal);
61  void execSTART_ORD(Signal* signal);
62  void execTAMPER_ORD(Signal* signal);
63 
64  void execDUMP_STATE_ORD(Signal* signal);
65 
66  void execEVENT_SUBSCRIBE_REQ(Signal *);
67  void cancelSubscription(NodeId nodeId);
68 
69  void execTESTSIG(Signal* signal);
70  void execNODE_START_REP(Signal* signal);
71 
72  void execCONTINUEB(Signal* signal);
73 
74  void execROUTE_ORD(Signal* signal);
75 
76  void execDBINFO_SCANREQ(Signal *signal);
77 
78  void execALLOC_MEM_REF(Signal*);
79  void execALLOC_MEM_CONF(Signal*);
80 
81  void execGET_CONFIG_REQ(Signal*);
82 
83  char theErrorMessage[256];
84  void sendSTTORRY(Signal* signal);
85 
86  LogLevel clogLevel;
87  NdbNodeBitmask c_dbNodes;
88 
92  struct EventRepSubscriber {
96  LogLevel logLevel;
97 
102  BlockReference blockRef;
103 
107  union { Uint32 nextPool; Uint32 nextList; };
108  Uint32 prevList;
109  };
111 
115  ArrayPool<EventRepSubscriber> subscriberPool;
116 
120  DLList<EventRepSubscriber> subscribers;
121 
122 private:
123  // Declared but not defined
124  Cmvmi(const Cmvmi &obj);
125  void operator = (const Cmvmi &);
126 
127  void startFragmentedSend(Signal* signal, Uint32 variant, Uint32 numSigs, NodeReceiverGroup rg);
128  void testNodeFailureCleanupCallback(Signal* signal, Uint32 variant, Uint32 elementsCleaned);
129  void testFragmentedCleanup(Signal* signal, SectionHandle* handle, Uint32 testType, Uint32 variant);
130  void sendFragmentedComplete(Signal* signal, Uint32 data, Uint32 returnCode);
131 
132  Uint32 c_memusage_report_frequency;
133  void reportDMUsage(Signal* signal, int incDec,
134  BlockReference ref = CMVMI_REF);
135  void reportIMUsage(Signal* signal, int incDec,
136  BlockReference ref = CMVMI_REF);
137 
138  NDB_TICKS m_start_time;
139 
140  struct SyncRecord
141  {
142  Uint32 m_senderRef;
143  Uint32 m_senderData;
144  Uint32 m_prio;
145  Uint32 m_cnt;
146  Uint32 m_error;
147  Uint32 nextPool;
148  };
149  ArrayPool<SyncRecord> c_syncReqPool;
150 
151  void execSYNC_REQ(Signal*);
152  void execSYNC_REF(Signal*);
153  void execSYNC_CONF(Signal*);
154  void sendSYNC_REP(Signal * signal, Ptr<SyncRecord> ptr);
155 
156  void init_global_page_pool();
157 };
158 
159 #endif