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::PartialBlockManager Class Reference
Collaboration diagram for duckdb::PartialBlockManager:

Public Member Functions

 PartialBlockManager (QueryContext context, BlockManager &block_manager, PartialBlockType partial_block_type, optional_idx max_partial_block_size=optional_idx(), uint32_t max_use_count=DEFAULT_MAX_USE_COUNT)
 
PartialBlockAllocation GetBlockAllocation (uint32_t segment_size)
 
void RegisterPartialBlock (PartialBlockAllocation allocation)
 Register a partially filled block that is filled with "segment_size" entries.
 
void ClearBlocks ()
 Clear remaining blocks without writing them to disk.
 
void Rollback ()
 Rollback all data written by this partial block manager.
 
void Merge (PartialBlockManager &other)
 Merge this block manager into another one.
 
void FlushPartialBlocks ()
 Flush any remaining partial blocks to disk.
 
unique_ptr< PartialBlockCreatePartialBlock (ColumnData &data, ColumnSegment &segment, PartialBlockState state, BlockManager &block_manager)
 
unique_lock< mutex > GetLock ()
 
block_id_t GetFreeBlockId ()
 
BlockManagerGetBlockManager () const
 Returns a reference to the underlying block manager.
 
optional_ptr< ClientContextGetClientContext () const
 Returns the optional client context.
 

Static Public Attributes

static constexpr const idx_t DEFAULT_MAX_USE_COUNT = 1u << 20
 Max number of shared references to a block. No effective limit by default.
 
static constexpr const idx_t MAX_BLOCK_MAP_SIZE = 1u << 31
 

Protected Member Functions

virtual void AllocateBlock (PartialBlockState &state, uint32_t segment_size)
 
bool GetPartialBlock (idx_t segment_size, unique_ptr< PartialBlock > &state)
 
bool HasBlockAllocation (uint32_t segment_size)
 

Protected Attributes

optional_ptr< ClientContextcontext
 
BlockManagerblock_manager
 
PartialBlockType partial_block_type
 
mutex partial_block_lock
 
multimap< idx_t, unique_ptr< PartialBlock > > partially_filled_blocks
 
uint32_t max_partial_block_size
 The maximum size (in bytes) at which a partial block will be considered a partial block.
 
uint32_t max_use_count
 

Detailed Description

Enables sharing blocks across some scope. Scope is whatever we want to share blocks across. It may be an entire checkpoint or just a single row group. In any case, they must share a block manager.

Member Function Documentation

◆ GetLock()

unique_lock< mutex > duckdb::PartialBlockManager::GetLock ( )
inline
11437 {
11438 return unique_lock<mutex>(partial_block_lock);
11439 }

◆ GetPartialBlock()

bool duckdb::PartialBlockManager::GetPartialBlock ( idx_t  segment_size,
unique_ptr< PartialBlock > &  state 
)
protected

Try to obtain a partially filled block that can fit "segment_size" bytes If successful, returns true and returns the block_id and offset_in_block to write to Otherwise, returns false

Member Data Documentation

◆ MAX_BLOCK_MAP_SIZE

constexpr const idx_t duckdb::PartialBlockManager::MAX_BLOCK_MAP_SIZE = 1u << 31
staticconstexpr

No point letting map size grow unbounded. We'll drop blocks with the least free space first.

◆ context

optional_ptr<ClientContext> duckdb::PartialBlockManager::context
protected

The optional client context in which we use the partial block manager. The SingleFileCheckpointWriter contains a partial block manager, and the destructor of AttachedDatabase invokes CreateCheckpoint with that checkpoint writer. Thus, we're using the optional client context instead of a reference.

◆ partially_filled_blocks

multimap<idx_t, unique_ptr<PartialBlock> > duckdb::PartialBlockManager::partially_filled_blocks
protected

A map of (available space -> PartialBlock) for partially filled blocks This is a multimap because there might be outstanding partial blocks with the same amount of left-over space


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