Autonomy Software C++ 24.5.1
Welcome to the Autonomy Software repository of the Mars Rover Design Team (MRDT) at Missouri University of Science and Technology (Missouri S&T)! API reference contains the source code and other resources for the development of the autonomy software for our Mars rover. The Autonomy Software project aims to compete in the University Rover Challenge (URC) by demonstrating advanced autonomous capabilities and robust navigation algorithms.
Loading...
Searching...
No Matches
duckdb::PartialBlock Struct Referenceabstract
Inheritance diagram for duckdb::PartialBlock:
Collaboration diagram for duckdb::PartialBlock:

Public Member Functions

 PartialBlock (PartialBlockState state, BlockManager &block_manager, const shared_ptr< BlockHandle > &block_handle)
void AddUninitializedRegion (const idx_t start, const idx_t end)
 Add regions that need zero-initialization to avoid leaking memory.
virtual void AddSegmentToTail (ColumnData &data, ColumnSegment &segment, uint32_t offset_in_block)
virtual void Flush (QueryContext context, const idx_t free_space_left)=0
 Flush the block to disk and zero-initialize any free space and uninitialized regions.
void FlushInternal (const idx_t free_space_left)
virtual void Merge (PartialBlock &other, idx_t offset, idx_t other_size)=0
virtual void Clear ()=0
template<class TARGET>
TARGET & Cast ()

Public Attributes

PartialBlockState state
 The current state of a partial block.
vector< UninitializedRegion > uninitialized_regions
 All uninitialized regions on this block, we need to zero-initialize them when flushing.
BlockManager & block_manager
 The block manager of the partial block manager.
shared_ptr< BlockHandle > block_handle
 The block handle of the underlying block that this partial block writes to.

Constructor & Destructor Documentation

◆ PartialBlock()

duckdb::PartialBlock::PartialBlock ( PartialBlockState state,
BlockManager & block_manager,
const shared_ptr< BlockHandle > & block_handle )
415332}
PartialBlockState state
The current state of a partial block.
Definition duckdb.cpp:11360
shared_ptr< BlockHandle > block_handle
The block handle of the underlying block that this partial block writes to.
Definition duckdb.cpp:11366
BlockManager & block_manager
The block manager of the partial block manager.
Definition duckdb.cpp:11364

◆ ~PartialBlock()

virtual duckdb::PartialBlock::~PartialBlock ( )
inlinevirtual
11356 {
11357 }

Member Function Documentation

◆ AddUninitializedRegion()

void duckdb::PartialBlock::AddUninitializedRegion ( const idx_t start,
const idx_t end )

Add regions that need zero-initialization to avoid leaking memory.

415334 {
415335 uninitialized_regions.push_back({start, end});
415336}
vector< UninitializedRegion > uninitialized_regions
All uninitialized regions on this block, we need to zero-initialize them when flushing.
Definition duckdb.cpp:11362

◆ AddSegmentToTail()

void duckdb::PartialBlock::AddSegmentToTail ( ColumnData & data,
ColumnSegment & segment,
uint32_t offset_in_block )
virtual
415338 {
415339 throw InternalException("PartialBlock::AddSegmentToTail not supported for this block type");
415340}

◆ Flush()

virtual void duckdb::PartialBlock::Flush ( QueryContext context,
const idx_t free_space_left )
pure virtual

Flush the block to disk and zero-initialize any free space and uninitialized regions.

Implemented in duckdb::InMemoryPartialBlock, duckdb::PartialBlockForCheckpoint, and duckdb::PartialBlockForIndex.

◆ FlushInternal()

void duckdb::PartialBlock::FlushInternal ( const idx_t free_space_left)
415342 {
415343 // ensure that we do not leak any data
415344 if (free_space_left > 0 || !uninitialized_regions.empty()) {
415345 auto buffer_handle = block_manager.buffer_manager.Pin(block_handle);
415346
415347 // memset any uninitialized regions
415348 for (auto &uninitialized : uninitialized_regions) {
415349 memset(buffer_handle.Ptr() + uninitialized.start, 0, uninitialized.end - uninitialized.start);
415350 }
415351 // memset any free space at the end of the block to 0 prior to writing to disk
415352 memset(buffer_handle.Ptr() + block_manager.GetBlockSize() - free_space_left, 0, free_space_left);
415353 }
415354}

◆ Cast()

template<class TARGET>
TARGET & duckdb::PartialBlock::Cast ( )
inline
11380 {
11381 DynamicCastCheck<TARGET>(this);
11382 return reinterpret_cast<TARGET &>(*this);
11383 }

The documentation for this struct was generated from the following file: