Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
impala::FragmentMgr::FragmentExecState Class Reference

Execution state of a single plan fragment. More...

#include <fragment-exec-state.h>

Collaboration diagram for impala::FragmentMgr::FragmentExecState:

Public Member Functions

 FragmentExecState (const TPlanFragmentInstanceCtx &fragment_instance_ctx, ExecEnv *exec_env)
 
 ~FragmentExecState ()
 
Status Cancel ()
 
Status Prepare (const TExecPlanFragmentParams &exec_params)
 Call Prepare() and create and initialize data sink. More...
 
void Exec ()
 Main loop of plan fragment execution. Blocks until execution finishes. More...
 
const TUniqueId & query_id () const
 
const TUniqueId & fragment_instance_id () const
 
const TNetworkAddress & coord_address () const
 
void set_exec_thread (Thread *exec_thread)
 Set the execution thread, taking ownership of the object. More...
 

Private Member Functions

void ReportStatusCb (const Status &status, RuntimeProfile *profile, bool done)
 
Status UpdateStatus (const Status &status)
 

Private Attributes

TPlanFragmentInstanceCtx fragment_instance_ctx_
 
PlanFragmentExecutor executor_
 
ImpalaInternalServiceClientCacheclient_cache_
 
TExecPlanFragmentParams exec_params_
 
boost::scoped_ptr< Threadexec_thread_
 the thread executing this plan fragment More...
 
boost::mutex status_lock_
 protects exec_status_ More...
 
Status exec_status_
 

Detailed Description

Execution state of a single plan fragment.

Definition at line 29 of file fragment-exec-state.h.

Constructor & Destructor Documentation

impala::FragmentMgr::FragmentExecState::FragmentExecState ( const TPlanFragmentInstanceCtx &  fragment_instance_ctx,
ExecEnv exec_env 
)
inline

Definition at line 31 of file fragment-exec-state.h.

impala::FragmentMgr::FragmentExecState::~FragmentExecState ( )
inline

Calling the d'tor releases all memory and closes all data streams held by executor_.

Definition at line 42 of file fragment-exec-state.h.

Member Function Documentation

Status FragmentMgr::FragmentExecState::Cancel ( )

Returns current execution status, if there was an error. Otherwise cancels the fragment and returns OK.

Definition at line 34 of file fragment-exec-state.cc.

References impala::executor_, impala::OK, and RETURN_IF_ERROR.

const TNetworkAddress& impala::FragmentMgr::FragmentExecState::coord_address ( ) const
inline

Definition at line 62 of file fragment-exec-state.h.

References fragment_instance_ctx_.

void FragmentMgr::FragmentExecState::Exec ( )

Main loop of plan fragment execution. Blocks until execution finishes.

Definition at line 48 of file fragment-exec-state.cc.

References impala::ImpaladQueryExecutor::Close(), and impala::executor_.

Referenced by impala::FragmentMgr::FragmentExecThread().

const TUniqueId& impala::FragmentMgr::FragmentExecState::fragment_instance_id ( ) const
inline

Definition at line 58 of file fragment-exec-state.h.

References fragment_instance_ctx_.

Referenced by impala::FragmentMgr::FragmentExecThread().

Status FragmentMgr::FragmentExecState::Prepare ( const TExecPlanFragmentParams &  exec_params)

Call Prepare() and create and initialize data sink.

Definition at line 41 of file fragment-exec-state.cc.

References impala::executor_, impala::OK, and RETURN_IF_ERROR.

const TUniqueId& impala::FragmentMgr::FragmentExecState::query_id ( ) const
inline

Definition at line 54 of file fragment-exec-state.h.

References fragment_instance_ctx_.

void FragmentMgr::FragmentExecState::ReportStatusCb ( const Status status,
RuntimeProfile profile,
bool  done 
)
private
void impala::FragmentMgr::FragmentExecState::set_exec_thread ( Thread exec_thread)
inline

Set the execution thread, taking ownership of the object.

Definition at line 67 of file fragment-exec-state.h.

References exec_thread_.

Status FragmentMgr::FragmentExecState::UpdateStatus ( const Status status)
private

Update exec_status_ w/ status, if the former isn't already an error. Returns current exec_status_.

Definition at line 28 of file fragment-exec-state.cc.

References impala::Status::ok().

Member Data Documentation

ImpalaInternalServiceClientCache* impala::FragmentMgr::FragmentExecState::client_cache_
private

Definition at line 72 of file fragment-exec-state.h.

TExecPlanFragmentParams impala::FragmentMgr::FragmentExecState::exec_params_
private

Definition at line 73 of file fragment-exec-state.h.

Status impala::FragmentMgr::FragmentExecState::exec_status_
private

set in ReportStatusCb(); if set to anything other than OK, execution has terminated w/ an error

Definition at line 83 of file fragment-exec-state.h.

boost::scoped_ptr<Thread> impala::FragmentMgr::FragmentExecState::exec_thread_
private

the thread executing this plan fragment

Definition at line 76 of file fragment-exec-state.h.

Referenced by set_exec_thread().

PlanFragmentExecutor impala::FragmentMgr::FragmentExecState::executor_
private

Definition at line 71 of file fragment-exec-state.h.

TPlanFragmentInstanceCtx impala::FragmentMgr::FragmentExecState::fragment_instance_ctx_
private

Definition at line 70 of file fragment-exec-state.h.

Referenced by coord_address(), fragment_instance_id(), and query_id().

boost::mutex impala::FragmentMgr::FragmentExecState::status_lock_
private

protects exec_status_

Definition at line 79 of file fragment-exec-state.h.


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