Class ThrottledResourceManager

java.lang.Object
org.apache.drill.exec.work.foreman.rm.AbstractResourceManager
org.apache.drill.exec.work.foreman.rm.ThrottledResourceManager
All Implemented Interfaces:
ResourceManager

public class ThrottledResourceManager extends AbstractResourceManager
Global resource manager that provides basic admission control (AC) via a configured queue: either the Zookeeper-based distributed queue or the in-process embedded Drillbit queue. The queue places an upper limit on the number of running queries. This limit then "slices" memory and CPU between queries: each gets the same share of resources.

This is a "basic" implementation. Clearly, a more advanced implementation could look at query cost to determine whether to give a given query more or less than the "standard" share. That is left as a future exercise; in this version we just want to get the basics working.

This is the resource manager level. This resource manager is paired with a queue implementation to produce a complete solution. This composition-based approach allows sharing of functionality across queue implementations.

  • Constructor Details

  • Method Details

    • minimumOperatorMemory

      public long minimumOperatorMemory()
    • defaultQueryMemoryPerNode

      public long defaultQueryMemoryPerNode(double cost)
    • queue

      public QueryQueue queue()
    • newResourceAllocator

      public QueryResourceAllocator newResourceAllocator(QueryContext queryContext)
      Description copied from interface: ResourceManager
      Create a resource manager to prepare or describe a query. In this form, no queuing is done, but the plan is created as if queuing had been done. Used when executing EXPLAIN PLAN.
      Returns:
      a resource manager for the query
    • newQueryRM

      public QueryResourceManager newQueryRM(Foreman foreman)
      Description copied from interface: ResourceManager
      Create a resource manager to execute a query.
      Parameters:
      foreman - Foreman which manages the execution
      Returns:
      a resource manager for the query
    • close

      public void close()