Defines all the selection policy implementation which can be configured with Resource Management. The configuration which is used to specify a policy is
ResourcePoolTreeImpl.ROOT_POOL_QUEUE_SELECTION_POLICY_KEY. Selection Policy
helps to select a single leaf ResourcePool out of all the eligible pools whose queue can be used to admit this query.
Currently there are 3 types of supported policies. In future more policies can be supported by implementing
DefaultQueueSelection: Out of all the eligible pools this policy will choose a default pool in the list. If there are multiple default pools present in the list then it will return the first default pool. If there is no default pool present then it throws
RandomQueueSelection: Out of all the eligible pools this policy will choose a pool at random. If there are no pools to select from then it throws
BestFitQueueSelection: Out of all the eligible pools this policy will choose a pool whose queue configuration
QueryQueueConfigImpl.MAX_QUERY_MEMORY_PER_NODE_KEYvalue is closest to the max memory on a node required by the query. It tries to find a pool whose value for MAX_QUERY_MEMORY_PER_NODE is equal to queries max memory per node requirement. If there is no such pool then find the pool with config value just greater than queries max memory per node. Otherwise find a pool with config value just less than queries max memory per node.
ClassDescriptionHelps to select a queue whose
QueryQueueConfig.getMaxQueryMemoryInMBPerNode()is nearest to the max memory on a node required by the given query.Helps to select the first default queue in the list of all the provided queues.Interface that defines all the implementation of a QueueSelectionPolicy supported by ResourceManagementFactory to return an instance of
QueueSelectionPolicybased on the configured policy name.Randomly selects a queue from the list of all the provided queues.