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

Public Member Functions

 IndexDataRemover (DuckTransaction &transaction, QueryContext context, IndexRemovalType removal_type)
void PushDelete (DeleteInfo &info)
void Verify ()

Private Member Functions

void Flush (DataTable &table, row_t *row_numbers, idx_t count)

Private Attributes

DuckTransaction & transaction
QueryContext context
IndexRemovalType removal_type
 While committing, we remove data from any indexes that was deleted.
DataChunk chunk
reference_map_t< DataTable, shared_ptr< DataTableInfo > > verify_indexes
 Debug mode only - list of indexes to verify.

Constructor & Destructor Documentation

◆ IndexDataRemover()

duckdb::IndexDataRemover::IndexDataRemover ( DuckTransaction & transaction,
QueryContext context,
IndexRemovalType removal_type )
explicit
445782 : transaction(transaction_p), context(context), removal_type(removal_type) {
445783}
IndexRemovalType removal_type
While committing, we remove data from any indexes that was deleted.
Definition duckdb.cpp:445605

Member Function Documentation

◆ PushDelete()

void duckdb::IndexDataRemover::PushDelete ( DeleteInfo & info)
445785 {
445786 auto &version_table = *info.table;
445787 if (!version_table.HasIndexes()) {
445788 // this table has no indexes: no cleanup to be done
445789 return;
445790 }
445791
445792 idx_t count = 0;
445793 row_t row_numbers[STANDARD_VECTOR_SIZE];
445794 if (info.is_consecutive) {
445795 for (idx_t i = 0; i < info.count; i++) {
445796 row_numbers[count++] = UnsafeNumericCast<int64_t>(info.base_row + i);
445797 }
445798 } else {
445799 auto rows = info.GetRows();
445800 for (idx_t i = 0; i < info.count; i++) {
445801 row_numbers[count++] = UnsafeNumericCast<int64_t>(info.base_row + rows[i]);
445802 }
445803 }
445804 Flush(version_table, row_numbers, count);
445805}
int rows
int64_t row_t
The type used for row identifiers.
Definition duckdb.hpp:240
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237

◆ Verify()

void duckdb::IndexDataRemover::Verify ( )
445807 {
445808#ifdef DEBUG
445809 // Verify that our index memory is stable.
445810 for (auto &table : verify_indexes) {
445811 table.second->VerifyIndexBuffers();
445812 }
445813#endif
445814}
reference_map_t< DataTable, shared_ptr< DataTableInfo > > verify_indexes
Debug mode only - list of indexes to verify.
Definition duckdb.cpp:445608

◆ Flush()

void duckdb::IndexDataRemover::Flush ( DataTable & table,
row_t * row_numbers,
idx_t count )
private
445820 {
445821 if (count == 0) {
445822 return;
445823 }
445824#ifdef DEBUG
445825 verify_indexes.insert(make_pair(reference<DataTable>(table), table.GetDataTableInfo()));
445826#endif
445827
445828 // set up the row identifiers vector
445829 Vector row_identifiers(LogicalType::ROW_TYPE, data_ptr_cast(row_numbers));
445830
445831 auto active_checkpoint = transaction.GetTransactionManager().Cast<DuckTransactionManager>().GetActiveCheckpoint();
445832 auto checkpoint_id = active_checkpoint == MAX_TRANSACTION_ID ? optional_idx() : active_checkpoint;
445833 // delete the tuples from all the indexes.
445834 // If there is any issue with removal, a FatalException must be thrown since there may be a corruption of
445835 // data, hence the transaction cannot be guaranteed.
445836 try {
445837 table.RemoveFromIndexes(context, row_identifiers, count, removal_type, checkpoint_id);
445838 } catch (std::exception &ex) {
445839 throw FatalException(ErrorData(ex).Message());
445840 } catch (...) {
445841 throw FatalException("unknown failure in CommitState::Flush");
445842 }
445843
445844 count = 0;
445845}

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