Turi Create
4.0
|
#include <core/storage/fileio/buffered_writer.hpp>
Public Member Functions | |
void | write (const ValueType &val) |
void | flush (bool is_locked=false) |
Provide buffered write abstraction. The class manages buffered concurrent write to an output iterator.
Example:
Suppose there are M data sources randomly flow to N sinks. We can use buffered_writer to achieve efficient concurrent write.
Two parameters "soft_limit" and "hard_limit" are used to control the buffer size. When soft_limit is met, the writer will try to flush the buffer content to the sink. When hard_limit is met, the writer will force the flush.
Definition at line 47 of file buffered_writer.hpp.
|
inline |
Flush the buffer to the output sink. Clear the buffer when finished.
Definition at line 87 of file buffered_writer.hpp.
|
inline |
Write the value to the buffer. Try flush when buffer exceeds soft limit and force flush when buffer exceeds hard limit.
Definition at line 63 of file buffered_writer.hpp.