![]() |
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.
| void duckdb::StorageManager::Initialize | ( | QueryContext | context | ) |
|
inline |
|
inline |
Returns the database file path.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
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.