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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionResourcePoolTreeImpl(com.typesafe.config.Config rmConfig, long totalNodeMemory, int totalNodePhysicalCpu, int vFactor) -
Method Summary
Modifier and TypeMethodDescriptiondoubleselectAllQueues(QueryContext queryContext) CreatesQueueAssignmentResultwhich 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:
getRootPoolin interfaceResourcePoolTree- Returns:
- root
ResourcePool
-
getAllLeafQueues
- Specified by:
getAllLeafQueuesin interfaceResourcePoolTree- Returns:
- Map containing all the configured leaf queues
-
selectAllQueues
CreatesQueueAssignmentResultwhich 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:
selectAllQueuesin interfaceResourcePoolTree- Parameters:
queryContext-QueryContextwhich contains metadata required for the given query- Returns:
QueueAssignmentResultpopulated 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:
selectOneQueuein interfaceResourcePoolTree- Parameters:
queryContext-QueryContextwhich contains metadata for given queryqueryMaxNodeResource- Max resources on a node required for given query- Returns:
QueryQueueConfigfor the selected leaf queue- Throws:
QueueSelectionException- If no leaf queue is selected
-
getSelectionPolicyInUse
- Specified by:
getSelectionPolicyInUsein interfaceResourcePoolTree- Returns:
QueueSelectionPolicywhich is used to chose one queue out of all the available options for a query
-
toString
-