16 #ifndef IMPALA_SERVICE_PLAN_EXECUTOR_H
17 #define IMPALA_SERVICE_PLAN_EXECUTOR_H
20 #include <boost/scoped_ptr.hpp>
21 #include <boost/shared_ptr.hpp>
22 #include <boost/function.hpp>
40 class TPlanExecRequest;
42 class TPlanFragmentExecParams;
43 class TPlanExecParams;
72 typedef boost::function<
void UpdateStatus(const Status &status)
boost::scoped_ptr< RowBatch > row_batch_
Status GetNextInternal(RowBatch **batch)
RuntimeProfile::TimeSeriesCounter * thread_usage_sampled_counter_
Sampled thread usage (tokens) at even time intervals.
void FragmentComplete()
Called when the fragment execution is complete to finalize counters.
RuntimeProfile::Counter * per_host_mem_usage_
const RowDescriptor & row_desc()
MonotonicStopWatch fragment_sw_
Stopwatch for this entire fragment. Started in Prepare(), stopped in Close().
RuntimeProfile::Counter * average_thread_tokens_
bool report_thread_active_
const DescriptorTbl & desc_tbl()
boost::condition_variable stop_report_thread_cv_
void OptimizeLlvmModule()
void Cancel()
Initiate cancellation. Must not be called until after Prepare() returned.
boost::condition_variable report_thread_started_cv_
boost::scoped_ptr< TRowBatch > thrift_batch_
ReportStatusCallback report_status_cb_
profile reporting-related
Status Prepare(const TExecPlanFragmentParams &request)
RuntimeProfile * profile()
Profile information for plan and output sink.
void ReleaseThreadToken()
Releases the thread token for this fragment executor.
bool closed_
true if Close() has been called
boost::scoped_ptr< DataSink > sink_
void PrintVolumeIds(const TPlanExecParams ¶ms)
Print stats about scan ranges for each volumeId in params to info log.
boost::mutex report_thread_lock_
PlanFragmentExecutor(ExecEnv *exec_env, const ReportStatusCallback &report_status_cb)
boost::scoped_ptr< RuntimeState > runtime_state_
AtomicInt< int > completed_report_sent_
RuntimeProfile::Counter * rows_produced_counter_
Number of rows returned by this fragment.
void SendReport(bool done)
RuntimeState * runtime_state()
call these only after Prepare()
std::map< TPlanNodeId, std::vector< TScanRangeParams > > PerNodeScanRanges
typedef for TPlanFragmentExecParams.per_node_scan_ranges
boost::function< void(const Status &status, RuntimeProfile *profile, bool done)> ReportStatusCallback
boost::mutex status_lock_
bool ReachedLimit()
Returns true if this query has a limit and it has been reached.
RuntimeProfile::TimeSeriesCounter * mem_usage_sampled_counter_
Sampled memory usage at even time intervals.
bool done_
true if plan_->GetNext() indicated that it's done
static const std::string PER_HOST_PEAK_MEM_COUNTER
Name of the counter that is tracking per query, per host peak mem usage.
bool prepared_
true if Prepare() returned OK
Status GetNext(RowBatch **batch)
boost::scoped_ptr< Thread > report_thread_
bool has_thread_token_
true if this fragment has not returned the thread token to the thread resource mgr ...