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

Classes

struct  ActiveTableLock
 

Public Member Functions

 DuckTransaction (DuckTransactionManager &manager, ClientContext &context, transaction_t start_time, transaction_t transaction_id, idx_t catalog_version)
 
LocalStorageGetLocalStorage ()
 
void PushCatalogEntry (CatalogEntry &entry, data_ptr_t extra_data, idx_t extra_data_size)
 
void PushAttach (AttachedDatabase &db)
 
void SetModifications (DatabaseModificationType type) override
 Sets the database modifications that are planned to be performed in this transaction.
 
bool ShouldWriteToWAL (AttachedDatabase &db)
 
ErrorData WriteToWAL (ClientContext &context, AttachedDatabase &db, unique_ptr< StorageCommitState > &commit_state) noexcept
 
ErrorData Commit (AttachedDatabase &db, CommitInfo &commit_info, unique_ptr< StorageCommitState > commit_state) noexcept
 
bool AutomaticCheckpoint (AttachedDatabase &db, const UndoBufferProperties &properties)
 Returns whether or not a commit of this transaction should trigger an automatic checkpoint.
 
ErrorData Rollback ()
 Rollback.
 
void Cleanup (transaction_t lowest_active_transaction)
 Cleanup the undo buffer.
 
bool ChangesMade ()
 
UndoBufferProperties GetUndoProperties ()
 
void PushDelete (DataTable &table, RowVersionManager &info, idx_t vector_idx, row_t rows[], idx_t count, idx_t base_row)
 
void PushSequenceUsage (SequenceCatalogEntry &entry, const SequenceData &data)
 
void PushAppend (DataTable &table, idx_t row_start, idx_t row_count)
 
UndoBufferReference CreateUpdateInfo (idx_t type_size, DataTable &data_table, idx_t entries, idx_t row_group_start)
 
DuckTransactionManagerGetTransactionManager ()
 
bool IsDuckTransaction () const override
 
unique_ptr< StorageLockKeyTryGetCheckpointLock ()
 
shared_ptr< CheckpointLockSharedLockTable (DataTableInfo &info)
 Get a shared lock on a table.
 
void ModifyTable (DataTable &tbl)
 Hold an owning reference of the table, needed to safely reference it inside the transaction commit/undo logic.
 
- Public Member Functions inherited from duckdb::Transaction
DUCKDB_API Transaction (TransactionManager &manager, ClientContext &context)
 
DUCKDB_API bool IsReadOnly ()
 Whether or not the transaction has made any modifications to the database so far.
 
virtual DUCKDB_API void SetReadWrite ()
 Promotes the transaction to a read-write transaction.
 
template<class TARGET >
TARGETCast ()
 
template<class TARGET >
const TARGETCast () const
 

Static Public Member Functions

static DuckTransactionGet (ClientContext &context, AttachedDatabase &db)
 
static DuckTransactionGet (ClientContext &context, Catalog &catalog)
 
- Static Public Member Functions inherited from duckdb::Transaction
static DUCKDB_API TransactionGet (ClientContext &context, AttachedDatabase &db)
 
static DUCKDB_API TransactionGet (ClientContext &context, Catalog &catalog)
 
static DUCKDB_API optional_ptr< TransactionTryGet (ClientContext &context, AttachedDatabase &db)
 Returns the transaction for the given context if it has already been started.
 

Public Attributes

transaction_t start_time
 The start timestamp of this transaction.
 
transaction_t transaction_id
 The transaction id of this transaction.
 
transaction_t commit_id
 The commit id of this transaction, if it has successfully been committed.
 
atomic< idx_tcatalog_version
 
bool awaiting_cleanup
 
- Public Attributes inherited from duckdb::Transaction
TransactionManagermanager
 
weak_ptr< ClientContextcontext
 
atomic< transaction_tactive_query
 

Private Attributes

UndoBuffer undo_buffer
 
unique_ptr< LocalStoragestorage
 The set of uncommitted appends for the transaction.
 
unique_ptr< StorageLockKeycheckpoint_lock
 Lock that prevents checkpoints from starting.
 
unique_ptr< StorageLockKeyvacuum_lock
 Lock that prevents vacuums from starting.
 
mutex sequence_lock
 Lock for accessing sequence_usage.
 
reference_map_t< SequenceCatalogEntry, reference< SequenceValue > > sequence_usage
 Map of all sequences that were used during the transaction and the value they had in this transaction.
 
mutex modified_tables_lock
 Lock for modified_tables.
 
reference_map_t< DataTable, shared_ptr< DataTable > > modified_tables
 Tables that are modified by this transaction.
 
mutex active_locks_lock
 Lock for the active_locks map.
 
reference_map_t< DataTableInfo, unique_ptr< ActiveTableLock > > active_locks
 Active locks on tables.
 

Member Function Documentation

◆ SetModifications()

void duckdb::DuckTransaction::SetModifications ( DatabaseModificationType  type)
overridevirtual

Sets the database modifications that are planned to be performed in this transaction.

Reimplemented from duckdb::Transaction.

◆ Commit()

ErrorData duckdb::DuckTransaction::Commit ( AttachedDatabase db,
CommitInfo commit_info,
unique_ptr< StorageCommitState commit_state 
)
noexcept

Commit the current transaction with the given commit identifier. Returns an error message if the transaction commit failed, or an empty string if the commit was sucessful

◆ IsDuckTransaction()

bool duckdb::DuckTransaction::IsDuckTransaction ( ) const
inlineoverridevirtual

Reimplemented from duckdb::Transaction.

10115 {
10116 return true;
10117 }

Member Data Documentation

◆ awaiting_cleanup

bool duckdb::DuckTransaction::awaiting_cleanup

Transactions undergo Cleanup, after (1) removing them directly in RemoveTransaction, or (2) after they enter cleanup_queue. Some (after rollback) enter cleanup_queue, but do not require Cleanup.

◆ undo_buffer

UndoBuffer duckdb::DuckTransaction::undo_buffer
private

The undo buffer is used to store old versions of rows that are updated or deleted


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