Tkrzw
Public Member Functions | List of all members
tkrzw::DBMUpdateLoggerDBM Class Referencefinal

DBM update logger to replicate updates in another DBM. More...

#include <tkrzw_dbm_ulog.h>

Public Member Functions

 DBMUpdateLoggerDBM (DBM *dbm)
 Constructor. More...
 
Status WriteSet (std::string_view key, std::string_view value) override
 Writes a log for modifying an existing record or adding a new record. More...
 
Status WriteRemove (std::string_view key) override
 Writes a log for removing an existing record. More...
 
Status WriteClear () override
 Writes a log for removing all records. More...
 
Status Synchronize (bool hard) override
 Synchronizes the metadata and content to the file system. More...
 
- Public Member Functions inherited from tkrzw::DBM::UpdateLogger
virtual ~UpdateLogger ()=default
 Destructor. More...
 

Detailed Description

DBM update logger to replicate updates in another DBM.

Constructor & Destructor Documentation

◆ DBMUpdateLoggerDBM()

tkrzw::DBMUpdateLoggerDBM::DBMUpdateLoggerDBM ( DBM dbm)
explicit

Constructor.

Parameters
dbmA DBM object to store logs in. The ownership is not taken.

Member Function Documentation

◆ WriteSet()

Status tkrzw::DBMUpdateLoggerDBM::WriteSet ( std::string_view  key,
std::string_view  value 
)
overridevirtual

Writes a log for modifying an existing record or adding a new record.

Parameters
keyThe key of the record.
valueThe new value of the record.
Returns
The result status.

Implements tkrzw::DBM::UpdateLogger.

◆ WriteRemove()

Status tkrzw::DBMUpdateLoggerDBM::WriteRemove ( std::string_view  key)
overridevirtual

Writes a log for removing an existing record.

Parameters
keyThe key of the record.
Returns
The result status.

Implements tkrzw::DBM::UpdateLogger.

◆ WriteClear()

Status tkrzw::DBMUpdateLoggerDBM::WriteClear ( )
overridevirtual

Writes a log for removing all records.

Returns
The result status.

Implements tkrzw::DBM::UpdateLogger.

◆ Synchronize()

Status tkrzw::DBMUpdateLoggerDBM::Synchronize ( bool  hard)
overridevirtual

Synchronizes the metadata and content to the file system.

Parameters
hardTrue to do physical synchronization with the hardware or false to do only logical synchronization with the file system.
Returns
The result status.

Reimplemented from tkrzw::DBM::UpdateLogger.