Class ResourcePoolTreeImpl
java.lang.Object
org.apache.drill.exec.resourcemgr.config.ResourcePoolTreeImpl
- All Implemented Interfaces:
ResourcePoolTree
Parses and initializes configuration for ResourceManagement in Drill. It takes care of creating all the ResourcePools
recursively maintaining the n-ary tree hierarchy defined in the configuration.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionResourcePoolTreeImpl
(com.typesafe.config.Config rmConfig, long totalNodeMemory, int totalNodePhysicalCpu, int vFactor) -
Method Summary
Modifier and TypeMethodDescriptiondouble
selectAllQueues
(QueryContext queryContext) CreatesQueueAssignmentResult
which contains list of all selected leaf ResourcePools and all the rejected ResourcePools for the provided query.selectOneQueue
(QueryContext queryContext, NodeResources queryMaxNodeResource) Selects a leaf queue out of all the possibles leaf queues returned byResourcePoolTree.selectAllQueues(QueryContext)
for a given query based on the configuredQueueSelectionPolicy
.toString()
-
Field Details
-
ROOT_POOL_QUEUE_SELECTION_POLICY_KEY
- See Also:
-
ROOT_POOL_CONFIG_KEY
- See Also:
-
-
Constructor Details
-
ResourcePoolTreeImpl
public ResourcePoolTreeImpl(com.typesafe.config.Config rmConfig, long totalNodeMemory, int totalNodePhysicalCpu, int vFactor) throws RMConfigException - Throws:
RMConfigException
-
-
Method Details
-
getRootPool
- Specified by:
getRootPool
in interfaceResourcePoolTree
- Returns:
- root
ResourcePool
-
getAllLeafQueues
- Specified by:
getAllLeafQueues
in interfaceResourcePoolTree
- Returns:
- Map containing all the configured leaf queues
-
selectAllQueues
CreatesQueueAssignmentResult
which contains list of all selected leaf ResourcePools and all the rejected ResourcePools for the provided query. Performs DFS of the ResourcePoolTree to traverse and find selected/rejected ResourcePools.- Specified by:
selectAllQueues
in interfaceResourcePoolTree
- Parameters:
queryContext
-QueryContext
which contains metadata required for the given query- Returns:
QueueAssignmentResult
populated with selected/rejected ResourcePools
-
selectOneQueue
public QueryQueueConfig selectOneQueue(QueryContext queryContext, NodeResources queryMaxNodeResource) throws QueueSelectionException Selects a leaf queue out of all the possibles leaf queues returned byResourcePoolTree.selectAllQueues(QueryContext)
for a given query based on the configuredQueueSelectionPolicy
. If none of the queue qualifies then it throwsQueueSelectionException
- Specified by:
selectOneQueue
in interfaceResourcePoolTree
- Parameters:
queryContext
-QueryContext
which contains metadata for given queryqueryMaxNodeResource
- Max resources on a node required for given query- Returns:
QueryQueueConfig
for the selected leaf queue- Throws:
QueueSelectionException
- If no leaf queue is selected
-
getSelectionPolicyInUse
- Specified by:
getSelectionPolicyInUse
in interfaceResourcePoolTree
- Returns:
QueueSelectionPolicy
which is used to chose one queue out of all the available options for a query
-
toString
-