Thrill  0.1
WriteBinaryNode< ValueType >::SysFileSink Class Referencefinal

Detailed Description

template<typename ValueType>
class thrill::api::WriteBinaryNode< ValueType >::SysFileSink

Implements BlockSink class writing to files with size limit.

Definition at line 110 of file write_binary.hpp.

+ Inheritance diagram for WriteBinaryNode< ValueType >::SysFileSink:
+ Collaboration diagram for WriteBinaryNode< ValueType >::SysFileSink:

Public Member Functions

 SysFileSink (api::Context &context, size_t local_worker_id, const std::string &path, size_t max_file_size, size_t &stats_total_elements, size_t &stats_total_writes)
 
void AppendBlock (const data::Block &block, bool is_last_block)
 Appends the (unpinned) Block. More...
 
void AppendBlock (data::Block &&block, bool is_last_block)
 Appends the (unpinned) Block. More...
 
void AppendPinnedBlock (data::PinnedBlock &&b, bool) final
 Appends the PinnedBlock. More...
 
void Close () final
 Closes the sink. Must not be called multiple times. More...
 
- Public Member Functions inherited from BoundedBlockSink
 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...
 
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...
 
size_t workers_per_host () const
 return number of workers per host More...
 

Private Attributes

size_t & stats_total_elements_
 
size_t & stats_total_writes_
 
vfs::WriteStreamPtr stream_
 

Additional Inherited Members

- Static Public Attributes inherited from BoundedBlockSink
static constexpr bool allocate_can_fail_ = true
 
- Static Public Attributes inherited from BlockSink
static constexpr bool allocate_can_fail_ = false
 
- Protected Attributes inherited from BlockSink
size_t local_worker_id_
 local worker id to associate pinned block with More...
 

Constructor & Destructor Documentation

◆ SysFileSink()

SysFileSink ( api::Context context,
size_t  local_worker_id,
const std::string &  path,
size_t  max_file_size,
size_t &  stats_total_elements,
size_t &  stats_total_writes 
)
inline

Definition at line 113 of file write_binary.hpp.

Referenced by WriteBinaryNode< ValueType >::OpenNextFile().

Member Function Documentation

◆ AppendBlock() [1/2]

void AppendBlock ( const data::Block b,
bool  is_last_block 
)
inlinevirtual

Appends the (unpinned) Block.

Implements BlockSink.

Definition at line 131 of file write_binary.hpp.

References WriteBinaryNode< ValueType >::SysFileSink::AppendPinnedBlock(), BlockSink::local_worker_id(), and Block::PinWait().

◆ AppendBlock() [2/2]

void AppendBlock ( data::Block &&  b,
bool  is_last_block 
)
inlinevirtual

Appends the (unpinned) Block.

Implements BlockSink.

Definition at line 136 of file write_binary.hpp.

References WriteBinaryNode< ValueType >::SysFileSink::AppendPinnedBlock(), and BlockSink::local_worker_id().

◆ AppendPinnedBlock()

void AppendPinnedBlock ( data::PinnedBlock &&  b,
bool  is_last_block 
)
inlinefinalvirtual

◆ Close()

void Close ( )
inlinefinalvirtual

Closes the sink. Must not be called multiple times.

Implements BlockSink.

Definition at line 141 of file write_binary.hpp.

References WriteBinaryNode< ValueType >::SysFileSink::stream_.

Member Data Documentation

◆ stats_total_elements_

size_t& stats_total_elements_
private

Definition at line 147 of file write_binary.hpp.

Referenced by WriteBinaryNode< ValueType >::OpenNextFile().

◆ stats_total_writes_

size_t& stats_total_writes_
private

◆ stream_


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