LogCabin
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Classes | Public Member Functions | Public Attributes
LogCabin::Storage::SegmentedLog::Sync Class Reference

Queues various operations on files, such as writes and fsyncs, to be executed later. More...

Inheritance diagram for LogCabin::Storage::SegmentedLog::Sync:
LogCabin::Storage::Log::Sync

List of all members.

Classes

struct  Op

Public Member Functions

 Sync (uint64_t lastIndex, std::chrono::nanoseconds diskWriteDurationThreshold)
 ~Sync ()
void updateStats (Core::RollingStat &nanos) const
 Add how long the filesystem ops took to 'nanos'.
void optimize ()
 Called at the start of wait to avoid some redundant disk flushes.
void wait ()
 Wait for the log entries to be durable.

Public Attributes

const std::chrono::nanoseconds diskWriteDurationThreshold
 If a wait() exceeds this time, log a warning.
std::deque< Opops
 List of operations to perform during wait().
TimePoint waitStart
 Time at start of wait() call.
TimePoint waitEnd
 Time at end of wait() call.

Detailed Description

Queues various operations on files, such as writes and fsyncs, to be executed later.

Definition at line 263 of file SegmentedLog.h.


Constructor & Destructor Documentation

LogCabin::Storage::SegmentedLog::Sync::Sync ( uint64_t  lastIndex,
std::chrono::nanoseconds  diskWriteDurationThreshold 
) [explicit]

Definition at line 178 of file SegmentedLog.cc.

Reimplemented from LogCabin::Storage::Log::Sync.

Definition at line 188 of file SegmentedLog.cc.


Member Function Documentation

Add how long the filesystem ops took to 'nanos'.

This is invoked from syncCompleteVirtual so that it is thread-safe with respect to the 'nanos' variable. We can't do it in 'wait' directly since that can execute concurrently with someone reading 'nanos'.

Definition at line 305 of file SegmentedLog.cc.

Called at the start of wait to avoid some redundant disk flushes.

Definition at line 193 of file SegmentedLog.cc.

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 from LogCabin::Storage::Log::Sync.

Definition at line 215 of file SegmentedLog.cc.


Member Data Documentation

If a wait() exceeds this time, log a warning.

Definition at line 309 of file SegmentedLog.h.

List of operations to perform during wait().

Definition at line 311 of file SegmentedLog.h.

Time at start of wait() call.

Definition at line 313 of file SegmentedLog.h.

Time at end of wait() call.

Definition at line 315 of file SegmentedLog.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines