| 728 | } |
| 729 | |
| 730 | void 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 | |
| 755 | row_idx_t NodeGroup::getStartRowIdxInGroupNoLock() const { |
| 756 | return chunkedGroups.getFirstGroupNoLock()->getStartRowIdx(); |
no test coverage detected