23 #define DEBUG(x) { ndbout << "ACC::" << x << endl; }
25 void Dbacc::initData()
27 cdirarraysize = ZDIRARRAY;
28 coprecsize = ZOPRECSIZE;
29 cpagesize = ZPAGESIZE;
30 ctablesize = ZTABLESIZE;
31 cfragmentsize = ZFRAGMENTSIZE;
32 cdirrangesize = ZDIRRANGESIZE;
33 coverflowrecsize = ZOVERFLOWRECSIZE;
34 cscanRecSize = ZSCAN_REC_SIZE;
46 cnoOfAllocatedPagesMax = cnoOfAllocatedPages = cpagesize = cpageCount = 0;
49 RSS_OP_COUNTER_INIT(cnoOfFreeFragrec);
53 void Dbacc::initRecords()
56 AllocChunk chunks[16];
57 const Uint32 pages = (cpagesize + 3) / 4;
58 const Uint32 chunkcnt = allocChunks(chunks, 16, RT_DBTUP_PAGE, pages,
65 m_shared_page_pool.
getPtr(pagePtr, chunks[0].ptrI);
66 page8 = (Page8*)pagePtr.p;
72 cfirstfreepage = RNIL;
75 for (Int32
i = chunkcnt - 1;
i >= 0;
i--)
78 m_shared_page_pool.
getPtr(pagePtr, chunks[
i].ptrI);
79 const Uint32 cnt = 4 * chunks[
i].cnt;
80 Page8* base = (Page8*)pagePtr.p;
81 ndbrequire(base >= page8);
82 const Uint32 ptrI = Uint32(base - page8);
83 for (Uint32 j = 0; j < cnt; j++)
86 base[j].word32[0] = ptrI + j + 1;
89 base[cnt-1].word32[0] = cfirstfreepage;
90 cfirstfreepage = ptrI;
93 if (ptrI + cnt > cpagesize)
94 cpagesize = ptrI + cnt;
98 operationrec = (Operationrec*)
allocRecord(
"Operationrec",
106 directoryarray = (Directoryarray*)
allocRecord(
"Directoryarray",
107 sizeof(Directoryarray),
110 fragmentrec = (Fragmentrec*)
allocRecord(
"Fragmentrec",
114 overflowRecord = (OverflowRecord*)
allocRecord(
"OverflowRecord",
115 sizeof(OverflowRecord),
131 BLOCK_CONSTRUCTOR(
Dbacc);
134 addRecSignal(GSN_DUMP_STATE_ORD, &Dbacc::execDUMP_STATE_ORD);
135 addRecSignal(GSN_DEBUG_SIG, &Dbacc::execDEBUG_SIG);
136 addRecSignal(GSN_CONTINUEB, &Dbacc::execCONTINUEB);
137 addRecSignal(GSN_ACC_CHECK_SCAN, &Dbacc::execACC_CHECK_SCAN);
138 addRecSignal(GSN_EXPANDCHECK2, &Dbacc::execEXPANDCHECK2);
139 addRecSignal(GSN_SHRINKCHECK2, &Dbacc::execSHRINKCHECK2);
140 addRecSignal(GSN_READ_PSEUDO_REQ, &Dbacc::execREAD_PSEUDO_REQ);
143 addRecSignal(GSN_STTOR, &Dbacc::execSTTOR);
144 addRecSignal(GSN_ACCKEYREQ, &Dbacc::execACCKEYREQ);
145 addRecSignal(GSN_ACCSEIZEREQ, &Dbacc::execACCSEIZEREQ);
146 addRecSignal(GSN_ACCFRAGREQ, &Dbacc::execACCFRAGREQ);
147 addRecSignal(GSN_NEXT_SCANREQ, &Dbacc::execNEXT_SCANREQ);
148 addRecSignal(GSN_ACC_ABORTREQ, &Dbacc::execACC_ABORTREQ);
149 addRecSignal(GSN_ACC_SCANREQ, &Dbacc::execACC_SCANREQ);
150 addRecSignal(GSN_ACCMINUPDATE, &Dbacc::execACCMINUPDATE);
151 addRecSignal(GSN_ACC_COMMITREQ, &Dbacc::execACC_COMMITREQ);
152 addRecSignal(GSN_ACC_TO_REQ, &Dbacc::execACC_TO_REQ);
153 addRecSignal(GSN_ACC_LOCKREQ, &Dbacc::execACC_LOCKREQ);
154 addRecSignal(GSN_NDB_STTOR, &Dbacc::execNDB_STTOR);
155 addRecSignal(GSN_DROP_TAB_REQ, &Dbacc::execDROP_TAB_REQ);
156 addRecSignal(GSN_READ_CONFIG_REQ, &Dbacc::execREAD_CONFIG_REQ,
true);
157 addRecSignal(GSN_DROP_FRAG_REQ, &Dbacc::execDROP_FRAG_REQ);
159 addRecSignal(GSN_DBINFO_SCANREQ, &Dbacc::execDBINFO_SCANREQ);
165 void* tmp[] = { &expDirRangePtr,
169 &nciOverflowrangeptr,
223 init_globals_list(tmp,
sizeof(tmp)/
sizeof(tmp[0]));
235 sizeof(Directoryarray),
243 sizeof(Operationrec),
247 sizeof(OverflowRecord),
259 BLOCK_FUNCTIONS(
Dbacc)