Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 40 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...
 
Context & ctx_
 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

using MakeTableItem = ReduceMakeTableItem<Value, TableItem, VolatileKey>

Definition at line 46 of file reduce_by_index_post_phase.hpp.

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

Definition at line 48 of file reduce_by_index_post_phase.hpp.

using ReduceConfig = ReduceConfig_

Definition at line 45 of file reduce_by_index_post_phase.hpp.

Constructor & Destructor Documentation

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 55 of file reduce_by_index_post_phase.hpp.

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

non-copyable: delete copy-constructor

Member Function Documentation

void Dispose ( )
inline

Definition at line 250 of file reduce_by_index_post_phase.hpp.

void Initialize ( size_t  limit_memory_bytes)
inline

Definition at line 79 of file reduce_by_index_post_phase.hpp.

bool Insert ( const TableItem &  kv)
inline

Definition at line 136 of file reduce_by_index_post_phase.hpp.

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

non-copyable: delete assignment operator

TableItem reduce ( const TableItem &  a,
const TableItem &  b 
)
inlineprivate
void SetRange ( const common::Range range)
inline

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

Definition at line 74 of file reduce_by_index_post_phase.hpp.

Member Data Documentation

data::FilePtr cache_ = nullptr
private
constexpr bool debug = false
staticprivate

Definition at line 42 of file reduce_by_index_post_phase.hpp.


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