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

Public Member Functions

 ColumnDataAllocator (Allocator &allocator)
 
 ColumnDataAllocator (BufferManager &buffer_manager, ColumnDataCollectionLifetime lifetime=ColumnDataCollectionLifetime::REGULAR)
 
 ColumnDataAllocator (ClientContext &context, ColumnDataAllocatorType allocator_type, ColumnDataCollectionLifetime lifetime=ColumnDataCollectionLifetime::REGULAR)
 
 ColumnDataAllocator (ColumnDataAllocator &allocator)
 
AllocatorGetAllocator ()
 
BufferManagerGetBufferManager ()
 Returns the buffer manager, if this is not an in-memory allocation.
 
ColumnDataAllocatorType GetType ()
 Returns the allocator type.
 
void MakeShared ()
 
bool IsShared () const
 
idx_t BlockCount () const
 
idx_t SizeInBytes () const
 
idx_t AllocationSize () const
 
void SetPartitionIndex (idx_t index)
 Sets the partition index of this tuple data collection.
 
void AllocateData (idx_t size, uint32_t &block_id, uint32_t &offset, ChunkManagementState *chunk_state)
 
void Initialize (ColumnDataAllocator &other)
 
void InitializeChunkState (ChunkManagementState &state, ChunkMetaData &meta_data)
 
data_ptr_t GetDataPointer (ChunkManagementState &state, uint32_t block_id, uint32_t offset)
 
void UnswizzlePointers (ChunkManagementState &state, Vector &result, SwizzleMetaData &swizzle_segment, const VectorMetaData &string_heap_segment, const idx_t &v_offset, const bool &copied)
 
void SetDestroyBufferUponUnpin (uint32_t block_id)
 Prevents the block with the given id from being added to the eviction queue.
 
shared_ptr< DatabaseInstanceGetDatabase () const
 Gets a shared pointer to the database instance if ColumnDataCollectionLifetime::DATABASE_INSTANCE.
 

Private Member Functions

void AllocateEmptyBlock (idx_t size)
 
BufferHandle AllocateBlock (idx_t size)
 
BufferHandle Pin (uint32_t block_id)
 
bool HasBlocks () const
 
void AllocateBuffer (idx_t size, uint32_t &block_id, uint32_t &offset, ChunkManagementState *chunk_state)
 
void AllocateMemory (idx_t size, uint32_t &block_id, uint32_t &offset, ChunkManagementState *chunk_state)
 
void AssignPointer (uint32_t &block_id, uint32_t &offset, data_ptr_t pointer)
 

Private Attributes

ColumnDataAllocatorType type
 
union { 
 
   Allocator *   allocator 
 The allocator object (if this is a IN_MEMORY_ALLOCATOR)
 
   BufferManager *   buffer_manager 
 The buffer manager (if this is a BUFFER_MANAGER_ALLOCATOR)
 
alloc 
 
vector< BlockMetaDatablocks
 The set of blocks used by the column data collection.
 
vector< AllocatedDataallocated_data
 The set of allocated data.
 
bool shared = false
 Whether this ColumnDataAllocator is shared across ColumnDataCollections that allocate in parallel.
 
mutex lock
 Lock used in case this ColumnDataAllocator is shared across threads.
 
idx_t allocated_size = 0
 Total allocated size.
 
optional_idx partition_index
 Partition index (optional, if partitioned)
 
ManagedResultSet managed_result_set
 Lifetime management for this allocator.
 

Member Function Documentation

◆ GetAllocator()

Allocator & duckdb::ColumnDataAllocator::GetAllocator ( )

Returns an allocator object to allocate with. This returns the allocator in IN_MEMORY_ALLOCATOR, and a buffer allocator in case of BUFFER_MANAGER_ALLOCATOR.

◆ GetType()

ColumnDataAllocatorType duckdb::ColumnDataAllocator::GetType ( )
inline

Returns the allocator type.

46874 {
46875 return type;
46876 }

◆ MakeShared()

void duckdb::ColumnDataAllocator::MakeShared ( )
inline
46877 {
46878 shared = true;
46879 }
bool shared
Whether this ColumnDataAllocator is shared across ColumnDataCollections that allocate in parallel.
Definition duckdb.hpp:46944

◆ IsShared()

bool duckdb::ColumnDataAllocator::IsShared ( ) const
inline
46880 {
46881 return shared;
46882 }

◆ BlockCount()

idx_t duckdb::ColumnDataAllocator::BlockCount ( ) const
inline
46883 {
46884 return blocks.size();
46885 }
vector< BlockMetaData > blocks
The set of blocks used by the column data collection.
Definition duckdb.hpp:46940

◆ SizeInBytes()

idx_t duckdb::ColumnDataAllocator::SizeInBytes ( ) const
inline
46886 {
46887 idx_t total_size = 0;
46888 for (const auto &block : blocks) {
46889 total_size += block.size;
46890 }
46891 return total_size;
46892 }

◆ AllocationSize()

idx_t duckdb::ColumnDataAllocator::AllocationSize ( ) const
inline
46893 {
46894 return allocated_size;
46895 }
idx_t allocated_size
Total allocated size.
Definition duckdb.hpp:46948

◆ SetPartitionIndex()

void duckdb::ColumnDataAllocator::SetPartitionIndex ( idx_t  index)
inline

Sets the partition index of this tuple data collection.

46897 {
46898 D_ASSERT(!partition_index.IsValid());
46899 D_ASSERT(blocks.empty() && allocated_data.empty());
46901 }
optional_idx partition_index
Partition index (optional, if partitioned)
Definition duckdb.hpp:46950
vector< AllocatedData > allocated_data
The set of allocated data.
Definition duckdb.hpp:46942
index

◆ HasBlocks()

bool duckdb::ColumnDataAllocator::HasBlocks ( ) const
inlineprivate
46922 {
46923 return !blocks.empty();
46924 }

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