Thrill  0.1
ReduceByIndexPostPhase< TableItem, Key, Value, KeyExtractor, ReduceFunction, Emitter, VolatileKey, ReduceConfig_ > Class Template Reference

Detailed Description

template<typename TableItem, typename Key, typename Value, typename KeyExtractor, typename ReduceFunction, typename Emitter, const bool VolatileKey, typename ReduceConfig_ = DefaultReduceConfig>
class thrill::core::ReduceByIndexPostPhase< TableItem, Key, Value, KeyExtractor, ReduceFunction, Emitter, VolatileKey, ReduceConfig_ >

Definition at line 42 of file reduce_by_index_post_phase.hpp.

+ Inheritance diagram for ReduceByIndexPostPhase< TableItem, Key, Value, KeyExtractor, ReduceFunction, Emitter, VolatileKey, ReduceConfig_ >:
+ Collaboration diagram for ReduceByIndexPostPhase< TableItem, Key, Value, KeyExtractor, ReduceFunction, Emitter, VolatileKey, ReduceConfig_ >:

#include <reduce_by_index_post_phase.hpp>

Public Types

using MakeTableItem = ReduceMakeTableItem< Value, TableItem, VolatileKey >
 
using PhaseEmitter = ReducePostPhaseEmitter< TableItem, Value, Emitter, VolatileKey >
 
using ReduceConfig = ReduceConfig_
 

Public Member Functions

 ReduceByIndexPostPhase (Context &ctx, size_t dia_id, const KeyExtractor &key_extractor, const ReduceFunction &reduce_function, const Emitter &emitter, const ReduceConfig &config=ReduceConfig(), const Value &neutral_element=Value())
 A data structure which takes an arbitrary value and extracts an index using a key extractor function from that value. More...
 
 ReduceByIndexPostPhase (const ReduceByIndexPostPhase &)=delete
 non-copyable: delete copy-constructor More...
 
void Dispose ()
 
void Initialize (size_t limit_memory_bytes)
 
bool Insert (const TableItem &kv)
 
ReduceByIndexPostPhaseoperator= (const ReduceByIndexPostPhase &)=delete
 non-copyable: delete assignment operator More...
 
void PushData (bool consume=false, data::File::Writer *pwriter=nullptr)
 
void SetRange (const common::Range &range)
 Sets the range of indexes to be handled by this index table. More...
 

Private Member Functions

void Flush ()
 
template<bool DoCache = false>
void FlushAndConsume (data::File::Writer *writer=nullptr)
 
Key key (const TableItem &t)
 
TableItem reduce (const TableItem &a, const TableItem &b)
 

Private Attributes

data::FilePtr cache_ = nullptr
 File for storing data in-case we need multiple re-reduce levels. More...
 
ReduceConfig config_
 Stored reduce config to initialize the subtable. More...
 
Contextctx_
 Context. More...
 
size_t dia_id_
 Associated DIA id. More...
 
PhaseEmitter emitter_
 Emitters used to parameterize hash table for output to next DIA node. More...
 
common::Range full_range_
 
std::vector< TableItem > items_
 
KeyExtractor key_extractor_
 Key extractor function for extracting a key from a value. More...
 
size_t limit_memory_bytes_ = 0
 Size of the table in bytes. More...
 
Value neutral_element_
 neutral element to fill holes in output More...
 
bool neutral_element_index_occupied_ = false
 Is there an actual element at the index of the neutral element? More...
 
size_t neutral_element_key_ = 0
 The index where the neutral element would go if acutally inserted. More...
 
size_t num_subranges_
 number of subranges More...
 
common::Range range_
 
ReduceFunction reduce_function_
 Reduce function for reducing two values. More...
 
std::vector< data::FilePtrsubrange_files_
 Subranges external Files. More...
 
std::vector< data::File::Writersubrange_writers_
 Subranges external File Writers. More...
 
std::vector< common::Rangesubranges_
 Subranges. More...
 

Static Private Attributes

static constexpr bool debug = false
 

Member Typedef Documentation

◆ MakeTableItem

using MakeTableItem = ReduceMakeTableItem<Value, TableItem, VolatileKey>

Definition at line 48 of file reduce_by_index_post_phase.hpp.

◆ PhaseEmitter

using PhaseEmitter = ReducePostPhaseEmitter< TableItem, Value, Emitter, VolatileKey>

Definition at line 50 of file reduce_by_index_post_phase.hpp.

◆ ReduceConfig

using ReduceConfig = ReduceConfig_

Definition at line 47 of file reduce_by_index_post_phase.hpp.

Constructor & Destructor Documentation

◆ ReduceByIndexPostPhase() [1/2]

ReduceByIndexPostPhase ( Context ctx,
size_t  dia_id,
const KeyExtractor &  key_extractor,
const ReduceFunction &  reduce_function,
const Emitter &  emitter,
const ReduceConfig config = ReduceConfig(),
const Value &  neutral_element = Value() 
)
inline

A data structure which takes an arbitrary value and extracts an index using a key extractor function from that value.

Afterwards, values with the same index are merged together

Definition at line 57 of file reduce_by_index_post_phase.hpp.

Referenced by ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::ReduceByIndexPostPhase().

◆ ReduceByIndexPostPhase() [2/2]

ReduceByIndexPostPhase ( const ReduceByIndexPostPhase< TableItem, Key, Value, KeyExtractor, ReduceFunction, Emitter, VolatileKey, ReduceConfig_ > &  )
delete

non-copyable: delete copy-constructor

Member Function Documentation

◆ Dispose()

void Dispose ( )
inline

Definition at line 252 of file reduce_by_index_post_phase.hpp.

◆ Flush()

◆ FlushAndConsume()

◆ Initialize()

void Initialize ( size_t  limit_memory_bytes)
inline

Definition at line 81 of file reduce_by_index_post_phase.hpp.

◆ Insert()

bool Insert ( const TableItem &  kv)
inline

Definition at line 138 of file reduce_by_index_post_phase.hpp.

◆ key()

◆ operator=()

ReduceByIndexPostPhase& operator= ( const ReduceByIndexPostPhase< TableItem, Key, Value, KeyExtractor, ReduceFunction, Emitter, VolatileKey, ReduceConfig_ > &  )
delete

◆ PushData()

◆ reduce()

TableItem reduce ( const TableItem &  a,
const TableItem &  b 
)
inlineprivate

◆ SetRange()

void SetRange ( const common::Range range)
inline

Sets the range of indexes to be handled by this index table.

Definition at line 76 of file reduce_by_index_post_phase.hpp.

Member Data Documentation

◆ cache_

data::FilePtr cache_ = nullptr
private

◆ config_

◆ ctx_

◆ debug

constexpr bool debug = false
staticprivate

Definition at line 44 of file reduce_by_index_post_phase.hpp.

◆ dia_id_

◆ emitter_

◆ full_range_

◆ items_

◆ key_extractor_

◆ limit_memory_bytes_

◆ neutral_element_

◆ neutral_element_index_occupied_

◆ neutral_element_key_

◆ num_subranges_

◆ range_

◆ reduce_function_

◆ subrange_files_

◆ subrange_writers_

◆ subranges_


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