Interface QueryResourceManager

All Superinterfaces:
QueryResourceAllocator
All Known Implementing Classes:
DefaultResourceManager.DefaultQueryResourceManager, ThrottledResourceManager.QueuedQueryResourceManager

public interface QueryResourceManager extends QueryResourceAllocator
Extends a QueryResourceAllocator to provide queueing support.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Admit the query into the cluster.
    void
    Mark the query as completing, giving up its slot in the cluster.
    getParallelizer(boolean memoryPlanning)
    Create a parallelizer to parallelize each major fragment of the query into many minor fragments.
    boolean
    Hint that this resource manager queues.
    Returns the name of the queue (if any) on which the query was placed.
    void
    setCost(double cost)
    For some cases the foreman does not have a full plan, just a cost.

    Methods inherited from interface org.apache.drill.exec.work.foreman.rm.QueryResourceAllocator

    visitAbstractPlan, visitPhysicalPlan
  • Method Details

    • hasQueue

      boolean hasQueue()
      Hint that this resource manager queues. Allows the Foreman to short-circuit expensive logic if no queuing will actually be done. This is a static attribute per Drillbit run.
    • setCost

      void setCost(double cost)
      For some cases the foreman does not have a full plan, just a cost. In this case, this object will not plan memory, but still needs the cost to place the job into the correct queue.
      Parameters:
      cost -
    • getParallelizer

      QueryParallelizer getParallelizer(boolean memoryPlanning)
      Create a parallelizer to parallelize each major fragment of the query into many minor fragments. The parallelizer encapsulates the logic of how much memory and parallelism is required for the query.
      Parameters:
      memoryPlanning - memory planning needs to be done during parallelization
      Returns:
    • admit

      Admit the query into the cluster. Blocks until the query can run. (Later revisions may use a more thread-friendly approach.)
      Throws:
      QueryQueue.QueryQueueException - if something goes wrong with the queue mechanism
      QueryQueue.QueueTimeoutException - if the query timed out waiting to be admitted.
    • queueName

      String queueName()
      Returns the name of the queue (if any) on which the query was placed. Valid only after the query is admitted.
      Returns:
      queue name, or null if queuing is not enabled.
    • exit

      void exit()
      Mark the query as completing, giving up its slot in the cluster. Releases any lease that may be held for a system with queues.