17 #include <GlobalData.hpp>
18 #include <SimulatedBlock.hpp>
19 #include "DblqhCommon.hpp"
21 NdbLogPartInfo::NdbLogPartInfo(Uint32 instanceNo)
23 lqhWorkers = globalData.ndbMtLqhWorkers;
27 for (lpno = 0; lpno < LogParts; lpno++) {
28 if (instanceNo != 0) {
29 Uint32 worker = instanceNo - 1;
30 assert(worker < lqhWorkers);
31 if (worker != lpno % lqhWorkers)
34 partNo[partCount++] = lpno;
40 NdbLogPartInfo::partNoFromId(Uint32 lpid)
const
42 return lpid % LogParts;
46 NdbLogPartInfo::partNoOwner(Uint32 lpno)
const
48 assert(lpno < LogParts);
49 return partMask.
get(lpno);
53 NdbLogPartInfo::partNoOwner(Uint32 tabId, Uint32 fragId)
55 Uint32 instanceKey = SimulatedBlock::getInstanceKey(tabId, fragId);
56 assert(instanceKey != 0);
57 Uint32 lpid = instanceKey - 1;
58 Uint32 lpno = partNoFromId(lpid);
59 return partNoOwner(lpno);
63 NdbLogPartInfo::partNoIndex(Uint32 lpno)
const
65 assert(lpno < LogParts);
66 assert(partMask.
get(lpno));
71 i = lpno / lqhWorkers;
72 assert(i < partCount);
73 assert(partNo[i] == lpno);
78 NdbLogPartInfo::instanceKey(Uint32 lpno)
const
80 assert(lpno < LogParts);