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

Public Member Functions

 ChunkConstantInfo (idx_t start)
idx_t GetSelVector (ScanOptions options, optional_ptr< SelectionVector > sel_vector, idx_t max_count) const override
bool Fetch (TransactionData transaction, row_t row) override
 Returns whether or not a single row in the ChunkInfo should be used or not for the given transaction.
void CommitAppend (transaction_t commit_id, idx_t start, idx_t end) override
bool Cleanup (transaction_t lowest_transaction) const override
string ToString (idx_t max_count) const override
bool HasDeletes (transaction_t transaction_id=MAX_TRANSACTION_ID) const override
void Write (WriteStream &writer, transaction_t transaction_id) const override
Public Member Functions inherited from duckdb::ChunkInfo
 ChunkInfo (idx_t start, ChunkInfoType type)
idx_t GetCheckpointRowCount (TransactionData transaction, idx_t max_count)
idx_t GetCommittedDeletedCount (idx_t max_count) const
template<class TARGET>
TARGET & Cast ()
template<class TARGET>
const TARGET & Cast () const

Static Public Member Functions

static unique_ptr< ChunkInfo > Read (ReadStream &reader)
Static Public Member Functions inherited from duckdb::ChunkInfo
static unique_ptr< ChunkInfo > Read (FixedSizeAllocator &allocator, ReadStream &reader)

Public Attributes

transaction_t insert_id
transaction_t delete_id
Public Attributes inherited from duckdb::ChunkInfo
idx_t start
 The row index of the first row.
ChunkInfoType type
 The ChunkInfo type.

Static Public Attributes

static constexpr const ChunkInfoType TYPE = ChunkInfoType::CONSTANT_INFO

Private Member Functions

template<class INSERT_OP, class DELETE_OP>
idx_t TemplatedGetSelVector (transaction_t start_time, transaction_t transaction_id, idx_t max_count) const

Constructor & Destructor Documentation

◆ ChunkConstantInfo()

duckdb::ChunkConstantInfo::ChunkConstantInfo ( idx_t start)
explicit
427617 : ChunkInfo(start, ChunkInfoType::CONSTANT_INFO), insert_id(0), delete_id(NOT_DELETED_ID) {
427618}
idx_t start
The row index of the first row.
Definition duckdb.hpp:22704

Member Function Documentation

◆ GetSelVector()

idx_t duckdb::ChunkConstantInfo::GetSelVector ( ScanOptions options,
optional_ptr< SelectionVector > sel_vector,
idx_t max_count ) const
overridevirtual

Gets up to max_count entries from the chunk info. If the ret is 0>ret>max_count, the selection vector is filled with the tuples

Implements duckdb::ChunkInfo.

427631 {
427632 auto &transaction = options.transaction;
427633 if (options.insert_type == InsertedScanType::STANDARD) {
427634 if (!StandardInsertOperator::UseInsertedVersion(transaction.start_time, transaction.transaction_id,
427635 insert_id)) {
427636 return 0;
427637 }
427638 }
427639 if (options.delete_type == DeletedScanType::STANDARD) {
427640 if (StandardDeleteOperator::IsDeleted(transaction.start_time, transaction.transaction_id, delete_id)) {
427641 return 0;
427642 }
427643 } else if (options.delete_type == DeletedScanType::OMIT_COMMITTED_DELETES) {
427644 if (CommittedDeleteOperator::IsDeleted(transaction.start_time, transaction.transaction_id, delete_id)) {
427645 return 0;
427646 }
427647 }
427648 return max_count;
427649}
@ OMIT_COMMITTED_DELETES
omit only deleted rows that have been committed and have a commit ts lower than the transaction start
Definition duckdb.hpp:22652
@ STANDARD
omit any rows that are deleted
Definition duckdb.hpp:22648

◆ Fetch()

bool duckdb::ChunkConstantInfo::Fetch ( TransactionData transaction,
row_t row )
overridevirtual

Returns whether or not a single row in the ChunkInfo should be used or not for the given transaction.

Implements duckdb::ChunkInfo.

427651 {
427652 return UseVersion(transaction, insert_id) && !UseVersion(transaction, delete_id);
427653}

◆ CommitAppend()

void duckdb::ChunkConstantInfo::CommitAppend ( transaction_t commit_id,
idx_t start,
idx_t end )
overridevirtual

Implements duckdb::ChunkInfo.

427655 {
427656 D_ASSERT(start == 0 && end == STANDARD_VECTOR_SIZE);
427657 insert_id = commit_id;
427658}

◆ Cleanup()

bool duckdb::ChunkConstantInfo::Cleanup ( transaction_t lowest_transaction) const
overridevirtual

Reimplemented from duckdb::ChunkInfo.

427668 {
427669 if (delete_id != NOT_DELETED_ID) {
427670 // the chunk info is labeled as deleted - we need to keep it around
427671 return false;
427672 }
427673 if (insert_id > lowest_transaction) {
427674 // there are still transactions active that need this ChunkInfo
427675 return false;
427676 }
427677 return true;
427678}

◆ ToString()

string duckdb::ChunkConstantInfo::ToString ( idx_t max_count) const
overridevirtual

Implements duckdb::ChunkInfo.

427694 {
427695 string result;
427696 result += "Constant [Count: " + to_string(max_count);
427697 result += ", ";
427698 result += "Insert Id: " + to_string(insert_id);
427699 if (delete_id != NOT_DELETED_ID) {
427700 result += ", Delete Id: " + to_string(delete_id);
427701 }
427702 result += "]";
427703 return result;
427704}
std::string to_string(const T &value)
Definition duckdb.cpp:19425

◆ HasDeletes()

bool duckdb::ChunkConstantInfo::HasDeletes ( transaction_t transaction_id = MAX_TRANSACTION_ID) const
overridevirtual

Implements duckdb::ChunkInfo.

427660 {
427661 if (transaction_id == MAX_TRANSACTION_ID) {
427662 transaction_id = TRANSACTION_ID_START - 1;
427663 }
427664 bool is_deleted = insert_id >= TRANSACTION_ID_START || delete_id <= transaction_id;
427665 return is_deleted;
427666}

◆ Write()

void duckdb::ChunkConstantInfo::Write ( WriteStream & writer,
transaction_t transaction_id ) const
overridevirtual

Reimplemented from duckdb::ChunkInfo.

427680 {
427681 D_ASSERT(HasDeletes(checkpoint_id));
427682 ChunkInfo::Write(writer, checkpoint_id);
427683 writer.Write<idx_t>(start);
427684}
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

◆ Read()

unique_ptr< ChunkInfo > duckdb::ChunkConstantInfo::Read ( ReadStream & reader)
static
427686 {
427687 auto start = reader.Read<idx_t>();
427688 auto info = make_uniq<ChunkConstantInfo>(start);
427689 info->insert_id = 0;
427690 info->delete_id = 0;
427691 return std::move(info);
427692}

◆ TemplatedGetSelVector()

template<class INSERT_OP, class DELETE_OP>
idx_t duckdb::ChunkConstantInfo::TemplatedGetSelVector ( transaction_t start_time,
transaction_t transaction_id,
idx_t max_count ) const
private
427622 {
427623 if (INSERT_OP::UseInsertedVersion(start_time, transaction_id, insert_id) &&
427624 !DELETE_OP::IsDeleted(start_time, transaction_id, delete_id)) {
427625 return max_count;
427626 }
427627 return 0;
427628}

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