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::TupleDataSegment Struct Reference
Collaboration diagram for duckdb::TupleDataSegment:

Public Member Functions

 TupleDataSegment (shared_ptr< TupleDataAllocator > allocator)
idx_t ChunkCount () const
 The number of chunks in this segment.
idx_t SizeInBytes () const
 The size (in bytes) of this segment.
void Unpin ()
 Unpins all held pins.
void Verify () const
 Verify counts of the chunks in this segment.
void VerifyEverythingPinned () const
 Verify that all blocks in this segment are pinned.

Public Attributes

shared_ptr< TupleDataAllocator > allocator
 The allocator and layout for this segment.
const TupleDataLayout & layout
unsafe_vector< unsafe_arena_ptr< TupleDataChunk > > chunks
 The chunks of this segment.
unsafe_vector< unsafe_arena_ptr< TupleDataChunkPart > > chunk_parts
 The chunk parts of this segment.
idx_t count
 The tuple count of this segment.
idx_t data_size
 The data size of this segment.
mutex pinned_handles_lock
 Lock for modifying pinned_handles.
unsafe_arena_vector< BufferHandle > pinned_row_handles
 Where handles to row blocks will be stored with TupleDataPinProperties::KEEP_EVERYTHING_PINNED.
unsafe_arena_vector< BufferHandle > pinned_heap_handles
 Where handles to heap blocks will be stored with TupleDataPinProperties::KEEP_EVERYTHING_PINNED.

Friends

struct TupleDataChunkPart
struct TupleDataChunk

Constructor & Destructor Documentation

◆ TupleDataSegment()

duckdb::TupleDataSegment::TupleDataSegment ( shared_ptr< TupleDataAllocator > allocator)
explicit
128822 : allocator(std::move(allocator_p)), layout(allocator->GetLayout()), count(0), data_size(0),
128823 pinned_row_handles(allocator->GetStlAllocator()), pinned_heap_handles(allocator->GetStlAllocator()) {
128824}
unsafe_arena_vector< BufferHandle > pinned_row_handles
Where handles to row blocks will be stored with TupleDataPinProperties::KEEP_EVERYTHING_PINNED.
Definition duckdb.cpp:56569
idx_t data_size
The data size of this segment.
Definition duckdb.cpp:56564
idx_t count
The tuple count of this segment.
Definition duckdb.cpp:56562
unsafe_arena_vector< BufferHandle > pinned_heap_handles
Where handles to heap blocks will be stored with TupleDataPinProperties::KEEP_EVERYTHING_PINNED.
Definition duckdb.cpp:56571
shared_ptr< TupleDataAllocator > allocator
The allocator and layout for this segment.
Definition duckdb.cpp:56555

◆ ~TupleDataSegment()

duckdb::TupleDataSegment::~TupleDataSegment ( )
128826 {
128827 lock_guard<mutex> guard(pinned_handles_lock);
128828 if (allocator) {
128829 allocator->SetDestroyBufferUponUnpin(); // Prevent blocks from being added to eviction queue
128830 }
128831 pinned_row_handles.clear();
128832 pinned_heap_handles.clear();
128833}
mutex pinned_handles_lock
Lock for modifying pinned_handles.
Definition duckdb.cpp:56567

Member Function Documentation

◆ ChunkCount()

idx_t duckdb::TupleDataSegment::ChunkCount ( ) const

The number of chunks in this segment.

128835 {
128836 return chunks.size();
128837}
unsafe_vector< unsafe_arena_ptr< TupleDataChunk > > chunks
The chunks of this segment.
Definition duckdb.cpp:56558
Here is the caller graph for this function:

◆ SizeInBytes()

idx_t duckdb::TupleDataSegment::SizeInBytes ( ) const

The size (in bytes) of this segment.

128839 {
128840 return data_size;
128841}
Here is the caller graph for this function:

◆ Unpin()

void duckdb::TupleDataSegment::Unpin ( )

Unpins all held pins.

128843 {
128844 lock_guard<mutex> guard(pinned_handles_lock);
128845 pinned_row_handles.clear();
128846 pinned_heap_handles.clear();
128847}
Here is the caller graph for this function:

◆ Verify()

void duckdb::TupleDataSegment::Verify ( ) const

Verify counts of the chunks in this segment.

128849 {
128850#ifdef D_ASSERT_IS_ENABLED
128851 const auto &allocator_layout = allocator->GetLayout();
128852
128853 idx_t total_count = 0;
128854 idx_t total_size = 0;
128855 for (const auto &chunk_ptr : chunks) {
128856 const auto &chunk = *chunk_ptr;
128857 chunk.Verify(*this);
128858 total_count += chunk.count;
128859
128860 total_size += chunk.count * allocator_layout.GetRowWidth();
128861 if (!allocator_layout.AllConstant()) {
128862 for (auto part_id = chunk.part_ids.Start(); part_id < chunk.part_ids.End(); part_id++) {
128863 total_size += chunk_parts[part_id]->total_heap_size;
128864 }
128865 }
128866 }
128867 D_ASSERT(total_count == this->count);
128868 D_ASSERT(total_size == this->data_size);
128869#endif
128870}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
unsafe_vector< unsafe_arena_ptr< TupleDataChunkPart > > chunk_parts
The chunk parts of this segment.
Definition duckdb.cpp:56560
Here is the call graph for this function:
Here is the caller graph for this function:

◆ VerifyEverythingPinned()

void duckdb::TupleDataSegment::VerifyEverythingPinned ( ) const

Verify that all blocks in this segment are pinned.

128872 {
128873#ifdef D_ASSERT_IS_ENABLED
128874 D_ASSERT(pinned_row_handles.size() == allocator->RowBlockCount());
128875 D_ASSERT(pinned_heap_handles.size() == allocator->HeapBlockCount());
128876#endif
128877}
Here is the caller graph for this function:

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