Class QueryQueueConfigImpl
java.lang.Object
org.apache.drill.exec.resourcemgr.config.QueryQueueConfigImpl
- All Implemented Interfaces:
QueryQueueConfig
Parses and initialize QueueConfiguration for a
ResourcePool
. It also generates a unique UUID for each queue
which will be later used by Drillbit to store in Zookeeper along with
org.apache.drill.exec.proto.beans.DrillbitEndpoint
. This UUID is used in the leader election mechanism in
which Drillbit participates for each of the configured rm queue.-
Constructor Summary
ConstructorDescriptionQueryQueueConfigImpl
(com.typesafe.config.Config queueConfig, String poolName, NodeResources queueNodeResource) -
Method Summary
Modifier and TypeMethodDescriptionint
long
long
getMaxQueryTotalMemoryInMB
(int numClusterNodes) Given number of available nodes in the cluster what is the max memory in MB a query in this queue can be assigned cluster wideint
long
getQueueTotalMemoryInMB
(int numClusterNodes) Total memory share of this queue in the cluster based on per node resource share.int
toString()
boolean
Determines if admitted queries in this queue should wait in the queue if resources on the preferred assigned nodes of a query determined by planner is unavailable.
-
Constructor Details
-
QueryQueueConfigImpl
public QueryQueueConfigImpl(com.typesafe.config.Config queueConfig, String poolName, NodeResources queueNodeResource) throws RMConfigException - Throws:
RMConfigException
-
-
Method Details
-
getQueueId
- Specified by:
getQueueId
in interfaceQueryQueueConfig
-
getQueueName
- Specified by:
getQueueName
in interfaceQueryQueueConfig
-
getQueueTotalMemoryInMB
public long getQueueTotalMemoryInMB(int numClusterNodes) Total memory share of this queue in the cluster based on per node resource share. It assumes that the cluster is made up of homogeneous nodes in terms of resources- Specified by:
getQueueTotalMemoryInMB
in interfaceQueryQueueConfig
- Parameters:
numClusterNodes
- total number of available cluster nodes which can participate in this queue- Returns:
- queue memory share in MB
-
getMaxQueryMemoryInMBPerNode
public long getMaxQueryMemoryInMBPerNode()- Specified by:
getMaxQueryMemoryInMBPerNode
in interfaceQueryQueueConfig
- Returns:
- Maximum query memory (in MB) that a query in this queue can consume on a node
-
getMaxQueryTotalMemoryInMB
public long getMaxQueryTotalMemoryInMB(int numClusterNodes) Description copied from interface:QueryQueueConfig
Given number of available nodes in the cluster what is the max memory in MB a query in this queue can be assigned cluster wide- Specified by:
getMaxQueryTotalMemoryInMB
in interfaceQueryQueueConfig
- Parameters:
numClusterNodes
- number of available cluster nodes- Returns:
- Maximum query memory (in MB) in this queue
-
waitForPreferredNodes
public boolean waitForPreferredNodes()Description copied from interface:QueryQueueConfig
Determines if admitted queries in this queue should wait in the queue if resources on the preferred assigned nodes of a query determined by planner is unavailable.- Specified by:
waitForPreferredNodes
in interfaceQueryQueueConfig
- Returns:
- true indicates an admitted query to wait until resources on all the preferred nodes are available or wait until timeout is reached, false indicates an admitted query to not wait and find other nodes with available resources if resources on a preferred node is unavailable.
-
getMaxAdmissibleQueries
public int getMaxAdmissibleQueries()- Specified by:
getMaxAdmissibleQueries
in interfaceQueryQueueConfig
- Returns:
- Maximum number of queries that can be admitted in the queue
-
getMaxWaitingQueries
public int getMaxWaitingQueries()- Specified by:
getMaxWaitingQueries
in interfaceQueryQueueConfig
- Returns:
- Maximum number of queries that will be allowed to wait in the queue before failing a query right away
-
getWaitTimeoutInMs
public int getWaitTimeoutInMs()- Specified by:
getWaitTimeoutInMs
in interfaceQueryQueueConfig
- Returns:
- Maximum time in milliseconds for which a query can be in waiting state inside a queue
-
toString
-