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

Public Member Functions

 DataTableInfo (AttachedDatabase &db, shared_ptr< TableIOManager > table_io_manager_p, string schema, string table)
void BindIndexes (ClientContext &context, const char *index_type=nullptr)
 Bind unknown indexes throwing an exception if binding fails. Only binds the specified index type, or all, if nullptr.
bool IsTemporary () const
 Whether or not the table is temporary.
AttachedDatabase & GetDB ()
TableIOManager & GetIOManager ()
TableIndexList & GetIndexes ()
IndexStorageInfo ExtractIndexStorageInfo (const string &name)
 Find and move out an IndexStorageInfo by name from the stored collection.
unique_ptr< StorageLockKey > GetSharedLock ()
bool AppendRequiresNewRowGroup (RowGroupCollection &collection, transaction_t checkpoint_id)
optional_idx CheckpointRowGroupCount (const CheckpointOptions &options) const
void VerifyIndexBuffers ()
string GetSchemaName ()
string GetTableName ()
void SetTableName (string name)

Private Attributes

AttachedDatabase & db
 The database instance of the table.
shared_ptr< TableIOManager > table_io_manager
 The table IO manager.
mutex name_lock
 Lock for modifying the name.
string schema
 The schema of the table.
string table
 The name of the table.
TableIndexList indexes
 The physical list of indexes of this table.
vector< IndexStorageInfo > index_storage_infos
 Index storage information of the indexes created by this table.
StorageLock checkpoint_lock
 Lock held while checkpointing.
optional_idx last_seen_checkpoint
 The last seen checkpoint while doing a concurrent operation, if any.
optional_idx checkpoint_row_group_count
 The amount of row groups the checkpoint is processing.

Friends

class DataTable

Constructor & Destructor Documentation

◆ DataTableInfo()

duckdb::DataTableInfo::DataTableInfo ( AttachedDatabase & db,
shared_ptr< TableIOManager > table_io_manager_p,
string schema,
string table )
411373 : db(db), table_io_manager(std::move(table_io_manager_p)), schema(std::move(schema)), table(std::move(table)) {
411374}
shared_ptr< TableIOManager > table_io_manager
The table IO manager.
Definition duckdb.hpp:50394
string schema
The schema of the table.
Definition duckdb.hpp:50398
AttachedDatabase & db
The database instance of the table.
Definition duckdb.hpp:50392
string table
The name of the table.
Definition duckdb.hpp:50400

Member Function Documentation

◆ BindIndexes()

void duckdb::DataTableInfo::BindIndexes ( ClientContext & context,
const char * index_type = nullptr )

Bind unknown indexes throwing an exception if binding fails. Only binds the specified index type, or all, if nullptr.

411376 {
411377 indexes.Bind(context, *this, index_type);
411378}
float index_type
TableIndexList indexes
The physical list of indexes of this table.
Definition duckdb.hpp:50402

◆ IsTemporary()

bool duckdb::DataTableInfo::IsTemporary ( ) const

Whether or not the table is temporary.

411380 {
411381 return db.IsTemporary();
411382}

◆ GetDB()

AttachedDatabase & duckdb::DataTableInfo::GetDB ( )
inline
50366 {
50367 return db;
50368 }

◆ GetIOManager()

TableIOManager & duckdb::DataTableInfo::GetIOManager ( )
inline
50370 {
50371 return *table_io_manager;
50372 }

◆ GetIndexes()

TableIndexList & duckdb::DataTableInfo::GetIndexes ( )
inline
50374 {
50375 return indexes;
50376 }

◆ ExtractIndexStorageInfo()

IndexStorageInfo duckdb::DataTableInfo::ExtractIndexStorageInfo ( const string & name)

Find and move out an IndexStorageInfo by name from the stored collection.

411384 {
411385 for (idx_t i = 0; i < index_storage_infos.size(); i++) {
411386 if (index_storage_infos[i].name == name) {
411387 auto result = std::move(index_storage_infos[i]);
411388 index_storage_infos.erase_at(i);
411389 return result;
411390 }
411391 }
411392 throw InternalException("ExtractIndexStorageInfo: index storage info with name '%s' not found", name);
411393}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
vector< IndexStorageInfo > index_storage_infos
Index storage information of the indexes created by this table.
Definition duckdb.hpp:50404

◆ GetSharedLock()

unique_ptr< StorageLockKey > duckdb::DataTableInfo::GetSharedLock ( )
inline
50379 {
50380 return checkpoint_lock.GetSharedLock();
50381 }
StorageLock checkpoint_lock
Lock held while checkpointing.
Definition duckdb.hpp:50406

◆ AppendRequiresNewRowGroup()

bool duckdb::DataTableInfo::AppendRequiresNewRowGroup ( RowGroupCollection & collection,
transaction_t checkpoint_id )
412498 {
412499 if (checkpoint_id == MAX_TRANSACTION_ID) {
412500 // no active checkpoint
412501 return false;
412502 }
412503 auto current_segment_count = collection.GetSegmentCount();
412504 if (last_seen_checkpoint.IsValid() && last_seen_checkpoint.GetIndex() == checkpoint_id) {
412505 // we have already seen this checkpoint
412506 // however, we might still need to append a new row group if a previous append was reverted
412507 return current_segment_count <= checkpoint_row_group_count.GetIndex();
412508 }
412509 // we have not yet seen this checkpoint - we need to append a new row group
412510 // store the id and the segment count
412511 last_seen_checkpoint = checkpoint_id;
412512 checkpoint_row_group_count = current_segment_count;
412513 return true;
412514}
optional_idx last_seen_checkpoint
The last seen checkpoint while doing a concurrent operation, if any.
Definition duckdb.hpp:50408
optional_idx checkpoint_row_group_count
The amount of row groups the checkpoint is processing.
Definition duckdb.hpp:50410

◆ CheckpointRowGroupCount()

optional_idx duckdb::DataTableInfo::CheckpointRowGroupCount ( const CheckpointOptions & options) const
412516 {
412517 if (!last_seen_checkpoint.IsValid() || last_seen_checkpoint.GetIndex() != options.transaction_id) {
412518 return optional_idx();
412519 }
412521}

◆ VerifyIndexBuffers()

void duckdb::DataTableInfo::VerifyIndexBuffers ( )
411757 {
411758 for (auto &entry : indexes.IndexEntries()) {
411759 auto &index = *entry.index;
411760 if (index.IsBound()) {
411761 index.Cast<BoundIndex>().VerifyBuffers();
411762 }
411763 if (entry.deleted_rows_in_use) {
411764 entry.deleted_rows_in_use->VerifyBuffers();
411765 }
411766 }
411767}
index

◆ GetSchemaName()

string duckdb::DataTableInfo::GetSchemaName ( )
411777 {
411778 return schema;
411779}

◆ GetTableName()

string duckdb::DataTableInfo::GetTableName ( )
411781 {
411782 lock_guard<mutex> l(name_lock);
411783 return table;
411784}
mutex name_lock
Lock for modifying the name.
Definition duckdb.hpp:50396

◆ SetTableName()

void duckdb::DataTableInfo::SetTableName ( string name)
411786 {
411787 lock_guard<mutex> l(name_lock);
411788 table = std::move(name);
411789}

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