Classes | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
mr3::OperatorExecutor Class Referenceabstract

Base class for operator executors. More...

#include <operator_executor.h>

+ Inheritance diagram for mr3::OperatorExecutor:
+ Collaboration diagram for mr3::OperatorExecutor:

Classes

struct  PerIoStruct
 

Public Member Functions

 OperatorExecutor (util::IoContextPool *pool, Runner *runner)
 
void Init (const RawContext::FreqMapRegistry &prev_maps)
 
virtual void Run (const std::vector< const InputBase * > &inputs, detail::TableBase *ss, ShardFileMap *out_files)=0
 
virtual void Stop ()=0
 
const RawContext::FreqMapRegistry & GetFreqMaps () const
 
const MetricMap & GetCounterMap () const
 

Protected Member Functions

void RegisterContext (RawContext *context)
 
void FinalizeContext (RawContext *context)
 Called from all IO threads once they finished running the operator.
 
util::VarzValue::Map GetStats ()
 
virtual void InitInternal ()=0
 

Static Protected Member Functions

static void SetFileName (bool is_binary, const std::string &file_name, RawContext *context)
 
static void SetMetaData (const pb::Input::FileSpec &fs, RawContext *context)
 
static void SetPosition (size_t pos, RawContext *context)
 
static void SetCurrentShard (ShardId shard, RawContext *context)
 

Protected Attributes

util::IoContextPoolpool_
 
Runnerrunner_
 
MetricMap metric_map_
 
std::atomic< uint64_t > parse_errors_ {0}
 
RawContext::FreqMapRegistry freq_maps_
 
const RawContext::FreqMapRegistry * finalized_maps_
 

Static Protected Attributes

static thread_local std::unique_ptr< PerIoStructper_io_
 

Detailed Description

Base class for operator executors.

Author
Roman Gershman

OperatorExecutor derives from std::enable_shared_from_this<> to allow flexible ownership semantics when passing its objects between asynchronous callbacks.

Definition at line 27 of file operator_executor.h.

Member Data Documentation

◆ metric_map_

MetricMap mr3::OperatorExecutor::metric_map_
protected

I keep it as std::map to print counters in lexicographic order. Performance is negligible since it's used only for final aggregation.

Definition at line 88 of file operator_executor.h.


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