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

Method checkpointColumn

src/storage/table/csr_node_group.cpp:608–627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

606}
607
608void CSRNodeGroup::checkpointColumn(const UniqLock& lock, column_id_t columnID,
609 const CSRNodeGroupCheckpointState& csrState, const std::vector<CSRRegion>& regions) const {
610 std::vector<ChunkCheckpointState> chunkCheckpointStates;
611 chunkCheckpointStates.reserve(regions.size());
612 for (auto& region : regions) {
613 if (!region.needCheckpointColumn(columnID)) {
614 // Skip checkpoint for the column if it has no changes in the region.
615 continue;
616 }
617 auto regionCheckpointStates = checkpointColumnInRegion(lock, columnID, csrState, region);
618 // If there are no rows to write for the region, we don't aggressively reclaim the space in
619 // the region, but keep deleted rows as gaps. This can happen when all rows are deleted
620 // within the region.
621 for (auto& regionCheckpointState : regionCheckpointStates) {
622 chunkCheckpointStates.push_back(std::move(regionCheckpointState));
623 }
624 }
625 persistentChunkGroup->getColumnChunk(columnID).checkpoint(*csrState.columns[columnID],
626 std::move(chunkCheckpointStates), csrState.pageAllocator);
627}
628
629struct SegmentCursor {
630 SegmentCursor(LazySegmentScanner& scanner, offset_t leftCSROffset)

Callers

nothing calls this directly

Calls 5

needCheckpointColumnMethod · 0.80
reserveMethod · 0.45
sizeMethod · 0.45
push_backMethod · 0.45
checkpointMethod · 0.45

Tested by

no test coverage detected