|
Thrill
0.1
|
Derivative BlockSink which counts and limits how many bytes it has delivered as ByteBlocks for writing.
Definition at line 110 of file block_sink.hpp.
Inheritance diagram for BoundedBlockSink:
Collaboration diagram for BoundedBlockSink:#include <block_sink.hpp>
Public Member Functions | |
| BoundedBlockSink (BlockPool &block_pool, size_t local_worker_id, size_t max_size) | |
| constructor with reference to BlockPool More... | |
| PinnedByteBlockPtr | AllocateByteBlock (size_t block_size) final |
| size_t | max_size () const |
| void | ReleaseByteBlock (ByteBlockPtr &block) final |
| Release an unused ByteBlock with n bytes backing memory. More... | |
Public Member Functions inherited from BlockSink | |
| BlockSink (BlockPool &block_pool, size_t local_worker_id) | |
| constructor with reference to BlockPool More... | |
| BlockSink (BlockPool *block_pool, size_t local_worker_id) | |
| constructor with reference to BlockPool More... | |
| BlockSink (const BlockSink &)=default | |
| default copy-constructor More... | |
| BlockSink (BlockSink &&)=default | |
| move-constructor: default More... | |
| virtual | ~BlockSink () |
| required virtual destructor More... | |
| virtual void | AppendBlock (const Block &b, bool is_last_block)=0 |
| Appends the (unpinned) Block. More... | |
| virtual void | AppendBlock (Block &&b, bool is_last_block)=0 |
| Appends the (unpinned) Block. More... | |
| virtual void | AppendPinnedBlock (PinnedBlock &&b, bool is_last_block) |
| Appends the PinnedBlock. More... | |
| BlockPool * | block_pool () const |
| Returns block_pool_. More... | |
| virtual void | Close ()=0 |
| Closes the sink. Must not be called multiple times. More... | |
| size_t | local_worker_id () const |
| local worker id to associate pinned block with More... | |
| common::JsonLogger & | logger () |
| Returns BlockPool.logger_. More... | |
| BlockSink & | operator= (const BlockSink &)=default |
| default assignment operator More... | |
| BlockSink & | operator= (BlockSink &&)=default |
| move-assignment operator: default More... | |
| size_t | workers_per_host () const |
| return number of workers per host More... | |
Static Public Attributes | |
| static constexpr bool | allocate_can_fail_ = true |
Static Public Attributes inherited from BlockSink | |
| static constexpr bool | allocate_can_fail_ = false |
Private Attributes | |
| size_t | available_ |
| currently allocated ByteBlock for this BlockSink. More... | |
| size_t | max_size_ |
| maximum allocation of ByteBlock for this BlockSink More... | |
Additional Inherited Members | |
Protected Attributes inherited from BlockSink | |
| size_t | local_worker_id_ |
| local worker id to associate pinned block with More... | |
|
inline |
constructor with reference to BlockPool
Definition at line 114 of file block_sink.hpp.
|
inlinefinalvirtual |
Allocate a ByteBlock with n bytes backing memory. If returned ByteBlockPtr is a nullptr, then memory of this BlockSink is exhausted.
Reimplemented from BlockSink.
Definition at line 119 of file block_sink.hpp.
References BlockSink::AllocateByteBlock().
|
inline |
Definition at line 131 of file block_sink.hpp.
|
inlinefinalvirtual |
Release an unused ByteBlock with n bytes backing memory.
Reimplemented from BlockSink.
Definition at line 125 of file block_sink.hpp.
|
static |
Definition at line 133 of file block_sink.hpp.
|
private |
currently allocated ByteBlock for this BlockSink.
Definition at line 140 of file block_sink.hpp.
|
private |
maximum allocation of ByteBlock for this BlockSink
Definition at line 137 of file block_sink.hpp.