ModErn Text Analysis
META Enumerates Textual Applications
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
meta::index::chunk_handler< Index >::producer Class Reference

The object that is fed postings_data by the index. More...

#include <chunk_handler.h>

Public Member Functions

 producer (chunk_handler *parent)
 
template<class Container >
void operator() (const secondary_key_type &key, const Container &counts)
 Handler for when a given secondary_key has been processed and is ready to be added to the in-memory chunk. More...
 
 ~producer ()
 Destroys the producer, writing to disk any chunk data still resident in memory.
 

Private Member Functions

void flush_chunk ()
 Flushes the current in-memory chunk to disk.
 

Private Attributes

std::unordered_set< index_pdata_type > pdata_
 Current in-memory chunk.
 
uint64_t chunk_size_
 Current size of the in-memory chunk.
 
chunk_handlerparent_
 Back-pointer to the handler this producer is operating on.
 

Static Private Attributes

static const uint64_t constexpr max_size = 1024 * 1024 * 128
 Maximum allowed size of a chunk in bytes before it is written.
 

Detailed Description

template<class Index>
class meta::index::chunk_handler< Index >::producer

The object that is fed postings_data by the index.

Constructor & Destructor Documentation

template<class Index >
meta::index::chunk_handler< Index >::producer::producer ( chunk_handler parent)
Parameters
parentA back-pointer to the handler this producer is operating on

Member Function Documentation

template<class Index >
template<class Container >
void meta::index::chunk_handler< Index >::producer::operator() ( const secondary_key_type &  key,
const Container &  counts 
)

Handler for when a given secondary_key has been processed and is ready to be added to the in-memory chunk.

Parameters
keyThe secondary key used to index the counts container
countsA collection of (primary_key_type, count) pairs

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