| 280 | } |
| 281 | |
| 282 | bool 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 |
nothing calls this directly
no test coverage detected