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

Detailed Description

template<typename TableItem, typename Key, typename Value, typename KeyExtractor, typename ReduceFunction, typename Emitter, const bool VolatileKey, typename ReduceConfig_ = DefaultReduceConfig, typename IndexFunction = ReduceByHash<Key>, typename KeyEqualFunction = std::equal_to<Key>>
class thrill::core::ReduceByHashPostPhase< TableItem, Key, Value, KeyExtractor, ReduceFunction, Emitter, VolatileKey, ReduceConfig_, IndexFunction, KeyEqualFunction >

Definition at line 44 of file reduce_by_hash_post_phase.hpp.

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

#include <reduce_by_hash_post_phase.hpp>

Public Types

using PhaseEmitter = ReducePostPhaseEmitter< TableItem, Value, Emitter, VolatileKey >
 
using ReduceConfig = ReduceConfig_
 
using Table = typename ReduceTableSelect< ReduceConfig::table_impl_, TableItem, Key, Value, KeyExtractor, ReduceFunction, PhaseEmitter, VolatileKey, ReduceConfig, IndexFunction, KeyEqualFunction >::type
 

Public Member Functions

 ReduceByHashPostPhase (Context &ctx, size_t dia_id, const KeyExtractor &key_extractor, const ReduceFunction &reduce_function, const Emitter &emit, const ReduceConfig &config=ReduceConfig(), const IndexFunction &index_function=IndexFunction(), const KeyEqualFunction &key_equal_function=KeyEqualFunction())
 A data structure which takes an arbitrary value and extracts a key using a key extractor function from that value. More...
 
 ReduceByHashPostPhase (const ReduceByHashPostPhase &)=delete
 non-copyable: delete copy-constructor More...
 
void Dispose ()
 
template<bool DoCache>
void Flush (bool consume, data::File::Writer *writer=nullptr)
 Flushes all items in the whole table. More...
 
void Initialize (size_t limit_memory_bytes)
 
bool Insert (const TableItem &kv)
 
ReduceByHashPostPhaseoperator= (const ReduceByHashPostPhase &)=delete
 non-copyable: delete assignment operator More...
 
void PushData (bool consume=false)
 Push data into emitter. More...
 
Accessors
Tabletable ()
 Returns mutable reference to first table_. More...
 
size_t num_items () const
 Returns the total num of items in the table. More...
 

Private Attributes

data::FilePtr cache_
 File for storing data in-case we need multiple re-reduce levels. More...
 
ReduceConfig config_
 Stored reduce config to initialize the subtable. More...
 
PhaseEmitter emitter_
 Emitters used to parameterize hash table for output to next DIA node. More...
 
Table table_
 the first-level hash table implementation More...
 

Static Private Attributes

static constexpr bool debug = false
 

Member Typedef Documentation

◆ PhaseEmitter

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

Definition at line 51 of file reduce_by_hash_post_phase.hpp.

◆ ReduceConfig

using ReduceConfig = ReduceConfig_

Definition at line 49 of file reduce_by_hash_post_phase.hpp.

◆ Table

using Table = typename ReduceTableSelect< ReduceConfig::table_impl_, TableItem, Key, Value, KeyExtractor, ReduceFunction, PhaseEmitter, VolatileKey, ReduceConfig, IndexFunction, KeyEqualFunction>::type

Definition at line 58 of file reduce_by_hash_post_phase.hpp.

Constructor & Destructor Documentation

◆ ReduceByHashPostPhase() [1/2]

ReduceByHashPostPhase ( Context ctx,
size_t  dia_id,
const KeyExtractor &  key_extractor,
const ReduceFunction &  reduce_function,
const Emitter &  emit,
const ReduceConfig config = ReduceConfig(),
const IndexFunction &  index_function = IndexFunction(),
const KeyEqualFunction &  key_equal_function = KeyEqualFunction() 
)
inline

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

Afterwards, the value is hashed based on the key into some slot.

Definition at line 65 of file reduce_by_hash_post_phase.hpp.

Referenced by ReduceByHashPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceNode::Emitter, VolatileKey, ReduceConfig, thrill::core::ReduceByHash, KeyEqualFunction >::ReduceByHashPostPhase().

◆ ReduceByHashPostPhase() [2/2]

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

non-copyable: delete copy-constructor

Member Function Documentation

◆ Dispose()

void Dispose ( )
inline

Definition at line 253 of file reduce_by_hash_post_phase.hpp.

◆ Flush()

◆ Initialize()

void Initialize ( size_t  limit_memory_bytes)
inline

Definition at line 86 of file reduce_by_hash_post_phase.hpp.

◆ Insert()

bool Insert ( const TableItem &  kv)
inline

Definition at line 90 of file reduce_by_hash_post_phase.hpp.

◆ num_items()

size_t num_items ( ) const
inline

Returns the total num of items in the table.

Definition at line 265 of file reduce_by_hash_post_phase.hpp.

◆ operator=()

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

◆ PushData()

void PushData ( bool  consume = false)
inline

Push data into emitter.

Definition at line 228 of file reduce_by_hash_post_phase.hpp.

◆ table()

Table& table ( )
inline

Returns mutable reference to first table_.

Definition at line 262 of file reduce_by_hash_post_phase.hpp.

Member Data Documentation

◆ cache_

◆ config_

◆ debug

constexpr bool debug = false
staticprivate

Definition at line 46 of file reduce_by_hash_post_phase.hpp.

◆ emitter_

◆ table_

Table table_
private

the first-level hash table implementation

Definition at line 277 of file reduce_by_hash_post_phase.hpp.

Referenced by ReduceByHashPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceNode::Emitter, VolatileKey, ReduceConfig, thrill::core::ReduceByHash, KeyEqualFunction >::Dispose(), ReduceByHashPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceNode::Emitter, VolatileKey, ReduceConfig, thrill::core::ReduceByHash, KeyEqualFunction >::Flush(), ReduceByHashPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceNode::Emitter, VolatileKey, ReduceConfig, thrill::core::ReduceByHash, KeyEqualFunction >::Initialize(), ReduceByHashPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceNode::Emitter, VolatileKey, ReduceConfig, thrill::core::ReduceByHash, KeyEqualFunction >::Insert(), ReduceByHashPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceNode::Emitter, VolatileKey, ReduceConfig, thrill::core::ReduceByHash, KeyEqualFunction >::num_items(), ReduceByHashPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceNode::Emitter, VolatileKey, ReduceConfig, thrill::core::ReduceByHash, KeyEqualFunction >::PushData(), and ReduceByHashPostPhase< TableItem, Key, ValueType, KeyExtractor, ReduceFunction, thrill::api::ReduceNode::Emitter, VolatileKey, ReduceConfig, thrill::core::ReduceByHash, KeyEqualFunction >::table().


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