Thrill
0.1
|
Definition at line 42 of file reduce_by_index_post_phase.hpp.
#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) |
ReduceByIndexPostPhase & | operator= (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::FilePtr > | subrange_files_ |
Subranges external Files. More... | |
std::vector< data::File::Writer > | subrange_writers_ |
Subranges external File Writers. More... | |
std::vector< common::Range > | subranges_ |
Subranges. More... | |
Static Private Attributes | |
static constexpr bool | debug = false |
using MakeTableItem = ReduceMakeTableItem<Value, TableItem, VolatileKey> |
Definition at line 48 of file reduce_by_index_post_phase.hpp.
using PhaseEmitter = ReducePostPhaseEmitter< TableItem, Value, Emitter, VolatileKey> |
Definition at line 50 of file reduce_by_index_post_phase.hpp.
using ReduceConfig = ReduceConfig_ |
Definition at line 47 of file reduce_by_index_post_phase.hpp.
|
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.
|
delete |
non-copyable: delete copy-constructor
|
inline |
Definition at line 252 of file reduce_by_index_post_phase.hpp.
|
inlineprivate |
|
inlineprivate |
|
inline |
Definition at line 81 of file reduce_by_index_post_phase.hpp.
|
inline |
Definition at line 138 of file reduce_by_index_post_phase.hpp.
|
inlineprivate |
Definition at line 278 of file reduce_by_index_post_phase.hpp.
Referenced by ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Initialize(), and ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Insert().
|
delete |
non-copyable: delete assignment operator
|
inline |
|
inlineprivate |
|
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.
|
private |
File for storing data in-case we need multiple re-reduce levels.
Definition at line 341 of file reduce_by_index_post_phase.hpp.
|
private |
Stored reduce config to initialize the subtable.
Definition at line 299 of file reduce_by_index_post_phase.hpp.
|
private |
Context.
Definition at line 287 of file reduce_by_index_post_phase.hpp.
Referenced by ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Initialize(), and ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::PushData().
|
staticprivate |
Definition at line 44 of file reduce_by_index_post_phase.hpp.
|
private |
Associated DIA id.
Definition at line 290 of file reduce_by_index_post_phase.hpp.
Referenced by ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Initialize(), and ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::PushData().
|
private |
Emitters used to parameterize hash table for output to next DIA node.
Definition at line 302 of file reduce_by_index_post_phase.hpp.
Referenced by ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Flush(), ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::FlushAndConsume(), and ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::PushData().
|
private |
Full range of indexes actually managed in this instance - including subranges
Definition at line 322 of file reduce_by_index_post_phase.hpp.
Referenced by ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Initialize(), ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Insert(), and ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::SetRange().
|
private |
Store for items in range of this worker. Stored in reverse order so we can consume while emitting.
Definition at line 326 of file reduce_by_index_post_phase.hpp.
Referenced by ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Dispose(), ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Flush(), ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::FlushAndConsume(), ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Initialize(), and ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Insert().
|
private |
Key extractor function for extracting a key from a value.
Definition at line 293 of file reduce_by_index_post_phase.hpp.
Referenced by ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Initialize(), ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::key(), and ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::PushData().
|
private |
Size of the table in bytes.
Definition at line 308 of file reduce_by_index_post_phase.hpp.
Referenced by ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Initialize(), and ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::PushData().
|
private |
neutral element to fill holes in output
Definition at line 305 of file reduce_by_index_post_phase.hpp.
Referenced by ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Initialize(), and ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::PushData().
|
private |
Is there an actual element at the index of the neutral element?
Definition at line 314 of file reduce_by_index_post_phase.hpp.
Referenced by ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::FlushAndConsume(), and ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Insert().
|
private |
The index where the neutral element would go if acutally inserted.
Definition at line 311 of file reduce_by_index_post_phase.hpp.
Referenced by ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Initialize(), and ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Insert().
|
private |
number of subranges
Definition at line 329 of file reduce_by_index_post_phase.hpp.
Referenced by ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Initialize(), and ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Insert().
|
private |
Range of indexes actually managed in this instance - not including subranges
Definition at line 318 of file reduce_by_index_post_phase.hpp.
Referenced by ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Initialize(), ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Insert(), and ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::SetRange().
|
private |
Reduce function for reducing two values.
Definition at line 296 of file reduce_by_index_post_phase.hpp.
Referenced by ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::PushData(), and ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::reduce().
|
private |
Subranges external Files.
Definition at line 335 of file reduce_by_index_post_phase.hpp.
Referenced by ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Dispose(), ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Initialize(), and ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::PushData().
|
private |
Subranges external File Writers.
Definition at line 338 of file reduce_by_index_post_phase.hpp.
Referenced by ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Dispose(), ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Initialize(), ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Insert(), and ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::PushData().
|
private |
Subranges.
Definition at line 332 of file reduce_by_index_post_phase.hpp.
Referenced by ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Dispose(), ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Initialize(), ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::Insert(), and ReduceByIndexPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceToIndexNode::Emitter, VolatileKey, ReduceConfig >::PushData().