Thrill  0.1
DiscardSink Class Referencefinal

Detailed Description

DiscardSink is an BlockSink that discards all Blocks delivered to it.

Use it for benchmarking!

Definition at line 29 of file discard_sink.hpp.

+ Inheritance diagram for DiscardSink:
+ Collaboration diagram for DiscardSink:

#include <discard_sink.hpp>

Public Member Functions

 DiscardSink (BlockPool &block_pool, size_t local_worker_id)
 Create discarding BlockSink. More...
 
void AppendBlock (const Block &, bool) final
 Discards a Block. More...
 
void AppendBlock (Block &&, bool) final
 Discards a Block. More...
 
void Close () final
 Closes the sink. More...
 
bool closed () const
 return close flag 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 PinnedByteBlockPtr AllocateByteBlock (size_t block_size)
 
virtual void AppendPinnedBlock (PinnedBlock &&b, bool is_last_block)
 Appends the PinnedBlock. More...
 
BlockPoolblock_pool () const
 Returns block_pool_. More...
 
size_t local_worker_id () const
 local worker id to associate pinned block with More...
 
common::JsonLoggerlogger ()
 Returns BlockPool.logger_. More...
 
BlockSinkoperator= (const BlockSink &)=default
 default assignment operator More...
 
BlockSinkoperator= (BlockSink &&)=default
 move-assignment operator: default More...
 
virtual void ReleaseByteBlock (ByteBlockPtr &block)
 Release an unused ByteBlock with n bytes backing memory. More...
 
size_t workers_per_host () const
 return number of workers per host More...
 

Static Public Attributes

static constexpr bool allocate_can_fail_ = false
 
- Static Public Attributes inherited from BlockSink
static constexpr bool allocate_can_fail_ = false
 

Private Attributes

bool closed_ = false
 

Additional Inherited Members

- Protected Attributes inherited from BlockSink
size_t local_worker_id_
 local worker id to associate pinned block with More...
 

Constructor & Destructor Documentation

◆ DiscardSink()

DiscardSink ( BlockPool block_pool,
size_t  local_worker_id 
)
inlineexplicit

Create discarding BlockSink.

Definition at line 33 of file discard_sink.hpp.

Member Function Documentation

◆ AppendBlock() [1/2]

void AppendBlock ( const Block ,
bool   
)
inlinefinalvirtual

Discards a Block.

Implements BlockSink.

Definition at line 38 of file discard_sink.hpp.

◆ AppendBlock() [2/2]

void AppendBlock ( Block &&  ,
bool   
)
inlinefinalvirtual

Discards a Block.

Implements BlockSink.

Definition at line 41 of file discard_sink.hpp.

◆ Close()

void Close ( )
inlinefinalvirtual

Closes the sink.

Implements BlockSink.

Definition at line 44 of file discard_sink.hpp.

References DiscardSink::closed_.

◆ closed()

bool closed ( ) const
inline

return close flag

Definition at line 50 of file discard_sink.hpp.

References DiscardSink::closed_.

Member Data Documentation

◆ allocate_can_fail_

constexpr bool allocate_can_fail_ = false
static

boolean flag whether to check if AllocateByteBlock can fail in any subclass (if false: accelerate BlockWriter to not be able to cope with nullptr).

Definition at line 55 of file discard_sink.hpp.

◆ closed_

bool closed_ = false
private

Definition at line 58 of file discard_sink.hpp.

Referenced by DiscardSink::Close(), and DiscardSink::closed().


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