LogCabin
|
An interface for flushing newly appended log entries to stable storage. More...
#include <Log.h>
Public Member Functions | |
Sync (uint64_t lastIndex) | |
virtual | ~Sync () |
virtual void | wait () |
Wait for the log entries to be durable. | |
Public Attributes | |
uint64_t | lastIndex |
The index of the last log entry that is being flushed. | |
bool | completed |
Used by destructor to make sure that Log::syncComplete was called. |
An interface for flushing newly appended log entries to stable storage.
Leaders do this in a separate thread, while followers and candidates do this immediately after appending the entries.
Callers should wait() on all Sync objects prior to calling truncateSuffix(). This never happens on leaders, so it's not a real limitation, but things may go wonky otherwise.
LogCabin::Storage::Log::Sync::Sync | ( | uint64_t | lastIndex | ) | [explicit] |
Reimplemented in LogCabin::Storage::SimpleFileLog::Sync.
LogCabin::Storage::Log::Sync::~Sync | ( | ) | [virtual] |
Reimplemented in LogCabin::Storage::SegmentedLog::Sync.
virtual void LogCabin::Storage::Log::Sync::wait | ( | ) | [inline, virtual] |
Wait for the log entries to be durable.
This is safe to call while the Log is being accessed and modified from a separate thread. PANICs on errors.
Reimplemented in LogCabin::Storage::SegmentedLog::Sync, and LogCabin::Storage::SimpleFileLog::Sync.
Used by destructor to make sure that Log::syncComplete was called.