#include <PersistLog.hpp>
Public Member Functions | |
PersistLog (const std::string &name) noexcept(true) | |
virtual | ~PersistLog () noexcept(true) |
virtual void | append (const void *pdata, const uint64_t &size, const version_t &ver, const HLC &mhlc) noexcept(false)=0 |
Persistent Append. More... | |
virtual void | advanceVersion (const version_t &ver) noexcept(false)=0 |
Advance the version number without appendding a log. More... | |
virtual int64_t | getLength () noexcept(false)=0 |
virtual int64_t | getEarliestIndex () noexcept(false)=0 |
virtual int64_t | getLatestIndex () noexcept(false)=0 |
virtual int64_t | getVersionIndex (const version_t &ver) noexcept(false)=0 |
virtual int64_t | getHLCIndex (const HLC &hlc) noexcept(false)=0 |
virtual version_t | getEarliestVersion () noexcept(false)=0 |
virtual version_t | getLatestVersion () noexcept(false)=0 |
virtual const version_t | getLastPersisted () noexcept(false)=0 |
virtual const void * | getEntryByIndex (const int64_t &eno) noexcept(false)=0 |
virtual const void * | getEntry (const version_t &ver) noexcept(false)=0 |
virtual const void * | getEntry (const HLC &hlc) noexcept(false)=0 |
virtual const version_t | persist (const bool preLocked=false) noexcept(false)=0 |
Persist the log till specified version. More... | |
virtual void | trimByIndex (const int64_t &idx) noexcept(false)=0 |
Trim the log till entry number eno, inclusively. More... | |
virtual void | trim (const version_t &ver) noexcept(false)=0 |
Trim the log till version, inclusively. More... | |
virtual void | trim (const HLC &hlc) noexcept(false)=0 |
Trim the log till HLC clock, inclusively. More... | |
virtual size_t | bytes_size (const version_t &ver)=0 |
Calculate the byte size required for serialization ver - from which version the detal begins(tail log) INVALID_VERSION means to include all of the tail logs. More... | |
virtual size_t | to_bytes (char *buf, const version_t &ver)=0 |
Write the serialized log bytes to the given buffer buf - the buffer to receive serialized bytes ver - from which version the detal begins(tail log) INVALID_VERSION means to include all of the tail logs. More... | |
virtual void | post_object (const std::function< void(char const *const, std::size_t)> &f, const version_t &ver)=0 |
Post the serialized log bytes to a function f - the function to handle the serialzied bytes ver - from which version the detal begins(tail log) INVALID_VERSION means to include all of the tail logs. More... | |
virtual void | applyLogTail (char const *v)=0 |
Check/Merge the LogTail to the existing log. More... | |
virtual void | truncate (const version_t &ver) noexcept(false)=0 |
Truncate the log strictly newer than 'ver'. More... | |
Public Attributes | |
const std::string | m_sName |
std::set< hlc_index_entry, hlc_index_entry_comp > | hidx |
Definition at line 57 of file PersistLog.hpp.
|
noexcept |
Definition at line 7 of file PersistLog.cpp.
|
virtualnoexcept |
Definition at line 10 of file PersistLog.cpp.
|
pure virtualnoexcept |
Advance the version number without appendding a log.
This is useful to create gap between versions.
Implemented in persistent::FilePersistLog.
|
pure virtualnoexcept |
Persistent Append.
pdata | - serialized data to be append |
size | - length of the data |
ver | - version of the data, the implementation is responsible for making sure it grows monotonically. |
mhlc | - the hlc clock of the data, the implementation is responsible for making sure it grows monotonically. Note that the entry appended can only become persistent till the persist() is called on that entry. |
Implemented in persistent::FilePersistLog.
|
pure virtual |
Check/Merge the LogTail to the existing log.
dsm - deserialization manager v - serialized log bytes to be apllied
Implemented in persistent::FilePersistLog.
|
pure virtual |
Calculate the byte size required for serialization ver - from which version the detal begins(tail log) INVALID_VERSION means to include all of the tail logs.
Implemented in persistent::FilePersistLog.
|
pure virtualnoexcept |
Implemented in persistent::FilePersistLog.
|
pure virtualnoexcept |
Implemented in persistent::FilePersistLog.
|
pure virtualnoexcept |
Implemented in persistent::FilePersistLog.
|
pure virtualnoexcept |
Implemented in persistent::FilePersistLog.
|
pure virtualnoexcept |
Implemented in persistent::FilePersistLog.
|
pure virtualnoexcept |
Implemented in persistent::FilePersistLog.
|
pure virtualnoexcept |
Implemented in persistent::FilePersistLog.
|
pure virtualnoexcept |
Implemented in persistent::FilePersistLog.
|
pure virtualnoexcept |
Implemented in persistent::FilePersistLog.
|
pure virtualnoexcept |
Implemented in persistent::FilePersistLog.
|
pure virtualnoexcept |
Implemented in persistent::FilePersistLog.
|
pure virtualnoexcept |
Persist the log till specified version.
Implemented in persistent::FilePersistLog.
|
pure virtual |
Post the serialized log bytes to a function f - the function to handle the serialzied bytes ver - from which version the detal begins(tail log) INVALID_VERSION means to include all of the tail logs.
Implemented in persistent::FilePersistLog.
|
pure virtual |
Write the serialized log bytes to the given buffer buf - the buffer to receive serialized bytes ver - from which version the detal begins(tail log) INVALID_VERSION means to include all of the tail logs.
Implemented in persistent::FilePersistLog.
|
pure virtualnoexcept |
Trim the log till version, inclusively.
ver | - all log entry before ver will be trimmed. |
Implemented in persistent::FilePersistLog.
|
pure virtualnoexcept |
Trim the log till HLC clock, inclusively.
hlc | - all log entry before hlc will be trimmed. |
Implemented in persistent::FilePersistLog.
|
pure virtualnoexcept |
Trim the log till entry number eno, inclusively.
For exmaple, there is a log: [7,8,9,4,5,6]. After trim(3), it becomes [5,6]
eno | - the log number to be trimmed |
Implemented in persistent::FilePersistLog.
|
pure virtualnoexcept |
Truncate the log strictly newer than 'ver'.
ver | - all log entry strict after ver will be truncated. |
Implemented in persistent::FilePersistLog.
std::set<hlc_index_entry, hlc_index_entry_comp> persistent::PersistLog::hidx |
Definition at line 62 of file PersistLog.hpp.
const std::string persistent::PersistLog::m_sName |
Definition at line 60 of file PersistLog.hpp.