20 #include "NdbApiSignal.hpp"
28 #include <signaldata/TcKeyReq.hpp>
29 #include <signaldata/KeyInfo.hpp>
30 #include <signaldata/AttrInfo.hpp>
31 #include <signaldata/TestOrd.hpp>
32 #include <signaldata/CreateIndx.hpp>
33 #include <signaldata/DropIndx.hpp>
34 #include <signaldata/TcIndx.hpp>
35 #include <signaldata/IndxKeyInfo.hpp>
36 #include <signaldata/IndxAttrInfo.hpp>
37 #include <signaldata/TcHbRep.hpp>
38 #include <signaldata/ScanTab.hpp>
48 NdbApiSignal::NdbApiSignal(BlockReference ref)
50 theVerId_signalNumber = 0;
51 theReceiversBlockNumber = 0;
52 theSendersBlockRef = refToBlock(ref);
54 theSendersSignalId = 0;
59 for (
int i = 0;
i < 25;
i++)
60 theData[
i] = 0x13579753;
62 setDataPtr(&theData[0]);
66 NdbApiSignal::NdbApiSignal(
Ndb* ndb)
68 BlockReference ref = ndb->theMyRef;
69 theVerId_signalNumber = 0;
70 theReceiversBlockNumber = 0;
71 theSendersBlockRef = refToBlock(ref);
73 theSendersSignalId = 0;
78 for (
int i = 0;
i < 25;
i++)
79 theData[
i] = 0x13579753;
81 setDataPtr(&theData[0]);
97 NdbApiSignal::~NdbApiSignal()
109 NdbApiSignal::setSignal(
int aNdbSignalType, Uint32 receiversBlockNo)
111 theSendersSignalId = 0;
112 switch (aNdbSignalType)
114 case GSN_DIHNDBTAMPER:
116 theTrace = TestOrd::TraceAPI;
117 theReceiversBlockNumber = DBDIH;
118 theVerId_signalNumber = GSN_DIHNDBTAMPER;
125 theTrace = TestOrd::TraceAPI;
126 theReceiversBlockNumber = DBTC;
127 theVerId_signalNumber = GSN_TCSEIZEREQ;
134 assert(blockToMain(receiversBlockNo) == DBTC);
135 theTrace = TestOrd::TraceAPI;
136 theReceiversBlockNumber = receiversBlockNo;
137 theVerId_signalNumber = GSN_TCKEYREQ;
138 theLength = TcKeyReq::SignalLength;
142 case GSN_TCRELEASEREQ:
144 assert(blockToMain(receiversBlockNo) == DBTC);
145 theTrace = TestOrd::TraceAPI;
146 theReceiversBlockNumber = receiversBlockNo;
147 theVerId_signalNumber = GSN_TCRELEASEREQ;
154 assert(blockToMain(receiversBlockNo) == DBTC);
155 theTrace = TestOrd::TraceAPI;
156 theReceiversBlockNumber = receiversBlockNo;
157 theVerId_signalNumber = GSN_ATTRINFO;
158 theLength = AttrInfo::MaxSignalLength;
164 assert(blockToMain(receiversBlockNo) == DBTC);
165 theTrace = TestOrd::TraceAPI;
166 theReceiversBlockNumber = receiversBlockNo;
167 theVerId_signalNumber = GSN_KEYINFO;
168 theLength = KeyInfo::MaxSignalLength;
172 case GSN_TCROLLBACKREQ:
174 assert(blockToMain(receiversBlockNo) == DBTC);
175 theTrace = TestOrd::TraceAPI;
176 theReceiversBlockNumber = receiversBlockNo;
177 theVerId_signalNumber = GSN_TCROLLBACKREQ;
184 assert(blockToMain(receiversBlockNo) == DBTC);
185 theTrace = TestOrd::TraceAPI;
186 theReceiversBlockNumber = receiversBlockNo;
187 theVerId_signalNumber = GSN_TC_HBREP;
188 theLength = TcHbRep::SignalLength;
192 case GSN_TC_COMMITREQ:
194 assert(blockToMain(receiversBlockNo) == DBTC);
195 theTrace = TestOrd::TraceAPI;
196 theReceiversBlockNumber = receiversBlockNo;
197 theVerId_signalNumber = GSN_TC_COMMITREQ;
202 case GSN_SCAN_TABREQ:
204 assert(blockToMain(receiversBlockNo) == DBTC);
205 theTrace = TestOrd::TraceAPI;
206 theReceiversBlockNumber = receiversBlockNo;
207 theVerId_signalNumber = GSN_SCAN_TABREQ;
208 theLength = ScanTabReq::StaticLength;
212 case GSN_SCAN_NEXTREQ:
214 assert(blockToMain(receiversBlockNo) == DBTC);
215 theTrace = TestOrd::TraceAPI;
216 theReceiversBlockNumber = receiversBlockNo;
217 theVerId_signalNumber = GSN_SCAN_NEXTREQ;
218 theLength = ScanNextReq::SignalLength;
222 case GSN_CREATE_INDX_REQ:
224 theTrace = TestOrd::TraceAPI;
225 theReceiversBlockNumber = DBDICT;
226 theVerId_signalNumber = GSN_CREATE_INDX_REQ;
227 theLength = CreateIndxReq::SignalLength;
231 case GSN_DROP_INDX_REQ:
233 theTrace = TestOrd::TraceAPI;
234 theReceiversBlockNumber = DBDICT;
235 theVerId_signalNumber = GSN_DROP_INDX_REQ;
236 theLength = DropIndxReq::SignalLength;
242 assert(blockToMain(receiversBlockNo) == DBTC);
243 theTrace = TestOrd::TraceAPI;
244 theReceiversBlockNumber = receiversBlockNo;
245 theVerId_signalNumber = GSN_TCINDXREQ;
246 theLength = TcKeyReq::SignalLength;
250 case GSN_INDXKEYINFO:
252 assert(blockToMain(receiversBlockNo) == DBTC);
253 theTrace = TestOrd::TraceAPI;
254 theReceiversBlockNumber = receiversBlockNo;
255 theVerId_signalNumber = GSN_INDXKEYINFO;
256 theLength = IndxKeyInfo::MaxSignalLength;
260 case GSN_INDXATTRINFO:
262 assert(blockToMain(receiversBlockNo) == DBTC);
263 theTrace = TestOrd::TraceAPI;
264 theReceiversBlockNumber = receiversBlockNo;
265 theVerId_signalNumber = GSN_INDXATTRINFO;
266 theLength = IndxAttrInfo::MaxSignalLength;
279 NdbApiSignal::set(Uint8 trace,
280 Uint16 receiversBlockNumber,
285 theReceiversBlockNumber = receiversBlockNumber;
286 theVerId_signalNumber = signalNumber;
292 theSignalId = src->theSignalId;
293 theVerId_signalNumber = src->theVerId_signalNumber;
294 theReceiversBlockNumber = src->theReceiversBlockNumber;
295 theSendersBlockRef = src->theSendersBlockRef;
296 theLength = src->theLength;
297 theTrace = src->theTrace;
298 m_noOfSections = src->m_noOfSections;
299 m_fragmentInfo = src->m_fragmentInfo;
301 Uint32 * dstData = getDataPtrSend();
303 for (Uint32
i = 0;
i < theLength;
i++)
304 dstData[
i] = srcData[
i];