Class QueryQueueConfigImpl

java.lang.Object
org.apache.drill.exec.resourcemgr.config.QueryQueueConfigImpl
All Implemented Interfaces:
QueryQueueConfig

public class QueryQueueConfigImpl extends Object implements 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 Details

  • Method Details

    • getQueueId

      public String getQueueId()
      Specified by:
      getQueueId in interface QueryQueueConfig
    • getQueueName

      public String getQueueName()
      Specified by:
      getQueueName in interface QueryQueueConfig
    • 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 interface QueryQueueConfig
      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 interface QueryQueueConfig
      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 interface QueryQueueConfig
      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 interface QueryQueueConfig
      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 interface QueryQueueConfig
      Returns:
      Maximum number of queries that can be admitted in the queue
    • getMaxWaitingQueries

      public int getMaxWaitingQueries()
      Specified by:
      getMaxWaitingQueries in interface QueryQueueConfig
      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 interface QueryQueueConfig
      Returns:
      Maximum time in milliseconds for which a query can be in waiting state inside a queue
    • toString

      public String toString()
      Overrides:
      toString in class Object