Tkrzw
Public Member Functions | List of all members
tkrzw::DBM::UpdateLogger Class Referenceabstract

Interface of update logger. More...

#include <tkrzw_dbm.h>

Public Member Functions

virtual ~UpdateLogger ()=default
 Destructor. More...
 
virtual Status WriteSet (std::string_view key, std::string_view value)=0
 Writes a log for modifying an existing record or adding a new record. More...
 
virtual Status WriteRemove (std::string_view key)=0
 Writes a log for removing an existing record. More...
 
virtual Status WriteClear ()=0
 Writes a log for removing all records. More...
 
virtual Status Synchronize (bool hard)
 Synchronizes the metadata and content to the file system. More...
 

Detailed Description

Interface of update logger.

Constructor & Destructor Documentation

◆ ~UpdateLogger()

virtual tkrzw::DBM::UpdateLogger::~UpdateLogger ( )
virtualdefault

Destructor.

Member Function Documentation

◆ WriteSet()

virtual Status tkrzw::DBM::UpdateLogger::WriteSet ( std::string_view  key,
std::string_view  value 
)
pure virtual

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.

This is called by the Set, Append, Increment methods etc and when the Process method returns a new record value.

Implemented in tkrzw::DBMUpdateLoggerMQ, tkrzw::DBMUpdateLoggerSecondShard, tkrzw::DBMUpdateLoggerDBM, and tkrzw::DBMUpdateLoggerStrDeque.

◆ WriteRemove()

virtual Status tkrzw::DBM::UpdateLogger::WriteRemove ( std::string_view  key)
pure virtual

Writes a log for removing an existing record.

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

This is called by the Remove method and when the Process method returns REMOVE.

Implemented in tkrzw::DBMUpdateLoggerMQ, tkrzw::DBMUpdateLoggerSecondShard, tkrzw::DBMUpdateLoggerDBM, and tkrzw::DBMUpdateLoggerStrDeque.

◆ WriteClear()

virtual Status tkrzw::DBM::UpdateLogger::WriteClear ( )
pure virtual

Writes a log for removing all records.

Returns
The result status.

This is called by the Clear method.

Implemented in tkrzw::DBMUpdateLoggerMQ, tkrzw::DBMUpdateLoggerSecondShard, tkrzw::DBMUpdateLoggerDBM, and tkrzw::DBMUpdateLoggerStrDeque.

◆ Synchronize()

virtual Status tkrzw::DBM::UpdateLogger::Synchronize ( bool  hard)
virtual

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.

This is called by the Synchronize method.

Reimplemented in tkrzw::DBMUpdateLoggerMQ, and tkrzw::DBMUpdateLoggerDBM.