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

Method canIndexCommitInPlace

src/storage/table/string_column.cpp:282–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282bool StringColumn::canIndexCommitInPlace(const SegmentState& state, uint64_t numStrings,
283 offset_t maxOffset) const {
284 const SegmentState& indexState = getChildState(state, ChildStateIndex::INDEX);
285 if (indexColumn->isEndOffsetOutOfPagesCapacity(indexState.metadata, maxOffset)) {
286 return false;
287 }
288 if (indexState.metadata.compMeta.canAlwaysUpdateInPlace()) {
289 return true;
290 }
291 const auto totalStringsAfterUpdate =
292 getChildState(state, ChildStateIndex::OFFSET).metadata.numValues + numStrings;
293 InPlaceUpdateLocalState localUpdateState{};
294 // Check if the index column can store the largest new index in-place
295 if (!indexState.metadata.compMeta.canUpdateInPlace(
296 reinterpret_cast<const uint8_t*>(&totalStringsAfterUpdate), 0 /*pos*/, 1 /*numValues*/,
297 PhysicalTypeID::UINT32, localUpdateState)) {
298 return false;
299 }
300 return true;
301}
302
303} // namespace storage
304} // namespace lbug

Callers

nothing calls this directly

Calls 3

canUpdateInPlaceMethod · 0.45

Tested by

no test coverage detected