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

Public Member Functions

 WriteAheadLog (StorageManager &storage_manager, const string &wal_path, idx_t wal_size=0ULL, WALInitState state=WALInitState::NO_WAL, optional_idx checkpoint_iteration=optional_idx())
 Initialize the WAL in the specified directory.
 
AttachedDatabaseGetDatabase ()
 
StorageManagerGetStorageManager ()
 
const string & GetPath () const
 
idx_t GetTotalWritten () const
 Gets the total bytes written to the WAL since startup.
 
bool Initialized () const
 A WAL is initialized, if a writer to a file exists.
 
BufferedFileWriterInitialize ()
 Initializes the file of the WAL by creating the file writer.
 
void WriteHeader ()
 Write the WAL header.
 
virtual void WriteCreateTable (const TableCatalogEntry &entry)
 
void WriteDropTable (const TableCatalogEntry &entry)
 
void WriteCreateSchema (const SchemaCatalogEntry &entry)
 
void WriteDropSchema (const SchemaCatalogEntry &entry)
 
void WriteCreateView (const ViewCatalogEntry &entry)
 
void WriteDropView (const ViewCatalogEntry &entry)
 
void WriteCreateSequence (const SequenceCatalogEntry &entry)
 
void WriteDropSequence (const SequenceCatalogEntry &entry)
 
void WriteSequenceValue (SequenceValue val)
 
void WriteCreateMacro (const ScalarMacroCatalogEntry &entry)
 
void WriteDropMacro (const ScalarMacroCatalogEntry &entry)
 
void WriteCreateTableMacro (const TableMacroCatalogEntry &entry)
 
void WriteDropTableMacro (const TableMacroCatalogEntry &entry)
 
void WriteCreateIndex (const IndexCatalogEntry &entry)
 
void WriteDropIndex (const IndexCatalogEntry &entry)
 
void WriteCreateType (const TypeCatalogEntry &entry)
 
void WriteDropType (const TypeCatalogEntry &entry)
 
void WriteSetTable (const string &schema, const string &table)
 Sets the table used for subsequent insert/delete/update commands.
 
void WriteAlter (CatalogEntry &entry, const AlterInfo &info)
 
void WriteInsert (DataChunk &chunk)
 
void WriteRowGroupData (const PersistentCollectionData &data)
 
void WriteDelete (DataChunk &chunk)
 
void WriteUpdate (DataChunk &chunk, const vector< column_t > &column_path)
 
void Truncate (idx_t size)
 
void Flush ()
 
void IncrementWALEntriesCount ()
 Increment the WAL entry count, which is used for the auto-checkpoint threshold.
 
void WriteCheckpoint (MetaBlockPointer meta_block)
 

Static Public Member Functions

static unique_ptr< WriteAheadLogReplay (QueryContext context, StorageManager &storage_manager, const string &wal_path)
 Replay and initialize the WAL, QueryContext is passed for metric collection purposes only!!
 

Protected Attributes

StorageManagerstorage_manager
 
mutex wal_lock
 
unique_ptr< BufferedFileWriterwriter
 
string wal_path
 
atomic< WALInitState > init_state
 
optional_idx checkpoint_iteration
 

Detailed Description

The WriteAheadLog (WAL) is a log that is used to provide durability. Prior to committing a transaction it writes the changes the transaction made to the database to the log, which can then be replayed upon startup in case the server crashes or is shut down.

Member Function Documentation

◆ GetPath()

const string & duckdb::WriteAheadLog::GetPath ( ) const
inline
10780 {
10781 return wal_path;
10782 }

◆ WriteUpdate()

void duckdb::WriteAheadLog::WriteUpdate ( DataChunk chunk,
const vector< column_t > &  column_path 
)

Write a single (sub-) column update to the WAL. Chunk must be a pair of (COL, ROW_ID). The column_path vector is a path towards a column within the table i.e. if we have a table with a single column S STRUCT(A INT, B INT) and we update the validity mask of "S.B" the column path is: 0 (first column of table) -> 1 (second subcolumn of struct) -> 0 (first subcolumn of INT)

◆ Truncate()

void duckdb::WriteAheadLog::Truncate ( idx_t  size)

Truncate the WAL to a previous size, and clear anything currently set in the writer. Used during RevertCommit.


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