public class ResourcePoolTreeImpl extends Object implements ResourcePoolTree
| Modifier and Type | Field and Description |
|---|---|
static String |
ROOT_POOL_CONFIG_KEY |
static String |
ROOT_POOL_QUEUE_SELECTION_POLICY_KEY |
| Constructor and Description |
|---|
ResourcePoolTreeImpl(com.typesafe.config.Config rmConfig,
long totalNodeMemory,
int totalNodePhysicalCpu,
int vFactor) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,QueryQueueConfig> |
getAllLeafQueues() |
double |
getResourceShare() |
ResourcePool |
getRootPool() |
QueueSelectionPolicy |
getSelectionPolicyInUse() |
QueueAssignmentResult |
selectAllQueues(QueryContext queryContext)
Creates
QueueAssignmentResult which contains list of all selected leaf ResourcePools and all the rejected
ResourcePools for the provided query. |
QueryQueueConfig |
selectOneQueue(QueryContext queryContext,
NodeResources queryMaxNodeResource)
Selects a leaf queue out of all the possibles leaf queues returned by
ResourcePoolTree.selectAllQueues(QueryContext) for a given query based on the configured
QueueSelectionPolicy. |
String |
toString() |
public static final String ROOT_POOL_QUEUE_SELECTION_POLICY_KEY
public static final String ROOT_POOL_CONFIG_KEY
public ResourcePoolTreeImpl(com.typesafe.config.Config rmConfig,
long totalNodeMemory,
int totalNodePhysicalCpu,
int vFactor)
throws RMConfigException
RMConfigExceptionpublic ResourcePool getRootPool()
getRootPool in interface ResourcePoolTreeResourcePoolpublic Map<String,QueryQueueConfig> getAllLeafQueues()
getAllLeafQueues in interface ResourcePoolTreepublic double getResourceShare()
getResourceShare in interface ResourcePoolTreepublic QueueAssignmentResult selectAllQueues(QueryContext queryContext)
QueueAssignmentResult 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.selectAllQueues in interface ResourcePoolTreequeryContext - QueryContext which contains metadata required for the given queryQueueAssignmentResult populated with selected/rejected ResourcePoolspublic QueryQueueConfig selectOneQueue(QueryContext queryContext, NodeResources queryMaxNodeResource) throws QueueSelectionException
ResourcePoolTree.selectAllQueues(QueryContext) for a given query based on the configured
QueueSelectionPolicy. If none of the queue qualifies then it throws QueueSelectionExceptionselectOneQueue in interface ResourcePoolTreequeryContext - QueryContext which contains metadata for given queryqueryMaxNodeResource - Max resources on a node required for given queryQueryQueueConfig for the selected leaf queueQueueSelectionException - If no leaf queue is selectedpublic QueueSelectionPolicy getSelectionPolicyInUse()
getSelectionPolicyInUse in interface ResourcePoolTreeQueueSelectionPolicy which is used to chose one queue out of all the available options for a queryCopyright © 2021 The Apache Software Foundation. All rights reserved.