16 #ifndef IMPALA_EXEC_EXEC_NODE_H
17 #define IMPALA_EXEC_EXEC_NODE_H
26 #include "gen-cpp/PlanNodes_types.h"
122 TDebugAction::type action,
ExecNode* tree);
126 void CollectNodes(TPlanNodeType::type node_type, std::vector<ExecNode*>* nodes);
140 const char*
name =
"EvalConjuncts");
151 virtual void DebugString(
int indentation_level, std::stringstream* out)
const;
void AddRuntimeExecOption(const std::string &option)
Appends option to 'runtime_exec_options_'.
void CollectNodes(TPlanNodeType::type node_type, std::vector< ExecNode * > *nodes)
void CollectScanNodes(std::vector< ExecNode * > *nodes)
Collect all scan node types.
int64_t num_rows_returned_
std::vector< ExprContext * > expr_ctxs_to_free_
Expr contexts whose local allocations are safe to free in the main execution thread.
MemTracker * mem_tracker()
static int GetNodeIdFromProfile(RuntimeProfile *p)
Extract node id from p->name().
boost::scoped_ptr< RuntimeProfile > runtime_profile_
boost::scoped_ptr< MemTracker > expr_mem_tracker_
MemTracker that should be used for ExprContexts.
void InitRuntimeProfile(const std::string &name)
virtual Status Init(const TPlanNode &tnode)
RowDescriptor row_descriptor_
static Status CreateTree(ObjectPool *pool, const TPlan &plan, const DescriptorTbl &descs, ExecNode **root)
const RowDescriptor & row_desc() const
RowBatchQueue(int max_batches)
Status ExecDebugAction(TExecNodePhase::type phase, RuntimeState *state)
const std::vector< ExprContext * > & conjunct_ctxs() const
void AddExprCtxToFree(ExprContext *ctx)
boost::mutex exec_options_lock_
TPlanNodeType::type type() const
ExecNode(ObjectPool *pool, const TPlanNode &tnode, const DescriptorTbl &descs)
Init conjuncts.
std::string DebugString() const
Returns a string representation in DFS order of the plan rooted at this.
Superclass of all data sinks.
MemTracker * expr_mem_tracker()
static llvm::Function * CodegenEvalConjuncts(RuntimeState *state, const std::vector< ExprContext * > &conjunct_ctxs, const char *name="EvalConjuncts")
virtual bool IsScanNode() const
TExecNodePhase::type debug_phase_
virtual Status Prepare(RuntimeState *state)
static Status CreateNode(ObjectPool *pool, const TPlanNode &tnode, const DescriptorTbl &descs, ExecNode **node)
Create a single exec node derived from thrift node; place exec node in 'pool'.
void AddExprCtxsToFree(const std::vector< ExprContext * > &ctxs)
virtual Status QueryMaintenance(RuntimeState *state)
TDebugAction::type debug_action_
static const std::string ROW_THROUGHPUT_COUNTER
Names of counters shared by all exec nodes.
static Status CreateTreeHelper(ObjectPool *pool, const std::vector< TPlanNode > &tnodes, const DescriptorTbl &descs, ExecNode *parent, int *node_idx, ExecNode **root)
This class is thread-safe.
std::vector< ExecNode * > children_
int64_t rows_returned() const
RuntimeProfile::Counter * rows_returned_counter_
SpinLock lock_
Lock protecting cleanup_queue_.
boost::scoped_ptr< MemTracker > mem_tracker_
Account for peak memory used by this node.
TPlanNodeType::type type_
std::list< RowBatch * > cleanup_queue_
Queue of orphaned row batches.
static bool EvalConjuncts(ExprContext *const *ctxs, int num_ctxs, TupleRow *row)
void AddBatch(RowBatch *batch)
Adds a batch to the queue. This is blocking if the queue is full.
virtual Status Open(RuntimeState *state)
std::string runtime_exec_options_
std::vector< ExprContext * > conjunct_ctxs_
virtual void Close(RuntimeState *state)
static void SetDebugOptions(int node_id, TExecNodePhase::type phase, TDebugAction::type action, ExecNode *tree)
Set debug action for node with given id in 'tree'.
virtual Status GetNext(RuntimeState *state, RowBatch *row_batch, bool *eos)=0
RuntimeProfile::Counter * rows_returned_rate_
virtual Status Reset(RuntimeState *state)
RuntimeProfile * runtime_profile()