12 #ifndef THRILL_API_CACHE_HEADER 13 #define THRILL_API_CACHE_HEADER 31 template <
typename ValueType>
41 template <
typename ParentDIA>
43 :
Super(parent.ctx(),
"Cache", { parent.id() }, { parent.node() }),
45 auto save_fn = [
this](
const ValueType& input) {
48 auto lop_chain = parent.stack().push(save_fn).fold();
49 parent.node()->AddChild(
this, lop_chain);
55 <<
"Cache rejected File from parent " 56 <<
"due to non-empty function stack.";
92 template <
typename ValueType,
typename Stack>
96 #if !defined(_MSC_VER) 106 tlx::make_counting<api::CacheNode<ValueType> >(*this));
112 #endif // !THRILL_API_CACHE_HEADER DIA is the interface between the user and the Thrill framework.
void PushData(bool consume) final
Virtual method for pushing data. Triggers actual pushing in sub-classes.
A File is an ordered sequence of Block objects for storing items.
void Clear()
Free all Blocks in the File and deallocate vectors.
data::File::Writer writer_
Data writer to local file (only active in PreOp).
BlockWriter contains a temporary Block object into which a) any serializable item can be stored or b)...
static constexpr bool g_debug_push_file
data::File file_
Local data file.
A DIANode is a typed node representing and operation in Thrill.
void StopPreOp(size_t) final
Virtual method for preparing end of PushData.
const bool parent_stack_empty_
Whether the parent stack is empty.
void Execute() final
Virtual execution method. Triggers actual computation in sub-classes.
DIA< ValueType > Cache() const
Create a CacheNode which contains all items of a DIA in calculated plain format.
data::File GetFile(size_t dia_id)
Returns a new File object containing a sequence of local Blocks.
bool OnPreOpFile(const data::File &file, size_t) final
void Dispose() final
Virtual clear method. Triggers actual disposing in sub-classes.
File Copy() const
Return a copy of the File (explicit copy-constructor)
CacheNode(const ParentDIA &parent)
Constructor for a LOpNode.
TLX_ATTRIBUTE_ALWAYS_INLINE BlockWriter & Put(const T &x)
Put appends a complete item, or fails with a FullException.
size_t num_items() const
Return the number of items in the file.
void Close()
Explicitly close the writer.
A DOpNode which caches all items in an external file.
Writer GetWriter(size_t block_size=default_block_size)
Get BlockWriter.
void PushFile(data::File &file, bool consume) const
Context & context_
associated Context
#define LOGC(cond)
Explicitly specify the condition for logging.