Class DefaultResourceManager.DefaultQueryResourceManager
java.lang.Object
org.apache.drill.exec.work.foreman.rm.DefaultResourceManager.DefaultResourceAllocator
org.apache.drill.exec.work.foreman.rm.DefaultResourceManager.DefaultQueryResourceManager
- All Implemented Interfaces:
QueryResourceAllocator
,QueryResourceManager
- Enclosing class:
- DefaultResourceManager
public static class DefaultResourceManager.DefaultQueryResourceManager
extends DefaultResourceManager.DefaultResourceAllocator
implements QueryResourceManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
admit()
Admit the query into the cluster.void
exit()
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
hasQueue()
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 class org.apache.drill.exec.work.foreman.rm.DefaultResourceManager.DefaultResourceAllocator
getQueryContext, visitAbstractPlan, visitPhysicalPlan
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.drill.exec.work.foreman.rm.QueryResourceAllocator
visitAbstractPlan, visitPhysicalPlan
-
Constructor Details
-
DefaultQueryResourceManager
-
-
Method Details
-
setCost
public void setCost(double cost) Description copied from interface:QueryResourceManager
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.- Specified by:
setCost
in interfaceQueryResourceManager
-
getParallelizer
Description copied from interface:QueryResourceManager
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.- Specified by:
getParallelizer
in interfaceQueryResourceManager
- Parameters:
memoryPlanning
- memory planning needs to be done during parallelization- Returns:
-
admit
public void admit()Description copied from interface:QueryResourceManager
Admit the query into the cluster. Blocks until the query can run. (Later revisions may use a more thread-friendly approach.)- Specified by:
admit
in interfaceQueryResourceManager
-
exit
public void exit()Description copied from interface:QueryResourceManager
Mark the query as completing, giving up its slot in the cluster. Releases any lease that may be held for a system with queues.- Specified by:
exit
in interfaceQueryResourceManager
-
hasQueue
public boolean hasQueue()Description copied from interface:QueryResourceManager
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.- Specified by:
hasQueue
in interfaceQueryResourceManager
-
queueName
Description copied from interface:QueryResourceManager
Returns the name of the queue (if any) on which the query was placed. Valid only after the query is admitted.- Specified by:
queueName
in interfaceQueryResourceManager
- Returns:
- queue name, or null if queuing is not enabled.
-