Thrill
0.1
|
A BlockSource to read Blocks from a BlockQueue using a BlockReader, and at the same time CACHE all items received.
All Blocks read from the BlockQueue are saved in the cache File. If the cache BlockQueue is initially already closed, then Blocks are read from the File instead.
Definition at line 261 of file block_queue.hpp.
#include <block_queue.hpp>
Public Member Functions | |
CacheBlockQueueSource (BlockQueue *queue, size_t local_worker_id) | |
Start reading from a BlockQueue. More... | |
CacheBlockQueueSource (const CacheBlockQueueSource &)=delete | |
non-copyable: delete copy-constructor More... | |
CacheBlockQueueSource (CacheBlockQueueSource &&s) | |
move-constructor: default More... | |
~CacheBlockQueueSource () | |
Consume remaining blocks and cache them in the File. More... | |
PinnedBlock | NextBlock () |
Return next block for BlockQueue, store into caching File and return it. More... | |
CacheBlockQueueSource & | operator= (const CacheBlockQueueSource &)=delete |
non-copyable: delete assignment operator More... | |
void | Prefetch (size_t) |
Private Attributes | |
size_t | local_worker_id_ |
local worker id of the thread reading the BlockQueue More... | |
BlockQueue * | queue_ |
Reference to BlockQueue. More... | |
Static Private Attributes | |
static constexpr bool | debug = BlockQueue::debug |
|
explicit |
Start reading from a BlockQueue.
Definition at line 111 of file block_queue.cpp.
|
delete |
non-copyable: delete copy-constructor
move-constructor: default
Definition at line 115 of file block_queue.cpp.
Consume remaining blocks and cache them in the File.
Definition at line 139 of file block_queue.cpp.
References PinnedBlock::IsValid(), CacheBlockQueueSource::NextBlock(), CacheBlockQueueSource::queue_, and BlockQueue::read_closed().
PinnedBlock NextBlock | ( | ) |
Return next block for BlockQueue, store into caching File and return it.
Definition at line 124 of file block_queue.cpp.
References File::AppendBlock(), BlockQueue::file_, CacheBlockQueueSource::local_worker_id_, LOG, PinnedBlock::PinWait(), BlockQueue::Pop(), CacheBlockQueueSource::queue_, and BlockQueue::read_closed().
Referenced by CacheBlockQueueSource::~CacheBlockQueueSource().
|
delete |
non-copyable: delete assignment operator
void Prefetch | ( | size_t | ) |
Definition at line 120 of file block_queue.cpp.
|
staticprivate |
Definition at line 263 of file block_queue.hpp.
|
private |
local worker id of the thread reading the BlockQueue
Definition at line 289 of file block_queue.hpp.
Referenced by CacheBlockQueueSource::NextBlock().
|
private |
Reference to BlockQueue.
Definition at line 286 of file block_queue.hpp.
Referenced by CacheBlockQueueSource::NextBlock(), and CacheBlockQueueSource::~CacheBlockQueueSource().