Thrill
0.1
|
Encapsulates asynchronous buffered block writing engine.
buffered_writer
overlaps I/Os with filling of output buffer.
Definition at line 37 of file buf_writer.hpp.
#include <buf_writer.hpp>
Classes | |
struct | batch_entry |
struct | batch_entry_cmp |
Public Member Functions | |
buffered_writer (size_t write_buf_size, size_t write_batch_size) | |
buffered_writer (const buffered_writer &)=delete | |
non-copyable: delete copy-constructor More... | |
~buffered_writer () | |
Flushes not yet written buffers and frees used memory. More... | |
void | flush () |
Flushes not yet written buffers. More... | |
block_type * | get_free_block () |
buffered_writer & | operator= (const buffered_writer &)=delete |
non-copyable: delete assignment operator More... | |
block_type * | write (block_type *filled_block, const bid_type &bid) |
Protected Types | |
using | batch_type = std::priority_queue< batch_entry, std::vector< batch_entry >, batch_entry_cmp > |
Protected Attributes | |
batch_type | batch_write_blocks |
std::vector< size_t > | busy_write_blocks |
std::vector< size_t > | free_write_blocks |
const size_t | nwriteblocks |
bid_type * | write_bids |
block_type * | write_buffers |
request_ptr * | write_reqs |
const size_t | writebatchsize |
Private Types | |
using | bid_type = typename block_type::bid_type |
using | block_type = BlockType |
Static Private Attributes | |
static constexpr bool | debug = false |
|
protected |
Definition at line 68 of file buf_writer.hpp.
|
private |
Definition at line 41 of file buf_writer.hpp.
|
private |
Definition at line 40 of file buf_writer.hpp.
|
inline |
Constructs an object.
write_buf_size | number of write buffers to use |
write_batch_size | number of blocks to accumulate in order to flush write requests (bulk buffered writing) |
Definition at line 76 of file buf_writer.hpp.
Referenced by buffered_writer< block_type >::buffered_writer().
|
delete |
non-copyable: delete copy-constructor
|
inline |
Flushes not yet written buffers and frees used memory.
Definition at line 194 of file buf_writer.hpp.
|
inline |
Flushes not yet written buffers.
Definition at line 164 of file buf_writer.hpp.
|
inline |
Returns free block from the internal buffer pool.
Definition at line 98 of file buf_writer.hpp.
Referenced by buf_ostream< BlockType, BidIteratorType >::buf_ostream(), and buffered_writer< block_type >::write().
|
delete |
non-copyable: delete assignment operator
Referenced by buffered_writer< block_type >::buffered_writer().
|
inline |
Submits block for writing.
filled_block | pointer to the block |
filled_block
must be value returned by get_free_block()
or write()
methods bid | block identifier, a place to write data of the filled_block |
Definition at line 137 of file buf_writer.hpp.
Referenced by buf_ostream< BlockType, BidIteratorType >::flush(), buf_ostream< BlockType, BidIteratorType >::operator++(), and buf_ostream< BlockType, BidIteratorType >::operator<<().
|
protected |
Definition at line 69 of file buf_writer.hpp.
|
protected |
Definition at line 51 of file buf_writer.hpp.
|
staticprivate |
Definition at line 39 of file buf_writer.hpp.
|
protected |
Definition at line 50 of file buf_writer.hpp.
|
protected |
Definition at line 44 of file buf_writer.hpp.
Referenced by buffered_writer< block_type >::buffered_writer(), and buffered_writer< block_type >::flush().
|
protected |
Definition at line 46 of file buf_writer.hpp.
Referenced by buffered_writer< block_type >::~buffered_writer().
|
protected |
Definition at line 45 of file buf_writer.hpp.
Referenced by buffered_writer< block_type >::write(), and buffered_writer< block_type >::~buffered_writer().
|
protected |
Definition at line 47 of file buf_writer.hpp.
Referenced by buffered_writer< block_type >::~buffered_writer().
|
protected |
Definition at line 48 of file buf_writer.hpp.
Referenced by buffered_writer< block_type >::write().