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

Function flushALPExceptions

src/storage/table/compression_flush_buffer.cpp:120–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118
119template<std::floating_point T>
120void flushALPExceptions(std::span<const uint8_t> exceptionBuffer, FileHandle* dataFH,
121 const PageRange& entry, const ColumnChunkMetadata& metadata) {
122 const auto encodedType = std::is_same_v<T, float> ? PhysicalTypeID::ALP_EXCEPTION_FLOAT :
123 PhysicalTypeID::ALP_EXCEPTION_DOUBLE;
124 // we don't care about the min/max values for exceptions
125 const auto preExceptionMetadata = uncompressedGetMetadata(encodedType,
126 metadata.compMeta.floatMetadata()->exceptionCapacity, StorageValue{0}, StorageValue{0});
127
128 const auto exceptionStartPageIdx =
129 entry.startPageIdx + entry.numPages - preExceptionMetadata.getNumPages();
130 DASSERT(exceptionStartPageIdx + preExceptionMetadata.getNumPages() <= dataFH->getNumPages());
131 PageRange exceptionBlock{exceptionStartPageIdx, preExceptionMetadata.getNumPages()};
132
133 CompressedFlushBuffer exceptionFlushBuffer{
134 std::make_shared<Uncompressed>(EncodeException<T>::sizeInBytes()), encodedType};
135 (void)exceptionFlushBuffer.operator()(exceptionBuffer, dataFH, exceptionBlock,
136 preExceptionMetadata);
137}
138} // namespace
139
140template<std::floating_point T>

Callers

nothing calls this directly

Calls 3

uncompressedGetMetadataFunction · 0.85
getNumPagesMethod · 0.45
operator()Method · 0.45

Tested by

no test coverage detected