virtual void start() override { ActivityTimer s(totalCycles, timeActivities); PARENT::start(); __uint64 numRows = helper->numRows(); // local when generated from a child query (the range is per node, don't split) bool isLocal = container.queryLocalData() || container.queryOwner().isLocalChild(); if (!isLocal && ((helper->getFlags() & TTFdistributed) != 0)) { __uint64 nodes = queryCodeContext()->getNodes(); __uint64 nodeid = queryCodeContext()->getNodeNum(); startRow = (nodeid * numRows) / nodes; maxRow = ((nodeid + 1) * numRows) / nodes; ActPrintLog("InlineSLAVE: numRows = %" I64F "d, nodes = %" I64F "d, nodeid = %" I64F "d, start = %" I64F "d, max = %" I64F "d", numRows, nodes, nodeid, startRow, maxRow); } else { startRow = 0; // when not distributed, only first node compute, unless local if (firstNode() || isLocal) maxRow = numRows; else maxRow = 0; } currentRow = startRow; }
virtual void getMetaInfo(ThorDataLinkMetaInfo &info) override { initMetaInfo(info); info.isSource = true; info.unknownRowsOutput = false; info.totalRowsMin = info.totalRowsMax = maxRow - startRow; if (helper->getFlags() & TTFfiltered) info.totalRowsMin = 0; }
CATCH_NEXTROW() { ActivityTimer t(totalCycles, timeActivities); if (abortSoon) return NULL; while (currentRow < maxRow) { RtlDynamicRowBuilder row(queryRowAllocator()); size32_t sizeGot = helper->getRow(row, currentRow++); if (sizeGot) { dataLinkIncrement(); return row.finalizeRowClear(sizeGot); } } return NULL; }