class DataStreamer

Defined at line 46 of file ../../src/storage/lib/vfs/cpp/journal/data_streamer.h

A class which helps callers write streaming data operations to the underlying device.

This class provides the following value over calling "Journal::WriteData" directly:

Client-side coalescing.

This class groups together contiguous operations, only transmitting them to the writeback

subsystem once necessary.

Avoids blocking for large operations.

For operations which are larger than the underlying writeback buffer, caution must be taken to

avoid blocking on "Journal::WriteData", which creates a reservation, but does not begin

execution of the underlying data. To mitigate, this class begins execution of these data writes

if they are larger than an internal threshold (which is smaller than the entire writeback

buffer).

Allows ordering control over "all data", but not between intermediate data writes.

Typically, when data operations are issued, the caller cares that they all occur before a

following action, but the order between those data operations themselves does not matter. This

class enables callers to |Flush()| all prior data requests, without imposing an ordering on the

data requests issued by |StreamData()|.

This class is thread-compatible.

Public Methods

void StreamData (storage::UnbufferedOperation operation)

Issues |operation| to the underlying writeback subsystem (eventually).

May cache the operation locally, issuing it to the underlying writeback buffer and executor as

necessary. To identify completion, refer to |Flush()|.

Multiple invocations of |StreamData()| are not ordered with respect to each other.

Promises generated by |StreamData()| are ordered before invocations of |Flush()|.

Defined at line 26 of file ../../src/storage/lib/vfs/cpp/journal/data_streamer.cc

void DataStreamer (fs::Journal * journal, size_t writeback_capacity)

Defined at line 48 of file ../../src/storage/lib/vfs/cpp/journal/data_streamer.h

fs::Journal::Promise Flush ()

Ensures all operations sent to |StreamData| are issued to the executor, and returns a promise

representing when all those writes have completed.

Defined at line 48 of file ../../src/storage/lib/vfs/cpp/journal/data_streamer.cc

void IssueOperations ()

Issues locally buffered operations to the executor, and track the resulting promise in

|promises_|. The completion of all issued operations can be achieved by invoking |Flush()|.

Defined at line 69 of file ../../src/storage/lib/vfs/cpp/journal/data_streamer.cc