21 #include <SimulatedBlock.hpp>
22 #include <trigger_definitions.h>
23 #include <DataBuffer.hpp>
24 #include <SimpleProperties.hpp>
25 #include <signaldata/DictTabInfo.hpp>
26 #include <signaldata/CreateTrig.hpp>
27 #include <signaldata/BuildIndx.hpp>
28 #include <signaldata/IndexStatSignal.hpp>
29 #include <signaldata/GetTabInfo.hpp>
30 #include <signaldata/TuxBound.hpp>
31 #define ZNOT_FOUND 626
34 #define INTERNAL_ERROR_ILLEGAL_CALL 4344
35 #define INTERNAL_ERROR_TRIX_BUSY 4345
78 BlockState c_blockState;
84 BlockReference trixRef;
104 Uint32 c_masterNodeId;
105 BlockReference c_masterTrixRef;
106 Uint16 c_noNodesFailed;
107 Uint16 c_noActiveNodes;
111 struct SubscriptionRecord {
121 RequestType requestType;
122 BlockReference userReference;
123 Uint32 connectionPtr;
124 Uint32 subscriptionId;
125 Uint32 schemaTransId;
126 Uint32 subscriptionKey;
129 Uint32 sourceTableId;
130 Uint32 targetTableId;
132 Uint32 noOfIndexColumns;
133 Uint32 noOfKeyColumns;
138 BuildIndxRef::ErrorCode errorCode;
139 bool subscriptionCreated;
140 bool pendingSubSyncContinueConf;
142 Uint64 m_rows_processed;
158 RSS_AP_SNAPSHOT(c_theSubscriptionRecPool);
173 bool c_statGetMetaDone;
181 mutable Uint32 tableId;
182 const Uint32 columnCount;
183 const SysColumn* columnList;
187 mutable Uint32 tableId;
188 mutable Uint32 indexId;
190 static const SysColumn g_statMetaHead_column[];
191 static const SysColumn g_statMetaSample_column[];
192 static const SysTable g_statMetaHead;
193 static const SysTable g_statMetaSample;
194 static const SysIndex g_statMetaSampleX1;
204 Uint32 m_indexVersion;
207 Uint32 m_valueFormat;
208 Uint32 m_sampleVersion;
210 Uint32 m_sampleCount;
240 Uint32 m_bound[3 * 3];
246 Uint32 m_sampleCount;
253 const SysTable* m_sysTable;
254 Uint32 m_operationType;
259 Uint32 m_requestType;
260 const char* m_requestName;
284 RSS_AP_SNAPSHOT(c_statOpPool);
287 void execREAD_CONFIG_REQ(
Signal* signal);
288 void execSTTOR(
Signal* signal);
289 void execNDB_STTOR(
Signal* signal);
292 void execREAD_NODESCONF(
Signal* signal);
293 void execREAD_NODESREF(
Signal* signal);
294 void execNODE_FAILREP(
Signal* signal);
295 void execINCL_NODEREQ(
Signal* signal);
297 void execDUMP_STATE_ORD(
Signal* signal);
299 void execDBINFO_SCANREQ(
Signal* signal);
302 void execBUILD_INDX_IMPL_REQ(
Signal* signal);
303 void execBUILD_INDX_IMPL_CONF(
Signal* signal);
304 void execBUILD_INDX_IMPL_REF(
Signal* signal);
306 void execCOPY_DATA_IMPL_REQ(
Signal* signal);
308 void execUTIL_PREPARE_CONF(
Signal* signal);
309 void execUTIL_PREPARE_REF(
Signal* signal);
310 void execUTIL_EXECUTE_CONF(
Signal* signal);
311 void execUTIL_EXECUTE_REF(
Signal* signal);
312 void execUTIL_RELEASE_CONF(
Signal* signal);
313 void execUTIL_RELEASE_REF(
Signal* signal);
316 void execSUB_CREATE_CONF(
Signal* signal);
317 void execSUB_CREATE_REF(
Signal* signal);
318 void execSUB_REMOVE_CONF(
Signal* signal);
319 void execSUB_REMOVE_REF(
Signal* signal);
320 void execSUB_SYNC_CONF(
Signal* signal);
321 void execSUB_SYNC_REF(
Signal* signal);
322 void execSUB_SYNC_CONTINUE_REQ(
Signal* signal);
323 void execSUB_TABLE_DATA(
Signal* signal);
326 void execWAIT_GCP_REF(
Signal*);
327 void execWAIT_GCP_CONF(
Signal*);
330 void setupSubscription(
Signal* signal, SubscriptionRecPtr subRecPtr);
331 void startTableScan(
Signal* signal, SubscriptionRecPtr subRecPtr);
332 void prepareInsertTransactions(
Signal* signal, SubscriptionRecPtr subRecPtr);
333 void executeBuildInsertTransaction(
Signal* signal, SubscriptionRecPtr);
334 void executeReorgTransaction(
Signal*, SubscriptionRecPtr, Uint32);
335 void buildComplete(
Signal* signal, SubscriptionRecPtr subRecPtr);
336 void wait_gcp(
Signal*, SubscriptionRecPtr subRecPtr, Uint32 delay = 0);
337 void buildFailed(
Signal* signal,
338 SubscriptionRecPtr subRecPtr,
339 BuildIndxRef::ErrorCode);
340 void checkParallelism(
Signal* signal, SubscriptionRecord* subRec);
343 StatOp& statOpGetPtr(Uint32 statPtrI);
344 bool statOpSeize(Uint32& statPtrI);
345 void statOpRelease(StatOp&);
346 void execINDEX_STAT_IMPL_REQ(
Signal*);
348 void statMetaGetHead(
Signal*, StatOp&);
349 void statMetaGetHeadCB(
Signal*, Uint32 statPtrI, Uint32
ret);
350 void statMetaGetSample(
Signal*, StatOp&);
351 void statMetaGetSampleCB(
Signal*, Uint32 statPtrI, Uint32
ret);
352 void statMetaGetSampleX1(
Signal*, StatOp&);
353 void statMetaGetSampleX1CB(
Signal*, Uint32 statPtrI, Uint32
ret);
354 void sendGetTabInfoReq(
Signal*, StatOp&,
const char*
name);
355 void execGET_TABINFO_CONF(
Signal*);
356 void execGET_TABINFO_REF(
Signal*);
358 void statGetMetaDone(
Signal*, StatOp&);
360 void statHeadRead(
Signal*, StatOp&);
361 void statHeadReadCB(
Signal*, Uint32 statPtrI, Uint32
ret);
362 void statHeadInsert(
Signal*, StatOp&);
363 void statHeadInsertCB(
Signal*, Uint32 statPtrI, Uint32
ret);
364 void statHeadUpdate(
Signal*, StatOp&);
365 void statHeadUpdateCB(
Signal*, Uint32 statPtrI, Uint32
ret);
366 void statHeadDelete(
Signal*, StatOp&);
367 void statHeadDeleteCB(
Signal*, Uint32 statPtrI, Uint32
ret);
369 void statUtilPrepare(
Signal*, StatOp&);
370 void statUtilPrepareConf(
Signal*, Uint32 statPtrI);
371 void statUtilPrepareRef(
Signal*, Uint32 statPtrI);
372 void statUtilExecute(
Signal*, StatOp&);
373 void statUtilExecuteConf(
Signal*, Uint32 statPtrI);
374 void statUtilExecuteRef(
Signal*, Uint32 statPtrI);
375 void statUtilRelease(
Signal*, StatOp&);
376 void statUtilReleaseConf(
Signal*, Uint32 statPtrI);
378 void statReadHeadDone(
Signal*, StatOp&);
379 void statInsertHeadDone(
Signal*, StatOp&);
380 void statUpdateHeadDone(
Signal*, StatOp&);
381 void statDeleteHeadDone(
Signal*, StatOp&);
383 void statCleanBegin(
Signal*, StatOp&);
384 void statCleanPrepare(
Signal*, StatOp&);
385 void statCleanExecute(
Signal*, StatOp&);
386 void statCleanRelease(
Signal*, StatOp&);
387 void statCleanEnd(
Signal*, StatOp&);
389 void statScanBegin(
Signal*, StatOp&);
390 void statScanPrepare(
Signal*, StatOp&);
391 void statScanExecute(
Signal*, StatOp&);
392 void statScanRelease(
Signal*, StatOp&);
393 void statScanEnd(
Signal*, StatOp&);
395 void statDropBegin(
Signal*, StatOp&);
396 void statDropEnd(
Signal*, StatOp&);
398 void statSendPrepare(
Signal*, StatOp&);
399 void statSendExecute(
Signal*, StatOp&);
400 void statSendRelease(
Signal*, StatOp&);
402 void statDataPtr(StatOp&, Uint32
i, Uint32*& dptr, Uint32& bytes);
403 void statDataOut(StatOp&, Uint32
i);
404 void statDataIn(StatOp&, Uint32
i);
406 void statAbortUtil(
Signal*, StatOp&);
407 void statAbortUtilCB(
Signal*, Uint32 statPtrI, Uint32
ret);
409 void statOpSuccess(
Signal*, StatOp&);
410 void statOpConf(
Signal*, StatOp&);
411 void statOpError(
Signal*, StatOp&, Uint32 errorCode, Uint32 errorLine,
412 const Uint32 * supress = 0);
413 void statOpAbort(
Signal*, StatOp&);
414 void statOpRef(
Signal*, StatOp&);
416 void statOpEvent(StatOp&,
const char*
level,
const char*
msg, ...);
418 friend class NdbOut& operator<<(NdbOut&,
const StatOp& stat);