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

Public Member Functions

shared_ptr< BlockHandle > GetHandle (BlockManager &manager, block_id_t block_id)
void RegisterBlock (BlockManager &manager, block_id_t block_id)
string GetSegmentInfo () const override
 Display info for PRAGMA storage_info.
void InsertOverflowBlock (block_id_t block_id, reference< StringBlock > block)
reference< StringBlock > FindOverflowBlock (block_id_t block_id)
Public Member Functions inherited from duckdb::CompressedSegmentState
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Public Attributes

unique_ptr< StringBlock > head
unordered_map< block_id_t, reference< StringBlock > > overflow_blocks
 Map of block id to string block.
unique_ptr< OverflowStringWriter > overflow_writer
 Overflow string writer (if any), if not set overflow strings will be written to memory blocks.
optional_ptr< BlockManager > block_manager
 The block manager with which to write.
vector< block_id_t > on_disk_blocks
 The set of overflow blocks written to disk (if any).

Private Attributes

mutex block_lock
unordered_map< block_id_t, shared_ptr< BlockHandle > > handles
StorageLock overflow_blocks_lock

Constructor & Destructor Documentation

◆ ~UncompressedStringSegmentState()

duckdb::UncompressedStringSegmentState::~UncompressedStringSegmentState ( )
override
405636 {
405637 while (head) {
405638 // prevent deep recursion here
405639 head = std::move(head->next);
405640 }
405641}
unique_ptr< StringBlock > head
Definition duckdb.cpp:389502

Member Function Documentation

◆ GetHandle()

shared_ptr< BlockHandle > duckdb::UncompressedStringSegmentState::GetHandle ( BlockManager & manager,
block_id_t block_id )
389576 {
389577 lock_guard<mutex> lock(block_lock);
389578 auto entry = handles.find(block_id);
389579 if (entry != handles.end()) {
389580 return entry->second;
389581 }
389582 auto &manager = block_manager ? *block_manager : manager_p;
389583 auto result = manager.RegisterBlock(block_id);
389584 handles.insert(make_pair(block_id, result));
389585 return result;
389586}
optional_ptr< BlockManager > block_manager
The block manager with which to write.
Definition duckdb.cpp:389508

◆ RegisterBlock()

void duckdb::UncompressedStringSegmentState::RegisterBlock ( BlockManager & manager,
block_id_t block_id )
389588 {
389589 lock_guard<mutex> lock(block_lock);
389590 auto entry = handles.find(block_id);
389591 if (entry != handles.end()) {
389592 throw InternalException("UncompressedStringSegmentState::RegisterBlock - block id %llu already exists",
389593 block_id);
389594 }
389595 auto &manager = block_manager ? *block_manager : manager_p;
389596 auto result = manager.RegisterBlock(block_id);
389597 handles.insert(make_pair(block_id, std::move(result)));
389598 on_disk_blocks.push_back(block_id);
389599}
vector< block_id_t > on_disk_blocks
The set of overflow blocks written to disk (if any).
Definition duckdb.cpp:389510

◆ GetSegmentInfo()

string duckdb::UncompressedStringSegmentState::GetSegmentInfo ( ) const
overridevirtual

Display info for PRAGMA storage_info.

Reimplemented from duckdb::CompressedSegmentState.

389601 {
389602 if (on_disk_blocks.empty()) {
389603 return "";
389604 }
389605 string result = StringUtil::Join(on_disk_blocks, on_disk_blocks.size(), ", ",
389606 [&](block_id_t block) { return to_string(block); });
389607 return "Overflow String Block Ids: " + result;
389608}
static DUCKDB_API string Join(const vector< string > &input, const string &separator)
Join multiple strings into one string. Components are concatenated by the given separator.
Definition duckdb.cpp:109497
Here is the call graph for this function:

◆ InsertOverflowBlock()

void duckdb::UncompressedStringSegmentState::InsertOverflowBlock ( block_id_t block_id,
reference< StringBlock > block )
389610 {
389611 auto write_lock = overflow_blocks_lock.GetExclusiveLock();
389612 overflow_blocks.insert(make_pair(block_id, block));
389613}
unordered_map< block_id_t, reference< StringBlock > > overflow_blocks
Map of block id to string block.
Definition duckdb.cpp:389504

◆ FindOverflowBlock()

reference< StringBlock > duckdb::UncompressedStringSegmentState::FindOverflowBlock ( block_id_t block_id)
389615 {
389616 auto read_lock = overflow_blocks_lock.GetSharedLock();
389617 auto entry = overflow_blocks.find(block_id);
389618 D_ASSERT(entry != overflow_blocks.end());
389619 return entry->second;
389620}

Member Data Documentation

◆ head

unique_ptr<StringBlock> duckdb::UncompressedStringSegmentState::head

The string block holding strings that do not fit in the main block FIXME: this should be replaced by a heap that also allows freeing of unused strings


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