rippled
|
Batch-writing assist logic. More...
Classes | |
struct | Callback |
This callback does the actual writing. More... | |
Public Member Functions | |
BatchWriter (Callback &callback, Scheduler &scheduler) | |
Create a batch writer. More... | |
~BatchWriter () | |
Destroy a batch writer. More... | |
void | store (std::shared_ptr< NodeObject > const &object) |
Store the object. More... | |
int | getWriteLoad () |
Get an estimate of the amount of writing I/O pending. More... | |
Private Types | |
using | LockType = std::recursive_mutex |
using | CondvarType = std::condition_variable_any |
Private Member Functions | |
void | performScheduledTask () override |
Performs the task. More... | |
void | writeBatch () |
void | waitForWriting () |
Private Attributes | |
Callback & | m_callback |
Scheduler & | m_scheduler |
LockType | mWriteMutex |
CondvarType | mWriteCondition |
int | mWriteLoad |
bool | mWritePending |
Batch | mWriteSet |
Batch-writing assist logic.
The batch writes are performed with a scheduled task. Use of the class it not required. A backend can implement its own write batching, or skip write batching if doing so yields a performance benefit.
Definition at line 40 of file BatchWriter.h.
|
private |
Definition at line 86 of file BatchWriter.h.
Definition at line 87 of file BatchWriter.h.
Create a batch writer.
Definition at line 25 of file BatchWriter.cpp.
ripple::NodeStore::BatchWriter::~BatchWriter | ( | ) |
Destroy a batch writer.
Anything pending in the batch is written out before this returns.
Definition at line 34 of file BatchWriter.cpp.
void ripple::NodeStore::BatchWriter::store | ( | std::shared_ptr< NodeObject > const & | object | ) |
Store the object.
This will add to the batch and initiate a scheduled task to write the batch out.
Definition at line 40 of file BatchWriter.cpp.
int ripple::NodeStore::BatchWriter::getWriteLoad | ( | ) |
Get an estimate of the amount of writing I/O pending.
Definition at line 60 of file BatchWriter.cpp.
|
overrideprivatevirtual |
Performs the task.
The call may take place on a foreign thread.
Implements ripple::NodeStore::Task.
Definition at line 68 of file BatchWriter.cpp.
|
private |
Definition at line 74 of file BatchWriter.cpp.
|
private |
Definition at line 113 of file BatchWriter.cpp.
|
private |
Definition at line 89 of file BatchWriter.h.
|
private |
Definition at line 90 of file BatchWriter.h.
|
private |
Definition at line 91 of file BatchWriter.h.
|
private |
Definition at line 92 of file BatchWriter.h.
|
private |
Definition at line 93 of file BatchWriter.h.
|
private |
Definition at line 94 of file BatchWriter.h.
|
private |
Definition at line 95 of file BatchWriter.h.