Class ResourcePoolImpl

java.lang.Object
org.apache.drill.exec.resourcemgr.config.ResourcePoolImpl
All Implemented Interfaces:
ResourcePool

public class ResourcePoolImpl extends Object implements ResourcePool
Parses and initializes all the provided configuration for a ResourcePool defined in RM configuration. It takes care of creating all the child ResourcePools belonging to this Resource Pool, ResourcePoolSelector for this pool and a QueryQueueConfig if it's a leaf pool.
  • Field Details

  • Method Details

    • getPoolName

      public String getPoolName()
      Specified by:
      getPoolName in interface ResourcePool
    • isLeafPool

      public boolean isLeafPool()
      Determines if this ResourcePool is a leaf pool or not which will have a queue associated with it
      Specified by:
      isLeafPool in interface ResourcePool
      Returns:
      true If a leaf pool, false otherwise
    • isDefaultPool

      public boolean isDefaultPool()
      Determines if this ResourcePool is a default pool or not which will act as a sink for all the queries
      Specified by:
      isDefaultPool in interface ResourcePool
      Returns:
      true If a Default pool, false otherwise
    • getMaxQueryMemoryPerNode

      public long getMaxQueryMemoryPerNode()
      Specified by:
      getMaxQueryMemoryPerNode in interface ResourcePool
    • visitAndSelectPool

      public void visitAndSelectPool(QueueAssignmentResult assignmentResult, QueryContext queryContext)
      Used to determine if a ResourcePool is selected for a given query or not. It uses the assigned selector of this ResourcePool which takes in query metadata to determine if a query is allowed in this pool.
      Specified by:
      visitAndSelectPool in interface ResourcePool
      Parameters:
      assignmentResult - Used to keep track of all selected leaf pools and all rejected pools for given query
      queryContext - Contains query metadata like user, groups, tags, etc used by ResourcePoolSelector
    • getPoolMemoryShare

      public double getPoolMemoryShare()
      Actual percentage share of memory assigned to this ResourcePool
      Specified by:
      getPoolMemoryShare in interface ResourcePool
      Returns:
      Pool memory share in percentage
    • getPoolMemoryInMB

      public long getPoolMemoryInMB(int numClusterNodes)
      Total memory share in MB assigned to this ResourcePool
      Specified by:
      getPoolMemoryInMB in interface ResourcePool
      Parameters:
      numClusterNodes - number of available cluster nodes for this pool
      Returns:
      Pool memory share in MB
    • getQueryQueue

      public QueryQueueConfig getQueryQueue()
      If this a leaf pool then returns the QueryQueueConfig for the queue associated with this pool
      Specified by:
      getQueryQueue in interface ResourcePool
      Returns:
      QueryQueueConfig object for this pool
    • getParentPool

      public ResourcePool getParentPool()
      Specified by:
      getParentPool in interface ResourcePool
    • getFullPath

      public String getFullPath()
      Returns full path in terms of concatenated pool names from root pool to this pool in ResourcePoolTree
      Specified by:
      getFullPath in interface ResourcePool
      Returns:
      String with pool names from root to this pool
    • getChildPools

      public List<ResourcePool> getChildPools()
      Specified by:
      getChildPools in interface ResourcePool
    • getSelector

      public ResourcePoolSelector getSelector()
      Specified by:
      getSelector in interface ResourcePool
    • toString

      public String toString()
      Overrides:
      toString in class Object