MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / applyFuncToChunkedGroups

Method applyFuncToChunkedGroups

src/storage/table/node_group.cpp:730–753  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

728}
729
730void NodeGroup::applyFuncToChunkedGroups(version_record_handler_op_t func, row_idx_t startRow,
731 row_idx_t numRows, transaction_t commitTS) const {
732 DASSERT(startRow <= getNumRows());
733
734 auto lock = chunkedGroups.lock();
735 const auto [chunkedGroupIdx, startRowInChunkedGroup] =
736 findChunkedGroupIdxFromRowIdxNoLock(startRow);
737 if (chunkedGroupIdx != INVALID_CHUNKED_GROUP_IDX) {
738 auto curChunkedGroupIdx = chunkedGroupIdx;
739 auto curStartRowIdxInChunk = startRowInChunkedGroup;
740
741 auto numRowsLeft = numRows;
742 while (numRowsLeft > 0 && curChunkedGroupIdx < chunkedGroups.getNumGroups(lock)) {
743 auto* chunkedGroup = chunkedGroups.getGroup(lock, curChunkedGroupIdx);
744 const auto numRowsForGroup =
745 std::min(numRowsLeft, chunkedGroup->getNumRows() - curStartRowIdxInChunk);
746 std::invoke(func, *chunkedGroup, curStartRowIdxInChunk, numRowsForGroup, commitTS);
747
748 ++curChunkedGroupIdx;
749 numRowsLeft -= numRowsForGroup;
750 curStartRowIdxInChunk = 0;
751 }
752 }
753}
754
755row_idx_t NodeGroup::getStartRowIdxInGroupNoLock() const {
756 return chunkedGroups.getFirstGroupNoLock()->getStartRowIdx();

Callers 2

commitVersionInfoMethod · 0.45
rollbackVersionInfoMethod · 0.45

Calls 5

getNumRowsFunction · 0.50
lockMethod · 0.45
getNumGroupsMethod · 0.45
getGroupMethod · 0.45
getNumRowsMethod · 0.45

Tested by

no test coverage detected