MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DbtcProxy.hpp
1 /*
2  Copyright (c) 2011, 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 NDB_DBTC_PROXY_HPP
19 #define NDB_DBTC_PROXY_HPP
20 
21 #include <LocalProxy.hpp>
22 #include <signaldata/CreateTab.hpp>
23 #include <signaldata/TabCommit.hpp>
24 #include <signaldata/PrepDropTab.hpp>
25 #include <signaldata/DropTab.hpp>
26 #include <signaldata/AlterTab.hpp>
27 #include <signaldata/GCP.hpp>
28 
29 #include <signaldata/CreateIndxImpl.hpp>
30 #include <signaldata/AlterIndxImpl.hpp>
31 #include <signaldata/DropIndxImpl.hpp>
32 
33 class DbtcProxy : public LocalProxy {
34 public:
36  virtual ~DbtcProxy();
37  BLOCK_DEFINES(DbtcProxy);
38 
39 protected:
40  virtual SimulatedBlock* newWorker(Uint32 instanceNo);
41 
42  // GSN_NDB_STTOR
43  virtual void callNDB_STTOR(Signal*);
44 
45  // GSN_TC_SCHVERREQ
47  TcSchVerReq m_req;
48  Ss_TC_SCHVERREQ() {
49  m_sendREQ = (SsFUNCREQ)&DbtcProxy::sendTC_SCHVERREQ;
50  m_sendCONF = (SsFUNCREP)&DbtcProxy::sendTC_SCHVERCONF;
51  }
52  enum { poolSize = 1 };
53  static SsPool<Ss_TC_SCHVERREQ>& pool(LocalProxy* proxy) {
54  return ((DbtcProxy*)proxy)->c_ss_TC_SCHVERREQ;
55  }
56  };
57  SsPool<Ss_TC_SCHVERREQ> c_ss_TC_SCHVERREQ;
58  void execTC_SCHVERREQ(Signal*);
59  void sendTC_SCHVERREQ(Signal*, Uint32 ssId, SectionHandle*);
60  void execTC_SCHVERCONF(Signal*);
61  void sendTC_SCHVERCONF(Signal*, Uint32 ssId);
62 
63  // GSN_TAB_COMMITREQ [ sub-op ]
65  TabCommitReq m_req;
67  m_sendREQ = (SsFUNCREQ)&DbtcProxy::sendTAB_COMMITREQ;
68  m_sendCONF = (SsFUNCREP)&DbtcProxy::sendTAB_COMMITCONF;
69  }
70  enum { poolSize = 1 };
71  static SsPool<Ss_TAB_COMMITREQ>& pool(LocalProxy* proxy) {
72  return ((DbtcProxy*)proxy)->c_ss_TAB_COMMITREQ;
73  }
74  };
75  SsPool<Ss_TAB_COMMITREQ> c_ss_TAB_COMMITREQ;
76  void execTAB_COMMITREQ(Signal*);
77  void sendTAB_COMMITREQ(Signal*, Uint32 ssId, SectionHandle*);
78  void execTAB_COMMITCONF(Signal*);
79  void execTAB_COMMITREF(Signal*);
80  void sendTAB_COMMITCONF(Signal*, Uint32 ssId);
81 
82  // GSN_PREP_DROP_TAB_REQ
84  PrepDropTabReq m_req;
86  m_sendREQ = (SsFUNCREQ)&DbtcProxy::sendPREP_DROP_TAB_REQ;
87  m_sendCONF = (SsFUNCREP)&DbtcProxy::sendPREP_DROP_TAB_CONF;
88  }
89  enum { poolSize = 1 };
90  static SsPool<Ss_PREP_DROP_TAB_REQ>& pool(LocalProxy* proxy) {
91  return ((DbtcProxy*)proxy)->c_ss_PREP_DROP_TAB_REQ;
92  }
93  };
94 
95  SsPool<Ss_PREP_DROP_TAB_REQ> c_ss_PREP_DROP_TAB_REQ;
96  Uint32 getSsId(const PrepDropTabReq* req) {
97  return SsIdBase | req->tableId;
98  }
99  Uint32 getSsId(const PrepDropTabConf* conf) {
100  return SsIdBase | conf->tableId;
101  }
102  Uint32 getSsId(const PrepDropTabRef* ref) {
103  return SsIdBase | ref->tableId;
104  }
105  void execPREP_DROP_TAB_REQ(Signal*);
106  void sendPREP_DROP_TAB_REQ(Signal*, Uint32 ssId, SectionHandle*);
107  void execPREP_DROP_TAB_CONF(Signal*);
108  void execPREP_DROP_TAB_REF(Signal*);
109  void sendPREP_DROP_TAB_CONF(Signal*, Uint32 ssId);
110 
111  // GSN_DROP_TAB_REQ
113  DropTabReq m_req;
114  Ss_DROP_TAB_REQ() {
115  m_sendREQ = (SsFUNCREQ)&DbtcProxy::sendDROP_TAB_REQ;
116  m_sendCONF = (SsFUNCREP)&DbtcProxy::sendDROP_TAB_CONF;
117  }
118  enum { poolSize = 1 };
119  static SsPool<Ss_DROP_TAB_REQ>& pool(LocalProxy* proxy) {
120  return ((DbtcProxy*)proxy)->c_ss_DROP_TAB_REQ;
121  }
122  };
123  SsPool<Ss_DROP_TAB_REQ> c_ss_DROP_TAB_REQ;
124  Uint32 getSsId(const DropTabReq* req) {
125  return SsIdBase | req->tableId;
126  }
127  Uint32 getSsId(const DropTabConf* conf) {
128  return SsIdBase | conf->tableId;
129  }
130  Uint32 getSsId(const DropTabRef* ref) {
131  return SsIdBase | ref->tableId;
132  }
133  void execDROP_TAB_REQ(Signal*);
134  void sendDROP_TAB_REQ(Signal*, Uint32 ssId, SectionHandle*);
135  void execDROP_TAB_CONF(Signal*);
136  void execDROP_TAB_REF(Signal*);
137  void sendDROP_TAB_CONF(Signal*, Uint32 ssId);
138 
139  // GSN_ALTER_TAB_REQ
141  AlterTabReq m_req;
142  Ss_ALTER_TAB_REQ() {
143  m_sendREQ = (SsFUNCREQ)&DbtcProxy::sendALTER_TAB_REQ;
144  m_sendCONF = (SsFUNCREP)&DbtcProxy::sendALTER_TAB_CONF;
145  }
146  enum { poolSize = 1 };
147  static SsPool<Ss_ALTER_TAB_REQ>& pool(LocalProxy* proxy) {
148  return ((DbtcProxy*)proxy)->c_ss_ALTER_TAB_REQ;
149  }
150  };
151  SsPool<Ss_ALTER_TAB_REQ> c_ss_ALTER_TAB_REQ;
152  Uint32 getSsId(const AlterTabReq* req) {
153  return SsIdBase | req->tableId;
154  }
155  Uint32 getSsId(const AlterTabConf* conf) {
156  return conf->senderData;
157  }
158  Uint32 getSsId(const AlterTabRef* ref) {
159  return ref->senderData;
160  }
161  void execALTER_TAB_REQ(Signal*);
162  void sendALTER_TAB_REQ(Signal*, Uint32 ssId, SectionHandle*);
163  void execALTER_TAB_CONF(Signal*);
164  void execALTER_TAB_REF(Signal*);
165  void sendALTER_TAB_CONF(Signal*, Uint32 ssId);
166 
170  Uint32 m_tc_seize_req_instance; // round robin
171  void execTCSEIZEREQ(Signal* signal);
172 
177  Uint32 m_sum;
178  Uint32 m_req[2];
180  m_sendREQ = (SsFUNCREQ)&DbtcProxy::sendTCGETOPSIZEREQ;
181  m_sendCONF = (SsFUNCREP)&DbtcProxy::sendTCGETOPSIZECONF;
182  }
183  enum { poolSize = 1 };
184  static SsPool<Ss_TCGETOPSIZEREQ>& pool(LocalProxy* proxy) {
185  return ((DbtcProxy*)proxy)->c_ss_TCGETOPSIZEREQ;
186  }
187  };
188  SsPool<Ss_TCGETOPSIZEREQ> c_ss_TCGETOPSIZEREQ;
189  void execTCGETOPSIZEREQ(Signal*);
190  void sendTCGETOPSIZEREQ(Signal*, Uint32 ssId, SectionHandle*);
191  void execTCGETOPSIZECONF(Signal*);
192  void sendTCGETOPSIZECONF(Signal*, Uint32 ssId);
193 
198  Uint32 m_req[2];
200  m_sendREQ = (SsFUNCREQ)&DbtcProxy::sendTC_CLOPSIZEREQ;
201  m_sendCONF = (SsFUNCREP)&DbtcProxy::sendTC_CLOPSIZECONF;
202  }
203  enum { poolSize = 1 };
204  static SsPool<Ss_TC_CLOPSIZEREQ>& pool(LocalProxy* proxy) {
205  return ((DbtcProxy*)proxy)->c_ss_TC_CLOPSIZEREQ;
206  }
207  };
208  SsPool<Ss_TC_CLOPSIZEREQ> c_ss_TC_CLOPSIZEREQ;
209  void execTC_CLOPSIZEREQ(Signal*);
210  void sendTC_CLOPSIZEREQ(Signal*, Uint32 ssId, SectionHandle*);
211  void execTC_CLOPSIZECONF(Signal*);
212  void sendTC_CLOPSIZECONF(Signal*, Uint32 ssId);
213 
214  // GSN_GCP_NOMORETRANS
216  GCPNoMoreTrans m_req;
218  m_sendREQ = (SsFUNCREQ)&DbtcProxy::sendGCP_NOMORETRANS;
219  m_sendCONF = (SsFUNCREP)&DbtcProxy::sendGCP_TCFINISHED;
220  }
221  enum { poolSize = 1 };
222  static SsPool<Ss_GCP_NOMORETRANS>& pool(LocalProxy* proxy) {
223  return ((DbtcProxy*)proxy)->c_ss_GCP_NOMORETRANS;
224  }
225  };
226  SsPool<Ss_GCP_NOMORETRANS> c_ss_GCP_NOMORETRANS;
227  void execGCP_NOMORETRANS(Signal*);
228  void sendGCP_NOMORETRANS(Signal*, Uint32 ssId, SectionHandle*);
229  void execGCP_TCFINISHED(Signal*);
230  void sendGCP_TCFINISHED(Signal*, Uint32 ssId);
231 
232  // GSN_API_FAILREQ
234  Uint32 m_ref; //
235  Ss_API_FAILREQ() {
236  m_sendREQ = (SsFUNCREQ)&DbtcProxy::sendAPI_FAILREQ;
237  m_sendCONF = (SsFUNCREP)&DbtcProxy::sendAPI_FAILCONF;
238  }
239  enum { poolSize = MAX_NDB_NODES };
240  static SsPool<Ss_API_FAILREQ>& pool(LocalProxy* proxy) {
241  return ((DbtcProxy*)proxy)->c_ss_API_FAILREQ;
242  }
243  };
244  SsPool<Ss_API_FAILREQ> c_ss_API_FAILREQ;
245  void execAPI_FAILREQ(Signal*);
246  void sendAPI_FAILREQ(Signal*, Uint32 ssId, SectionHandle*);
247  void execAPI_FAILCONF(Signal*);
248  void sendAPI_FAILCONF(Signal*, Uint32 ssId);
249 
250  // GSN_CREATE_INDX_IMPL_REQ
252  CreateIndxImplReq m_req;
253 
255  m_sendREQ = (SsFUNCREQ)&DbtcProxy::sendCREATE_INDX_IMPL_REQ;
256  m_sendCONF = (SsFUNCREP)&DbtcProxy::sendCREATE_INDX_IMPL_CONF;
257  }
258  enum { poolSize = 1 };
259  static SsPool<Ss_CREATE_INDX_IMPL_REQ>& pool(LocalProxy* proxy) {
260  return ((DbtcProxy*)proxy)->c_ss_CREATE_INDX_IMPL_REQ;
261  }
262  };
263  SsPool<Ss_CREATE_INDX_IMPL_REQ> c_ss_CREATE_INDX_IMPL_REQ;
264  void execCREATE_INDX_IMPL_REQ(Signal*);
265  void sendCREATE_INDX_IMPL_REQ(Signal*, Uint32 ssId, SectionHandle*);
266  void execCREATE_INDX_IMPL_CONF(Signal*);
267  void execCREATE_INDX_IMPL_REF(Signal*);
268  void sendCREATE_INDX_IMPL_CONF(Signal*, Uint32 ssId);
269 
270  // GSN_ALTER_INDX_IMPL_REQ
272  AlterIndxImplReq m_req;
274  m_sendREQ = (SsFUNCREQ)&DbtcProxy::sendALTER_INDX_IMPL_REQ;
275  m_sendCONF = (SsFUNCREP)&DbtcProxy::sendALTER_INDX_IMPL_CONF;
276  }
277  enum { poolSize = 1 };
278  static SsPool<Ss_ALTER_INDX_IMPL_REQ>& pool(LocalProxy* proxy) {
279  return ((DbtcProxy*)proxy)->c_ss_ALTER_INDX_IMPL_REQ;
280  }
281  };
282  SsPool<Ss_ALTER_INDX_IMPL_REQ> c_ss_ALTER_INDX_IMPL_REQ;
283  void execALTER_INDX_IMPL_REQ(Signal*);
284  void sendALTER_INDX_IMPL_REQ(Signal*, Uint32 ssId, SectionHandle*);
285  void execALTER_INDX_IMPL_CONF(Signal*);
286  void execALTER_INDX_IMPL_REF(Signal*);
287  void sendALTER_INDX_IMPL_CONF(Signal*, Uint32 ssId);
288 
289  // GSN_DROP_INDX_IMPL_REQ
291  DropIndxImplReq m_req;
293  m_sendREQ = (SsFUNCREQ)&DbtcProxy::sendDROP_INDX_IMPL_REQ;
294  m_sendCONF = (SsFUNCREP)&DbtcProxy::sendDROP_INDX_IMPL_CONF;
295  }
296  enum { poolSize = 1 };
297  static SsPool<Ss_DROP_INDX_IMPL_REQ>& pool(LocalProxy* proxy) {
298  return ((DbtcProxy*)proxy)->c_ss_DROP_INDX_IMPL_REQ;
299  }
300  };
301  SsPool<Ss_DROP_INDX_IMPL_REQ> c_ss_DROP_INDX_IMPL_REQ;
302  void execDROP_INDX_IMPL_REQ(Signal*);
303  void sendDROP_INDX_IMPL_REQ(Signal*, Uint32 ssId, SectionHandle*);
304  void execDROP_INDX_IMPL_CONF(Signal*);
305  void execDROP_INDX_IMPL_REF(Signal*);
306  void sendDROP_INDX_IMPL_CONF(Signal*, Uint32 ssId);
307 
308  // GSN_TAKE_OVERTCCONF
309  void execTAKE_OVERTCCONF(Signal*);
310 };
311 
312 #endif