Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
#include <request-pool-service.h>
Public Member Functions | |
RequestPoolService (MetricGroup *metrics) | |
Status | ResolveRequestPool (const std::string &requested_pool_name, const std::string &user, TResolveRequestPoolResult *resolved_pool) |
Status | GetPoolConfig (const std::string &pool_name, TPoolConfigResult *pool_config) |
Private Attributes | |
MetricGroup * | metrics_ |
Metrics subsystem access. More... | |
StatsMetric< double > * | resolve_pool_ms_metric_ |
Metric measuring the time ResolveRequestPool() takes, in milliseconds. More... | |
bool | default_pool_only_ |
int64_t | default_pool_mem_limit_ |
jclass | request_pool_service_class_ |
jobject | request_pool_service_ |
Instance of com.cloudera.impala.util.RequestPoolService. More... | |
jmethodID | resolve_request_pool_id_ |
jmethodID | get_pool_config_id_ |
jmethodID | ctor_ |
Used by the SimpleScheduler and AdmissionController to resolve users to pools and to get per-pool configurations for admission control. If fair scheduler allocation and Llama configuration files are available, then they are used via the Java-side RequestPoolService class. Otherwise, a default pool is always returned with pool limits configurable via gflags. A single instance of RequestPoolService is created and it lives the lifetime of the process.
Definition at line 32 of file request-pool-service.h.
RequestPoolService::RequestPoolService | ( | MetricGroup * | metrics | ) |
Initializes the JNI method stubs if configuration files are specified. If any method can't be found, or if there is any further error, the constructor will terminate the process.
Definition at line 67 of file request-pool-service.cc.
References ctor_, default_pool_mem_limit_, default_pool_only_, EXIT_IF_ERROR, EXIT_IF_EXC, get_pool_config_id_, getJNIEnv(), impala::JniUtil::LoadJniMethod(), impala::JniUtil::LocalToGlobalRef(), metrics_, impala::ParseUtil::ParseMemSpec(), impala::MemInfo::physical_mem(), impala::MetricGroup::RegisterMetric(), request_pool_service_, request_pool_service_class_, RESOLVE_POOL_METRIC_NAME, resolve_pool_ms_metric_, and resolve_request_pool_id_.
Status RequestPoolService::GetPoolConfig | ( | const std::string & | pool_name, |
TPoolConfigResult * | pool_config | ||
) |
Gets the pool configuration values for the specified pool. If default_pool_only_ is true, then the returned values are always the default pool values, i.e. pool is ignored.
Definition at line 152 of file request-pool-service.cc.
References impala::JniUtil::CallJniMethod(), default_pool_mem_limit_, default_pool_only_, get_pool_config_id_, impala::Status::OK, request_pool_service_, and RETURN_IF_ERROR.
Referenced by impala::AdmissionController::AdmitQuery().
Status RequestPoolService::ResolveRequestPool | ( | const std::string & | requested_pool_name, |
const std::string & | user, | ||
TResolveRequestPoolResult * | resolved_pool | ||
) |
Resolves the user and user-provided pool name to the pool returned by the placement policy and whether or not the user is authorized. If default_pool_only_ is true, then this will always return the default pool and will always be authorized, i.e. pool and user are ignored.
Definition at line 133 of file request-pool-service.cc.
References impala::JniUtil::CallJniMethod(), DEFAULT_POOL_NAME, default_pool_only_, impala::MonotonicMillis(), impala::Status::OK, request_pool_service_, resolve_pool_ms_metric_, resolve_request_pool_id_, and impala::StatsMetric< T >::Update().
|
private |
Definition at line 77 of file request-pool-service.h.
Referenced by RequestPoolService().
|
private |
Mem limit (in bytes) of the default pool. Only used if default_pool_only_ is true. Set in the constructor by parsing the 'default_pool_mem_limit' gflag using ParseUtil::ParseMemSpec().
Definition at line 68 of file request-pool-service.h.
Referenced by GetPoolConfig(), and RequestPoolService().
|
private |
True if the pool configuration files are not provided. ResolveRequestPool() will always return the default-pool and GetPoolConfig() will always return the limits specified by the default pool gflags, which are unlimited unless specified via the 'default_pool_max_XXX' flags (see the flag definitions in request-pool-service.cc).
Definition at line 63 of file request-pool-service.h.
Referenced by GetPoolConfig(), RequestPoolService(), and ResolveRequestPool().
|
private |
Definition at line 76 of file request-pool-service.h.
Referenced by GetPoolConfig(), and RequestPoolService().
|
private |
Metrics subsystem access.
Definition at line 53 of file request-pool-service.h.
Referenced by RequestPoolService().
|
private |
Instance of com.cloudera.impala.util.RequestPoolService.
Definition at line 74 of file request-pool-service.h.
Referenced by GetPoolConfig(), RequestPoolService(), and ResolveRequestPool().
|
private |
The following members are not initialized if default_pool_only_ is true. Descriptor of Java RequestPoolService class itself, used to create a new instance.
Definition at line 72 of file request-pool-service.h.
Referenced by RequestPoolService().
|
private |
Metric measuring the time ResolveRequestPool() takes, in milliseconds.
Definition at line 56 of file request-pool-service.h.
Referenced by RequestPoolService(), and ResolveRequestPool().
|
private |
Definition at line 75 of file request-pool-service.h.
Referenced by RequestPoolService(), and ResolveRequestPool().