Thrill  0.1
CacheBlockQueueSource Class Reference

Detailed Description

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.

+ Collaboration diagram for CacheBlockQueueSource:

#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...
 
CacheBlockQueueSourceoperator= (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...
 
BlockQueuequeue_
 Reference to BlockQueue. More...
 

Static Private Attributes

static constexpr bool debug = BlockQueue::debug
 

Constructor & Destructor Documentation

◆ CacheBlockQueueSource() [1/3]

CacheBlockQueueSource ( BlockQueue queue,
size_t  local_worker_id 
)
explicit

Start reading from a BlockQueue.

Definition at line 111 of file block_queue.cpp.

◆ CacheBlockQueueSource() [2/3]

non-copyable: delete copy-constructor

◆ CacheBlockQueueSource() [3/3]

move-constructor: default

Definition at line 115 of file block_queue.cpp.

◆ ~CacheBlockQueueSource()

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().

Member Function Documentation

◆ NextBlock()

◆ operator=()

CacheBlockQueueSource& operator= ( const CacheBlockQueueSource )
delete

non-copyable: delete assignment operator

◆ Prefetch()

void Prefetch ( size_t  )

Definition at line 120 of file block_queue.cpp.

Member Data Documentation

◆ debug

constexpr bool debug = BlockQueue::debug
staticprivate

Definition at line 263 of file block_queue.hpp.

◆ local_worker_id_

size_t local_worker_id_
private

local worker id of the thread reading the BlockQueue

Definition at line 289 of file block_queue.hpp.

Referenced by CacheBlockQueueSource::NextBlock().

◆ queue_

BlockQueue* queue_
private

The documentation for this class was generated from the following files: