Class ResourcePoolImpl
java.lang.Object
org.apache.drill.exec.resourcemgr.config.ResourcePoolImpl
- All Implemented Interfaces:
ResourcePool
Parses and initializes all the provided configuration for a ResourcePool defined in RM configuration. It takes
care of creating all the child ResourcePools belonging to this Resource Pool,
ResourcePoolSelector
for this
pool and a QueryQueueConfig
if it's a leaf pool.-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns full path in terms of concatenated pool names from root pool to this pool inResourcePoolTree
long
long
getPoolMemoryInMB
(int numClusterNodes) Total memory share in MB assigned to this ResourcePooldouble
Actual percentage share of memory assigned to this ResourcePoolIf this a leaf pool then returns theQueryQueueConfig
for the queue associated with this poolboolean
Determines if this ResourcePool is a default pool or not which will act as a sink for all the queriesboolean
Determines if this ResourcePool is a leaf pool or not which will have a queue associated with ittoString()
void
visitAndSelectPool
(QueueAssignmentResult assignmentResult, QueryContext queryContext) Used to determine if a ResourcePool is selected for a given query or not.
-
Field Details
-
POOL_NAME_KEY
- See Also:
-
POOL_MEMORY_SHARE_KEY
- See Also:
-
POOL_CHILDREN_POOLS_KEY
- See Also:
-
POOL_SELECTOR_KEY
- See Also:
-
POOL_QUEUE_KEY
- See Also:
-
-
Method Details
-
getPoolName
- Specified by:
getPoolName
in interfaceResourcePool
-
isLeafPool
public boolean isLeafPool()Determines if this ResourcePool is a leaf pool or not which will have a queue associated with it- Specified by:
isLeafPool
in interfaceResourcePool
- Returns:
- true If a leaf pool, false otherwise
-
isDefaultPool
public boolean isDefaultPool()Determines if this ResourcePool is a default pool or not which will act as a sink for all the queries- Specified by:
isDefaultPool
in interfaceResourcePool
- Returns:
- true If a Default pool, false otherwise
-
getMaxQueryMemoryPerNode
public long getMaxQueryMemoryPerNode()- Specified by:
getMaxQueryMemoryPerNode
in interfaceResourcePool
-
visitAndSelectPool
Used to determine if a ResourcePool is selected for a given query or not. It uses the assigned selector of this ResourcePool which takes in query metadata to determine if a query is allowed in this pool.- Specified by:
visitAndSelectPool
in interfaceResourcePool
- Parameters:
assignmentResult
- Used to keep track of all selected leaf pools and all rejected pools for given queryqueryContext
- Contains query metadata like user, groups, tags, etc used by ResourcePoolSelector
-
getPoolMemoryInMB
public long getPoolMemoryInMB(int numClusterNodes) Total memory share in MB assigned to this ResourcePool- Specified by:
getPoolMemoryInMB
in interfaceResourcePool
- Parameters:
numClusterNodes
- number of available cluster nodes for this pool- Returns:
- Pool memory share in MB
-
getQueryQueue
If this a leaf pool then returns theQueryQueueConfig
for the queue associated with this pool- Specified by:
getQueryQueue
in interfaceResourcePool
- Returns:
QueryQueueConfig
object for this pool
-
getParentPool
- Specified by:
getParentPool
in interfaceResourcePool
-
getFullPath
Returns full path in terms of concatenated pool names from root pool to this pool inResourcePoolTree
- Specified by:
getFullPath
in interfaceResourcePool
- Returns:
- String with pool names from root to this pool
-
getChildPools
- Specified by:
getChildPools
in interfaceResourcePool
-
getSelector
- Specified by:
getSelector
in interfaceResourcePool
-
toString
-