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

Method flushBuffer

src/storage/table/column_chunk_data.cpp:337–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335}
336
337ColumnChunkMetadata ColumnChunkData::flushBuffer(PageAllocator& pageAllocator,
338 const PageRange& entry, const ColumnChunkMetadata& otherMetadata) const {
339 const auto bufferSizeToFlush = getBufferSize(numValues);
340 if (!otherMetadata.compMeta.isConstant() && bufferSizeToFlush != 0) {
341 DASSERT(bufferSizeToFlush <= buffer->getBuffer().size_bytes());
342 const auto bufferToFlush = buffer->getBuffer().subspan(0, bufferSizeToFlush);
343 return flushBufferFunction(bufferToFlush, pageAllocator.getDataFH(), entry, otherMetadata);
344 }
345 DASSERT(otherMetadata.getNumPages() == 0);
346 return otherMetadata;
347}
348
349uint64_t ColumnChunkData::getBufferSize(uint64_t capacity_) const {
350 switch (dataType.getLogicalTypeID()) {

Callers 1

flushDataMethod · 0.80

Calls 4

isConstantMethod · 0.80
getBufferMethod · 0.80
getDataFHMethod · 0.45
getNumPagesMethod · 0.45

Tested by

no test coverage detected