![]() |
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.
|
StorageManager is responsible for managing the physical storage of a persistent database. More...


Public Member Functions | |
| StorageManager (AttachedDatabase &db, string path, AttachOptions &options) | |
| void | Initialize (QueryContext context) |
| DatabaseInstance & | GetDatabase () |
| AttachedDatabase & | GetAttached () const |
| idx_t | GetWALSize () |
| Gets the size of the WAL, or zero, if there is no WAL. | |
| bool | HasWAL () const |
| void | AddWALSize (idx_t size) |
| void | SetWALSize (idx_t size) |
| idx_t | GetWALEntriesCount () const |
| Gets the number of WAL entries since last checkpoint. | |
| void | ResetWALEntriesCount () |
| void | IncrementWALEntriesCount () |
| optional_ptr< WriteAheadLog > | GetWAL () |
| Gets the WAL of the StorageManager, or nullptr, if there is no WAL. | |
| bool | WALStartCheckpoint (MetaBlockPointer meta_block, CheckpointOptions &options) |
| Write that we started a checkpoint to the WAL if there is one - returns whether or not there is a WAL. | |
| void | WALFinishCheckpoint (lock_guard< mutex > &wal_lock) |
| Finishes a checkpoint. | |
| unique_ptr< lock_guard< mutex > > | GetWALLock () |
| string | GetDBPath () const |
| Returns the database file path. | |
| bool | IsLoaded () const |
| string | GetWALPath (const string &suffix=".wal") |
| The path to the WAL, derived from the database file path. | |
| string | GetCheckpointWALPath () |
| The path to the WAL that is used while a checkpoint is running. | |
| string | GetRecoveryWALPath () |
| The path to the WAL that is used while recovering from a crash involving the checkpoint WAL. | |
| bool | InMemory () const |
| virtual bool | AutomaticCheckpoint (idx_t estimated_wal_bytes)=0 |
| virtual unique_ptr< StorageCommitState > | GenStorageCommitState (WriteAheadLog &wal)=0 |
| virtual bool | IsCheckpointClean (MetaBlockPointer checkpoint_id)=0 |
| virtual void | CreateCheckpoint (QueryContext context, CheckpointOptions options=CheckpointOptions())=0 |
| virtual DatabaseSize | GetDatabaseSize ()=0 |
| virtual vector< MetadataBlockInfo > | GetMetadataInfo ()=0 |
| virtual shared_ptr< TableIOManager > | GetTableIOManager (BoundCreateTableInfo *info)=0 |
| virtual BlockManager & | GetBlockManager ()=0 |
| virtual void | Destroy () |
| void | SetStorageVersion (idx_t version) |
| bool | HasStorageVersion () const |
| idx_t | GetStorageVersion () const |
| bool | CompressionIsEnabled () const |
| EncryptionTypes::CipherType | GetCipher () const |
| void | SetCipher (EncryptionTypes::CipherType cipher_p) |
| void | SetEncryptionVersion (EncryptionTypes::EncryptionVersion version) |
| bool | IsEncrypted () const |
| EncryptionTypes::EncryptionVersion | GetEncryptionVersion () const |
| template<class TARGET> | |
| TARGET & | Cast () |
| template<class TARGET> | |
| const TARGET & | Cast () const |
Static Public Member Functions | |
| static StorageManager & | Get (AttachedDatabase &db) |
| static StorageManager & | Get (Catalog &catalog) |
Protected Member Functions | |
| virtual void | LoadDatabase (QueryContext context)=0 |
Protected Attributes | |
| AttachedDatabase & | db |
| The attached database managed by this storage manager. | |
| string | path |
| The path of the database. | |
| string | wal_path |
| The WAL path. | |
| unique_ptr< WriteAheadLog > | wal |
| The WriteAheadLog of the storage manager. | |
| mutex | wal_lock |
| Mutex used to control writes to the WAL. | |
| bool | read_only |
| Whether or not the database is opened in read-only mode. | |
| bool | load_complete = false |
| optional_idx | storage_version |
| The serialization compatibility version when reading and writing from this database. | |
| atomic< idx_t > | wal_size |
| atomic< idx_t > | wal_entries_count |
| StorageOptions | storage_options |
| Storage options passed in through configuration. | |
StorageManager is responsible for managing the physical storage of a persistent database.
| duckdb::StorageManager::StorageManager | ( | AttachedDatabase & | db, |
| string | path, | ||
| AttachOptions & | options ) |
|
virtual |
|
static |
|
static |
| void duckdb::StorageManager::Initialize | ( | QueryContext | context | ) |
Initialize a database or load an existing database from the database file path. The block_alloc_size is either set, or invalid. If invalid, then DuckDB defaults to the default_block_alloc_size (DBConfig), or the file's block allocation size, if it is an existing database.
| DatabaseInstance & duckdb::StorageManager::GetDatabase | ( | ) |
|
inline |
| idx_t duckdb::StorageManager::GetWALSize | ( | ) |
Gets the size of the WAL, or zero, if there is no WAL.

| bool duckdb::StorageManager::HasWAL | ( | ) | const |
| void duckdb::StorageManager::AddWALSize | ( | idx_t | size | ) |
| idx_t duckdb::StorageManager::GetWALEntriesCount | ( | ) | const |
Gets the number of WAL entries since last checkpoint.
| void duckdb::StorageManager::ResetWALEntriesCount | ( | ) |
| void duckdb::StorageManager::IncrementWALEntriesCount | ( | ) |
| optional_ptr< WriteAheadLog > duckdb::StorageManager::GetWAL | ( | ) |
Gets the WAL of the StorageManager, or nullptr, if there is no WAL.
| bool duckdb::StorageManager::WALStartCheckpoint | ( | MetaBlockPointer | meta_block, |
| CheckpointOptions & | options ) |
Write that we started a checkpoint to the WAL if there is one - returns whether or not there is a WAL.

| void duckdb::StorageManager::WALFinishCheckpoint | ( | lock_guard< mutex > & | wal_lock | ) |
Finishes a checkpoint.
| unique_ptr< lock_guard< mutex > > duckdb::StorageManager::GetWALLock | ( | ) |
|
inline |
Returns the database file path.
|
inline |
| string duckdb::StorageManager::GetWALPath | ( | const string & | suffix = ".wal" | ) |
The path to the WAL, derived from the database file path.

| string duckdb::StorageManager::GetCheckpointWALPath | ( | ) |
The path to the WAL that is used while a checkpoint is running.


| string duckdb::StorageManager::GetRecoveryWALPath | ( | ) |
The path to the WAL that is used while recovering from a crash involving the checkpoint WAL.

| bool duckdb::StorageManager::InMemory | ( | ) | const |
|
virtual |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protectedpure virtual |
Implemented in duckdb::SingleFileStorageManager.
|
inline |
|
inline |
|
protected |
When loading a database, we do not yet set the wal-field. Therefore, GetWriteAheadLog must return nullptr when loading a database
|
protected |
Estimated size of changes for determining automatic checkpointing on in-memory databases and databases without a WAL.