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

#include <exec-env.h>

Collaboration diagram for impala::ExecEnv:

Public Member Functions

 ExecEnv ()
 
 ExecEnv (const std::string &hostname, int backend_port, int subscriber_port, int webserver_port, const std::string &statestore_host, int statestore_port)
 
virtual ~ExecEnv ()
 
void SetImpalaServer (ImpalaServer *server)
 
StatestoreSubscriber * statestore_subscriber ()
 
DataStreamMgr * stream_mgr ()
 
ImpalaInternalServiceClientCache * impalad_client_cache ()
 
CatalogServiceClientCache * catalogd_client_cache ()
 
HBaseTableFactory * htable_factory ()
 
DiskIoMgr * disk_io_mgr ()
 
Webserver * webserver ()
 
MetricGroup * metrics ()
 
MemTracker * process_mem_tracker ()
 
ThreadResourceMgr * thread_mgr ()
 
CgroupsMgr * cgroups_mgr ()
 
HdfsOpThreadPool * hdfs_op_thread_pool ()
 
ImpalaServer * impala_server ()
 
Frontend * frontend ()
 
void set_enable_webserver (bool enable)
 
ResourceBroker * resource_broker ()
 
Scheduler * scheduler ()
 
StatestoreSubscriber * subscriber ()
 
const TNetworkAddress & backend_address () const
 
virtual Status StartServices ()
 Starts any dependent services in their correct order. More...
 
Status InitForFeTests ()
 Initializes the exec env for running FE tests. More...
 
bool is_fe_tests ()
 
bool is_pseudo_distributed_llama ()
 

Static Public Member Functions

static ExecEnv * GetInstance ()
 

Protected Attributes

boost::scoped_ptr< DataStreamMgr > stream_mgr_
 Leave protected so that subclasses can override. More...
 
boost::scoped_ptr< ResourceBroker > resource_broker_
 
boost::scoped_ptr< Scheduler > scheduler_
 
boost::scoped_ptr
< StatestoreSubscriber > 
statestore_subscriber_
 
boost::scoped_ptr
< ImpalaInternalServiceClientCache > 
impalad_client_cache_
 
boost::scoped_ptr
< CatalogServiceClientCache > 
catalogd_client_cache_
 
boost::scoped_ptr
< HBaseTableFactory > 
htable_factory_
 
boost::scoped_ptr< DiskIoMgr > disk_io_mgr_
 
boost::scoped_ptr< Webserver > webserver_
 
boost::scoped_ptr< MetricGroup > metrics_
 
boost::scoped_ptr< MemTracker > mem_tracker_
 
boost::scoped_ptr
< ThreadResourceMgr > 
thread_mgr_
 
boost::scoped_ptr< CgroupsMgr > cgroups_mgr_
 
boost::scoped_ptr
< HdfsOpThreadPool > 
hdfs_op_thread_pool_
 
boost::scoped_ptr
< RequestPoolService > 
request_pool_service_
 
boost::scoped_ptr< Frontend > frontend_
 
ImpalaServer * impala_server_
 Not owned by this class. More...
 
bool enable_webserver_
 

Private Member Functions

void InitRm ()
 Initialise cgroups manager, detect test RM environment and init resource broker. More...
 

Private Attributes

TimezoneDatabase tz_database_
 
bool is_fe_tests_
 
TNetworkAddress backend_address_
 Address of the Impala backend server instance. More...
 
bool is_pseudo_distributed_llama_
 

Static Private Attributes

static ExecEnv * exec_env_ = NULL
 

Detailed Description

Execution environment for queries/plan fragments. Contains all required global structures, and handles to singleton services. Clients must call StartServices exactly once to properly initialise service state.

Definition at line 53 of file exec-env.h.

Constructor & Destructor Documentation

impala::ExecEnv::ExecEnv ( const std::string &  hostname,
int  backend_port,
int  subscriber_port,
int  webserver_port,
const std::string &  statestore_host,
int  statestore_port 
)
impala::ExecEnv::~ExecEnv ( )
virtual

Empty destructor because the compiler-generated one requires full declarations for classes in scoped_ptrs.

Definition at line 273 of file exec-env.cc.

Member Function Documentation

const TNetworkAddress& impala::ExecEnv::backend_address ( ) const
inline

Definition at line 99 of file exec-env.h.

References backend_address_.

Referenced by impala::ImpalaServer::QueryExecState::QueryExecState().

CatalogServiceClientCache* impala::ExecEnv::catalogd_client_cache ( )
inline
DiskIoMgr* impala::ExecEnv::disk_io_mgr ( )
inline

Definition at line 83 of file exec-env.h.

References disk_io_mgr_.

Referenced by impala::RuntimeState::io_mgr().

HdfsOpThreadPool* impala::ExecEnv::hdfs_op_thread_pool ( )
inline

Definition at line 89 of file exec-env.h.

References hdfs_op_thread_pool_.

HBaseTableFactory* impala::ExecEnv::htable_factory ( )
inline

Definition at line 82 of file exec-env.h.

References htable_factory_.

Referenced by impala::RuntimeState::htable_factory().

ImpalaServer* impala::ExecEnv::impala_server ( )
inline
Status impala::ExecEnv::InitForFeTests ( )

Initializes the exec env for running FE tests.

Definition at line 276 of file exec-env.cc.

References is_fe_tests_, mem_tracker_, and impala::Status::OK.

Referenced by impala::DataStreamTest::DataStreamTest(), and Java_com_cloudera_impala_service_FeSupport_NativeFeTestInit().

void impala::ExecEnv::InitRm ( )
private

Initialise cgroups manager, detect test RM environment and init resource broker.

Definition at line 223 of file exec-env.cc.

References cgroups_mgr_, frontend_, is_pseudo_distributed_llama_, impala::MakeNetworkAddress(), metrics_, PSEUDO_DISTRIBUTED_CONFIG_KEY, and resource_broker_.

Referenced by ExecEnv().

bool impala::ExecEnv::is_fe_tests ( )
inline

Returns true if this environment was created from the FE tests. This makes the environment special since the JVM is started first and libraries are loaded differently.

Definition at line 110 of file exec-env.h.

References is_fe_tests_.

bool impala::ExecEnv::is_pseudo_distributed_llama ( )
inline

Returns true if the Llama in use is pseudo-distributed, used for development purposes. The pseudo-distributed version has special requirements for specifying resource locations.

Definition at line 115 of file exec-env.h.

References is_pseudo_distributed_llama_.

MetricGroup* impala::ExecEnv::metrics ( )
inline

Definition at line 85 of file exec-env.h.

References metrics_.

Referenced by impala::CreateImpalaServer(), impala::ImpalaServer::ImpalaServer(), and main().

MemTracker* impala::ExecEnv::process_mem_tracker ( )
inline
Scheduler* impala::ExecEnv::scheduler ( )
inline
void impala::ExecEnv::set_enable_webserver ( bool  enable)
inline

Definition at line 93 of file exec-env.h.

References enable_webserver_.

void impala::ExecEnv::SetImpalaServer ( ImpalaServer *  server)
inline

Definition at line 69 of file exec-env.h.

References impala_server_.

Referenced by impala::ImpalaServer::ImpalaServer().

StatestoreSubscriber* impala::ExecEnv::statestore_subscriber ( )
inline

Definition at line 71 of file exec-env.h.

References statestore_subscriber_.

DataStreamMgr* impala::ExecEnv::stream_mgr ( )
inline
StatestoreSubscriber* impala::ExecEnv::subscriber ( )
inline

Definition at line 97 of file exec-env.h.

References statestore_subscriber_.

Referenced by impala::ImpalaServer::ImpalaServer().

ThreadResourceMgr* impala::ExecEnv::thread_mgr ( )
inline

Definition at line 87 of file exec-env.h.

References thread_mgr_.

Referenced by impala::PlanFragmentExecutor::Close(), and impala::RuntimeState::Init().

Webserver* impala::ExecEnv::webserver ( )
inline

Definition at line 84 of file exec-env.h.

References webserver_.

Referenced by impala::ImpalaServer::ImpalaServer(), and main().

Member Data Documentation

TNetworkAddress impala::ExecEnv::backend_address_
private

Address of the Impala backend server instance.

Definition at line 147 of file exec-env.h.

Referenced by backend_address(), and ExecEnv().

boost::scoped_ptr<CatalogServiceClientCache> impala::ExecEnv::catalogd_client_cache_
protected

Definition at line 124 of file exec-env.h.

Referenced by catalogd_client_cache(), and StartServices().

boost::scoped_ptr<CgroupsMgr> impala::ExecEnv::cgroups_mgr_
protected

Definition at line 131 of file exec-env.h.

Referenced by cgroups_mgr(), InitRm(), and StartServices().

boost::scoped_ptr<DiskIoMgr> impala::ExecEnv::disk_io_mgr_
protected

Definition at line 126 of file exec-env.h.

Referenced by disk_io_mgr(), and StartServices().

bool impala::ExecEnv::enable_webserver_
protected

Definition at line 139 of file exec-env.h.

Referenced by set_enable_webserver(), and StartServices().

ExecEnv * impala::ExecEnv::exec_env_ = NULL
staticprivate

Definition at line 142 of file exec-env.h.

Referenced by ExecEnv(), and GetInstance().

boost::scoped_ptr<Frontend> impala::ExecEnv::frontend_
protected

Definition at line 134 of file exec-env.h.

Referenced by frontend(), and InitRm().

boost::scoped_ptr<HdfsOpThreadPool> impala::ExecEnv::hdfs_op_thread_pool_
protected

Definition at line 132 of file exec-env.h.

Referenced by hdfs_op_thread_pool().

boost::scoped_ptr<HBaseTableFactory> impala::ExecEnv::htable_factory_
protected

Definition at line 125 of file exec-env.h.

Referenced by htable_factory().

ImpalaServer* impala::ExecEnv::impala_server_
protected

Not owned by this class.

Definition at line 137 of file exec-env.h.

Referenced by impala_server(), and SetImpalaServer().

boost::scoped_ptr<ImpalaInternalServiceClientCache> impala::ExecEnv::impalad_client_cache_
protected

Definition at line 123 of file exec-env.h.

Referenced by impalad_client_cache(), and StartServices().

bool impala::ExecEnv::is_fe_tests_
private

Definition at line 144 of file exec-env.h.

Referenced by InitForFeTests(), and is_fe_tests().

bool impala::ExecEnv::is_pseudo_distributed_llama_
private

True if the cluster has set 'yarn.scheduler.include-port-in-node-name' to true, indicating that this cluster is pseudo-distributed. Should not be true in real deployments.

Definition at line 152 of file exec-env.h.

Referenced by InitRm(), and is_pseudo_distributed_llama().

boost::scoped_ptr<MemTracker> impala::ExecEnv::mem_tracker_
protected

Definition at line 129 of file exec-env.h.

Referenced by InitForFeTests(), process_mem_tracker(), and StartServices().

boost::scoped_ptr<MetricGroup> impala::ExecEnv::metrics_
protected

Definition at line 128 of file exec-env.h.

Referenced by ExecEnv(), InitRm(), metrics(), and StartServices().

boost::scoped_ptr<RequestPoolService> impala::ExecEnv::request_pool_service_
protected

Definition at line 133 of file exec-env.h.

Referenced by ExecEnv().

boost::scoped_ptr<ResourceBroker> impala::ExecEnv::resource_broker_
protected

Definition at line 120 of file exec-env.h.

Referenced by ExecEnv(), InitRm(), resource_broker(), and StartServices().

boost::scoped_ptr<Scheduler> impala::ExecEnv::scheduler_
protected

Definition at line 121 of file exec-env.h.

Referenced by ExecEnv(), scheduler(), and StartServices().

boost::scoped_ptr<StatestoreSubscriber> impala::ExecEnv::statestore_subscriber_
protected

Definition at line 122 of file exec-env.h.

Referenced by ExecEnv(), StartServices(), statestore_subscriber(), and subscriber().

boost::scoped_ptr<DataStreamMgr> impala::ExecEnv::stream_mgr_
protected

Leave protected so that subclasses can override.

Definition at line 119 of file exec-env.h.

Referenced by stream_mgr().

boost::scoped_ptr<ThreadResourceMgr> impala::ExecEnv::thread_mgr_
protected

Definition at line 130 of file exec-env.h.

Referenced by thread_mgr().

TimezoneDatabase impala::ExecEnv::tz_database_
private

Definition at line 143 of file exec-env.h.

boost::scoped_ptr<Webserver> impala::ExecEnv::webserver_
protected

Definition at line 127 of file exec-env.h.

Referenced by ExecEnv(), StartServices(), and webserver().


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