vkdb
A time series database engine in C++.
Loading...
Searching...
No Matches
vkdb::WriteAheadLog< TValue > Class Template Reference

Write-ahead log. More...

#include <write_ahead_log.h>

Public Member Functions

 WriteAheadLog ()=delete
 Deleted default constructor.
 
 WriteAheadLog (FilePath lsm_tree_path) noexcept
 Construct a new WriteAheadLog object given the path of the LSM tree.
 
 WriteAheadLog (WriteAheadLog &&) noexcept=default
 Move-construct a WriteAheadLog object.
 
WriteAheadLogoperator= (WriteAheadLog &&) noexcept=default
 Move-assign a WriteAheadLog object.
 
 WriteAheadLog (const WriteAheadLog &)=delete
 Deleted copy constructor.
 
WriteAheadLogoperator= (const WriteAheadLog &)=delete
 Deleted copy assignment operator.
 
 ~WriteAheadLog () noexcept=default
 Destroy the WriteAheadLog object.
 
void append (const WALRecord< TValue > &record)
 Append a WAL record to the write-ahead log.
 
void replay (LSMTree< TValue > &lsm_tree)
 Replay the write-ahead log on the LSM tree.
 
void clear ()
 Clear the write-ahead log.
 
FilePath path () const noexcept
 Get the path of the write-ahead log.
 

Detailed Description

template<ArithmeticNoCVRefQuals TValue>
class vkdb::WriteAheadLog< TValue >

Write-ahead log.

Template Parameters
TValueValue type.

Definition at line 20 of file write_ahead_log.h.

Constructor & Destructor Documentation

◆ WriteAheadLog()

template<ArithmeticNoCVRefQuals TValue>
vkdb::WriteAheadLog< TValue >::WriteAheadLog ( FilePath lsm_tree_path)
inlineexplicitnoexcept

Construct a new WriteAheadLog object given the path of the LSM tree.

Parameters
lsm_tree_pathPath.

Definition at line 34 of file write_ahead_log.h.

Member Function Documentation

◆ append()

template<ArithmeticNoCVRefQuals TValue>
void vkdb::WriteAheadLog< TValue >::append ( const WALRecord< TValue > & record)
inline

Append a WAL record to the write-ahead log.

Parameters
recordWAL record.
Exceptions
std::runtime_errorIf the file cannot be opened.

Definition at line 74 of file write_ahead_log.h.

◆ clear()

template<ArithmeticNoCVRefQuals TValue>
void vkdb::WriteAheadLog< TValue >::clear ( )
inline

Clear the write-ahead log.

Exceptions
std::runtime_errorIf the file cannot be opened.

Definition at line 131 of file write_ahead_log.h.

◆ path()

template<ArithmeticNoCVRefQuals TValue>
FilePath vkdb::WriteAheadLog< TValue >::path ( ) const
inlinenodiscardnoexcept

Get the path of the write-ahead log.

Returns
FilePath Path.

Definition at line 147 of file write_ahead_log.h.

◆ replay()

template<ArithmeticNoCVRefQuals TValue>
void vkdb::WriteAheadLog< TValue >::replay ( LSMTree< TValue > & lsm_tree)
inline

Replay the write-ahead log on the LSM tree.

Parameters
lsm_treeLSM tree.
Exceptions
std::runtime_errorIf the file cannot be opened.

Definition at line 94 of file write_ahead_log.h.


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