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

Method InMemoryExceptionChunk

src/storage/table/in_memory_exception_chunk.cpp:22–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20
21template<std::floating_point T>
22InMemoryExceptionChunk<T>::InMemoryExceptionChunk(const SegmentState& state, FileHandle* dataFH,
23 MemoryManager* memoryManager, ShadowFile* shadowFile)
24 : exceptionCount(state.metadata.compMeta.floatMetadata()->exceptionCount),
25 finalizedExceptionCount(exceptionCount),
26 exceptionCapacity(state.metadata.compMeta.floatMetadata()->exceptionCapacity),
27 emptyMask(exceptionCapacity),
28 column(std::make_unique<Column>("ALPExceptionChunk", physicalType, dataFH, memoryManager,
29 shadowFile, false, false /*has nulls*/)) {
30 const auto exceptionBaseCursor =
31 getExceptionPageCursor(state.metadata, PageCursor{state.metadata.getStartPageIdx(), 0},
32 state.metadata.compMeta.floatMetadata()->exceptionCapacity);
33 // for ALP exceptions we don't care about the statistics
34 const auto compMeta =
35 CompressionMetadata(StorageValue{0}, StorageValue{1}, CompressionType::UNCOMPRESSED);
36 const auto exceptionChunkMeta = ColumnChunkMetadata(exceptionBaseCursor.pageIdx,
37 safeIntegerConversion<page_idx_t>(
38 EncodeException<T>::numPagesFromExceptions(exceptionCapacity)),
39 exceptionCapacity, compMeta);
40 chunkState = std::make_unique<SegmentState>(exceptionChunkMeta,
41 EncodeException<T>::exceptionBytesPerPage() / EncodeException<T>::sizeInBytes());
42
43 chunkData =
44 std::make_unique<ColumnChunkData>(*memoryManager, physicalType, false, exceptionChunkMeta,
45 false /*all written data is non-null and nulls are kept in a separate mask in-memory*/);
46 chunkData->setToInMemory();
47 column->scanSegment(*chunkState, chunkData.get(), 0, chunkState->metadata.numValues);
48}
49
50template<std::floating_point T>
51InMemoryExceptionChunk<T>::~InMemoryExceptionChunk() = default;

Callers

nothing calls this directly

Calls 6

getStartPageIdxMethod · 0.80
CompressionMetadataClass · 0.50
ColumnChunkMetadataClass · 0.50
setToInMemoryMethod · 0.45
scanSegmentMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected