16 #ifndef NDB_DBLQH_PROXY_HPP
17 #define NDB_DBLQH_PROXY_HPP
19 #include <LocalProxy.hpp>
20 #include <signaldata/CreateTab.hpp>
21 #include <signaldata/LqhFrag.hpp>
22 #include <signaldata/TabCommit.hpp>
23 #include <signaldata/LCP.hpp>
24 #include <signaldata/GCP.hpp>
25 #include <signaldata/PrepDropTab.hpp>
26 #include <signaldata/DropTab.hpp>
27 #include <signaldata/AlterTab.hpp>
28 #include <signaldata/StartRec.hpp>
29 #include <signaldata/LqhTransReq.hpp>
30 #include <signaldata/LqhTransConf.hpp>
31 #include <signaldata/EmptyLcp.hpp>
43 Uint32 c_tableRecSize;
47 virtual void callNDB_STTOR(
Signal*);
48 virtual void callREAD_CONFIG_REQ(
Signal*);
53 Uint32 m_lqhConnectPtr[MaxWorkers];
55 m_sendREQ = (SsFUNCREQ)&DblqhProxy::sendCREATE_TAB_REQ;
56 m_sendCONF = (SsFUNCREP)&DblqhProxy::sendCREATE_TAB_CONF;
58 enum { poolSize = 1 };
60 return ((
DblqhProxy*)proxy)->c_ss_CREATE_TAB_REQ;
64 void execCREATE_TAB_REQ(
Signal*);
66 void execCREATE_TAB_CONF(
Signal*);
67 void execCREATE_TAB_REF(
Signal*);
68 void sendCREATE_TAB_CONF(
Signal*, Uint32 ssId);
75 m_sendREQ = (SsFUNCREQ)&DblqhProxy::sendLQHADDATTREQ;
78 enum { poolSize = 1 };
80 return ((
DblqhProxy*)proxy)->c_ss_LQHADDATTREQ;
86 void execLQHADDATTCONF(
Signal*);
87 void execLQHADDATTREF(
Signal*);
91 void execLQHFRAGREQ(
Signal*);
97 m_sendREQ = (SsFUNCREQ)&DblqhProxy::sendTAB_COMMITREQ;
98 m_sendCONF = (SsFUNCREP)&DblqhProxy::sendTAB_COMMITCONF;
100 enum { poolSize = 1 };
102 return ((
DblqhProxy*)proxy)->c_ss_TAB_COMMITREQ;
106 void execTAB_COMMITREQ(
Signal*);
108 void execTAB_COMMITCONF(
Signal*);
109 void execTAB_COMMITREF(
Signal*);
110 void sendTAB_COMMITCONF(
Signal*, Uint32 ssId);
114 static const char* name() {
return "GCP_SAVEREQ"; }
117 m_sendREQ = (SsFUNCREQ)&DblqhProxy::sendGCP_SAVEREQ;
118 m_sendCONF = (SsFUNCREP)&DblqhProxy::sendGCP_SAVECONF;
120 enum { poolSize = 1 };
122 return ((
DblqhProxy*)proxy)->c_ss_GCP_SAVEREQ;
127 return SsIdBase | (req->gci & 0xFFFF);
130 return SsIdBase | (conf->gci & 0xFFFF);
133 return SsIdBase | (ref->gci & 0xFFFF);
135 void execGCP_SAVEREQ(
Signal*);
137 void execGCP_SAVECONF(
Signal*);
138 void execGCP_SAVEREF(
Signal*);
139 void sendGCP_SAVECONF(
Signal*, Uint32 ssId);
142 void execSUB_GCP_COMPLETE_REP(
Signal*);
148 m_sendREQ = (SsFUNCREQ)&DblqhProxy::sendPREP_DROP_TAB_REQ;
149 m_sendCONF = (SsFUNCREP)&DblqhProxy::sendPREP_DROP_TAB_CONF;
151 enum { poolSize = 1 };
153 return ((
DblqhProxy*)proxy)->c_ss_PREP_DROP_TAB_REQ;
158 return SsIdBase | req->tableId;
161 return SsIdBase | conf->tableId;
164 return SsIdBase | ref->tableId;
166 void execPREP_DROP_TAB_REQ(
Signal*);
168 void execPREP_DROP_TAB_CONF(
Signal*);
169 void execPREP_DROP_TAB_REF(
Signal*);
170 void sendPREP_DROP_TAB_CONF(
Signal*, Uint32 ssId);
176 m_sendREQ = (SsFUNCREQ)&DblqhProxy::sendDROP_TAB_REQ;
177 m_sendCONF = (SsFUNCREP)&DblqhProxy::sendDROP_TAB_CONF;
179 enum { poolSize = 1 };
181 return ((
DblqhProxy*)proxy)->c_ss_DROP_TAB_REQ;
186 return SsIdBase | req->tableId;
189 return SsIdBase | conf->tableId;
192 return SsIdBase | ref->tableId;
194 void execDROP_TAB_REQ(
Signal*);
196 void execDROP_TAB_CONF(
Signal*);
197 void execDROP_TAB_REF(
Signal*);
198 void sendDROP_TAB_CONF(
Signal*, Uint32 ssId);
204 m_sendREQ = (SsFUNCREQ)&DblqhProxy::sendALTER_TAB_REQ;
205 m_sendCONF = (SsFUNCREP)&DblqhProxy::sendALTER_TAB_CONF;
207 enum { poolSize = 1 };
209 return ((
DblqhProxy*)proxy)->c_ss_ALTER_TAB_REQ;
214 return SsIdBase | req->tableId;
217 return conf->senderData;
220 return ref->senderData;
222 void execALTER_TAB_REQ(
Signal*);
224 void execALTER_TAB_CONF(
Signal*);
225 void execALTER_TAB_REF(
Signal*);
226 void sendALTER_TAB_CONF(
Signal*, Uint32 ssId);
241 static const char* name() {
return "START_RECREQ"; }
244 enum { m_req2cnt = 2 };
250 m_sendREQ = (SsFUNCREQ)&DblqhProxy::sendSTART_RECREQ;
252 m_req2[0].m_blockNo = LGMAN;
253 m_req2[1].m_blockNo = TSMAN;
255 enum { poolSize = 1 };
257 return ((
DblqhProxy*)proxy)->c_ss_START_RECREQ;
261 void execSTART_RECREQ(
Signal*);
263 void execSTART_RECCONF(
Signal*);
268 static const char* name() {
return "START_RECREQ_2"; }
270 enum { SignalLength = 2 };
276 enum { SignalLength = 1 };
283 m_sendREQ = (SsFUNCREQ)&DblqhProxy::sendSTART_RECCONF_2;
284 m_sendCONF = (SsFUNCREP)&DblqhProxy::sendSTART_RECREQ_2;
286 enum { poolSize = 2 };
287 static SsPool<Ss_START_RECREQ_2>& pool(
LocalProxy* proxy) {
288 return ((
DblqhProxy*)proxy)->c_ss_START_RECREQ_2;
291 SsPool<Ss_START_RECREQ_2> c_ss_START_RECREQ_2;
292 Uint32 getSsId(
const Ss_START_RECREQ_2::Req* req) {
293 return SsIdBase | req->proxyBlockNo;
295 Uint32 getSsId(
const Ss_START_RECREQ_2::Conf* conf) {
296 return SsIdBase | refToBlock(conf->senderRef);
298 void execSTART_RECREQ_2(
Signal*);
299 void sendSTART_RECREQ_2(
Signal*, Uint32 ssId);
300 void execSTART_RECCONF_2(
Signal*);
305 static const char* name() {
return "LQH_TRANSREQ"; }
315 m_sendREQ = (SsFUNCREQ)&DblqhProxy::sendLQH_TRANSREQ;
316 m_sendCONF = (SsFUNCREP)&DblqhProxy::sendLQH_TRANSCONF;
318 enum { poolSize = MAX_NDB_NODES };
319 static SsPool<Ss_LQH_TRANSREQ>& pool(
LocalProxy* proxy) {
320 return ((
DblqhProxy*)proxy)->c_ss_LQH_TRANSREQ;
323 SsPool<Ss_LQH_TRANSREQ> c_ss_LQH_TRANSREQ;
327 void sendLQH_TRANSCONF(
Signal*, Uint32 ssId);
338 static const char* name() {
return "EXEC_SR_1"; }
340 enum { SignalLength = 1 };
343 GlobalSignalNumber m_gsn;
346 m_sendREQ = (SsFUNCREQ)&DblqhProxy::sendEXEC_SR_1;
347 m_sendCONF = (SsFUNCREP)0;
350 enum { poolSize = 1 };
351 static SsPool<Ss_EXEC_SR_1>& pool(
LocalProxy* proxy) {
355 SsPool<Ss_EXEC_SR_1> c_ss_EXEC_SR_1;
356 Uint32 getSsId(
const Ss_EXEC_SR_1::Sig* sig) {
357 return SsIdBase | refToNode(sig->nodeId);
359 void execEXEC_SRREQ(
Signal*);
360 void execEXEC_SRCONF(
Signal*);
361 void execEXEC_SR_1(
Signal*, GlobalSignalNumber gsn);
366 static const char* name() {
return "EXEC_SR_2"; }
368 enum { SignalLength = 1 + NdbNodeBitmask::Size };
370 Uint32 sr_nodes[NdbNodeBitmask::Size];
372 GlobalSignalNumber m_gsn;
377 m_sendREQ = (SsFUNCREQ)0;
378 m_sendCONF = (SsFUNCREP)&DblqhProxy::sendEXEC_SR_2;
382 enum { poolSize = 1 };
383 static SsPool<Ss_EXEC_SR_2>& pool(
LocalProxy* proxy) {
387 SsPool<Ss_EXEC_SR_2> c_ss_EXEC_SR_2;
388 Uint32 getSsId(
const Ss_EXEC_SR_2::Sig* sig) {
389 return SsIdBase | refToNode(sig->nodeId);
391 void execEXEC_SR_2(
Signal*, GlobalSignalNumber gsn);
392 void sendEXEC_SR_2(
Signal*, Uint32 ssId);
400 void execEXEC_FRAGCONF(
Signal*);
406 m_sendREQ = (SsFUNCREQ)&DblqhProxy::sendDROP_FRAG_REQ;
407 m_sendCONF = (SsFUNCREP)&DblqhProxy::sendDROP_FRAG_CONF;
409 enum { poolSize = 1 };
411 return ((
DblqhProxy*)proxy)->c_ss_DROP_FRAG_REQ;
416 return SsIdBase | (req->tableId ^ req->fragId);
419 return SsIdBase | (conf->tableId ^ conf->fragId);
422 return SsIdBase | (ref->tableId ^ ref->fragId);
424 void execDROP_FRAG_REQ(
Signal*);
426 void execDROP_FRAG_CONF(
Signal*);
427 void execDROP_FRAG_REF(
Signal*);
428 void sendDROP_FRAG_CONF(
Signal*, Uint32 ssId);
431 void execEMPTY_LCP_REQ(
Signal*);
434 void execEND_LCP_CONF(
Signal*);
435 void execLCP_COMPLETE_REP(
Signal*);
447 Uint32 m_lcp_frag_ord_cnt;
448 Uint32 m_lcp_frag_rep_cnt;
449 Uint32 m_complete_outstanding;
452 bool m_lastFragmentFlag;
457 m_lcp_frag_ord_cnt = 0;
458 m_lcp_frag_rep_cnt = 0;
459 m_lastFragmentFlag =
false;
463 Uint32 getNoOfOutstanding(
const LcpRecord&)
const;
467 void sendLCP_COMPLETE_REP(
Signal*);
470 void checkSendEMPTY_LCP_CONF(
Signal* signal) {
471 if (c_lcpRecord.m_empty_lcp_req.
isclear())