blob: 79880a1b36350e35a80fed0e8cc40f74bb7995da [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>org.apache.drill.exec.resourcemgr.config (Drill : 1.20.3 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="org.apache.drill.exec.resourcemgr.config (Drill : 1.20.3 API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/drill/exec/resourcemgr/package-summary.html">Prev&nbsp;Package</a></li>
<li><a href="../../../../../../org/apache/drill/exec/resourcemgr/config/exception/package-summary.html">Next&nbsp;Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/drill/exec/resourcemgr/config/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Package" class="title">Package&nbsp;org.apache.drill.exec.resourcemgr.config</h1>
<div class="docSummary">
<div class="block">This package contains the configuration components of ResourceManagement feature in Drill.</div>
</div>
<p>See:&nbsp;<a href="#package.description">Description</a></p>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation">
<caption><span>Interface Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Interface</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../org/apache/drill/exec/resourcemgr/config/QueryQueueConfig.html" title="interface in org.apache.drill.exec.resourcemgr.config">QueryQueueConfig</a></td>
<td class="colLast">
<div class="block">Interface which defines an implementation for managing queue configuration of a leaf <a href="../../../../../../org/apache/drill/exec/resourcemgr/config/ResourcePool.html" title="interface in org.apache.drill.exec.resourcemgr.config"><code>ResourcePool</code></a></div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../org/apache/drill/exec/resourcemgr/config/ResourcePool.html" title="interface in org.apache.drill.exec.resourcemgr.config">ResourcePool</a></td>
<td class="colLast">
<div class="block">Interface which defines an implementation of ResourcePool configuration for <a href="../../../../../../org/apache/drill/exec/resourcemgr/config/ResourcePoolTree.html" title="interface in org.apache.drill.exec.resourcemgr.config"><code>ResourcePoolTree</code></a></div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../org/apache/drill/exec/resourcemgr/config/ResourcePoolTree.html" title="interface in org.apache.drill.exec.resourcemgr.config">ResourcePoolTree</a></td>
<td class="colLast">
<div class="block">Interface which defines the implementation of a hierarchical configuration for all the ResourcePool that will be
used for ResourceManagement</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
<caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../org/apache/drill/exec/resourcemgr/config/QueryQueueConfigImpl.html" title="class in org.apache.drill.exec.resourcemgr.config">QueryQueueConfigImpl</a></td>
<td class="colLast">
<div class="block">Parses and initialize QueueConfiguration for a <a href="../../../../../../org/apache/drill/exec/resourcemgr/config/ResourcePool.html" title="interface in org.apache.drill.exec.resourcemgr.config"><code>ResourcePool</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../org/apache/drill/exec/resourcemgr/config/QueueAssignmentResult.html" title="class in org.apache.drill.exec.resourcemgr.config">QueueAssignmentResult</a></td>
<td class="colLast">
<div class="block">Used to keep track of selected leaf and all rejected <a href="../../../../../../org/apache/drill/exec/resourcemgr/config/ResourcePool.html" title="interface in org.apache.drill.exec.resourcemgr.config"><code>ResourcePool</code></a> for the provided query.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../org/apache/drill/exec/resourcemgr/config/ResourcePoolImpl.html" title="class in org.apache.drill.exec.resourcemgr.config">ResourcePoolImpl</a></td>
<td class="colLast">
<div class="block">Parses and initializes all the provided configuration for a ResourcePool defined in RM configuration.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../../../org/apache/drill/exec/resourcemgr/config/ResourcePoolTreeImpl.html" title="class in org.apache.drill.exec.resourcemgr.config">ResourcePoolTreeImpl</a></td>
<td class="colLast">
<div class="block">Parses and initializes configuration for ResourceManagement in Drill.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../../../org/apache/drill/exec/resourcemgr/config/RMCommonDefaults.html" title="class in org.apache.drill.exec.resourcemgr.config">RMCommonDefaults</a></td>
<td class="colLast">
<div class="block">Defines all the default values used for the optional configurations for ResourceManagement</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
<a name="package.description">
<!-- -->
</a>
<h2 title="Package org.apache.drill.exec.resourcemgr.config Description">Package org.apache.drill.exec.resourcemgr.config Description</h2>
<div class="block">This package contains the configuration components of ResourceManagement feature in Drill. ResourceManagement will
have it's own configuration file supporting the similar hierarchy of files as supported by Drill's current
configuration and supports HOCON format. All the supported files for ResourceManagement is listed in
<a href="../../../../../../org/apache/drill/common/config/ConfigConstants.html" title="interface in org.apache.drill.common.config"><code>ConfigConstants</code></a>. However whether the feature is enabled/disabled is still
controlled by a configuration <a href="../../../../../../org/apache/drill/exec/ExecConstants.html#RM_ENABLED"><code>ExecConstants.RM_ENABLED</code></a> available in the Drill's main
configuration file. The rm config files will be parsed and loaded only when the feature is enabled. The
configuration is a hierarchical tree <a href="../../../../../../org/apache/drill/exec/resourcemgr/config/ResourcePoolTree.html" title="interface in org.apache.drill.exec.resourcemgr.config"><code>ResourcePoolTree</code></a> of
<a href="../../../../../../org/apache/drill/exec/resourcemgr/config/ResourcePool.html" title="interface in org.apache.drill.exec.resourcemgr.config"><code>ResourcePool</code></a>. At the top will be the root pool which represents
the entire resources (only memory in version 1) which is available to ResourceManager to use for admitting queries.
It is assumed that all the nodes in the Drill cluster is homogeneous and given same amount of memory resources.
The root pool can be further divided into child ResourcePools to divide the resources among multiple child pools.
Each child pool get's a resource share from it's parent resource pool. In theory there is no limit on the number
of ResourcePools that can be configured to divide the cluster resources.
<p>
In addition to other parameters defined later root ResourcePool also supports a configuration
<a href="../../../../../../org/apache/drill/exec/resourcemgr/config/ResourcePoolTreeImpl.html#ROOT_POOL_QUEUE_SELECTION_POLICY_KEY"><code>ResourcePoolTreeImpl.ROOT_POOL_QUEUE_SELECTION_POLICY_KEY</code></a> which
helps to select exactly one leaf pool out of all the possible options available for a query. For details please
see package-info.java of <a href="../../../../../../org/apache/drill/exec/resourcemgr/config/selectionpolicy/QueueSelectionPolicy.html" title="interface in org.apache.drill.exec.resourcemgr.config.selectionpolicy"><code>QueueSelectionPolicy</code></a>.
<a href="../../../../../../org/apache/drill/exec/resourcemgr/config/ResourcePoolTree.html#selectOneQueue-org.apache.drill.exec.ops.QueryContext-org.apache.drill.exec.resourcemgr.NodeResources-"><code>ResourcePoolTree.selectOneQueue(org.apache.drill.exec.ops.QueryContext,
org.apache.drill.exec.resourcemgr.NodeResources)</code></a> method is used by parallelizer to get a queue which will be used
to admit a query. The selected queue resource constraints are used by parallelizer to allocate proper resources
to a query so that it remains within the bounds.
</p>
<p>
The ResourcePools falls under 2 category:
<ul>
<li>Intermediate Pool: As the name suggests all the pools between root and leaf pool falls under this
category. It helps to navigate a query through the ResourcePoolTree hierarchy to find leaf pools using selectors.
The intermediate ResourcePool help to subdivide a parent resource pool resource and doesn't have an actual queue
associated with it. A query will only be executed in a queue associated with a ResourcePool not the ResourcePool
itself.
</li>
<li>Leaf Pool: All the ResourcePools which doesn't have any child pools associated with it are leaf
ResourcePools. All the leaf pools should have a unique name associated with it and should always have exactly one
queue configured with it. The queue of a leaf pool is where the queries will be admitted and a resource slice will
be given to it. All the leaf ResourcePools will collectively comprise of all the resource share available to
Drill's ResourceManager to allocate to all the queries.
</li>
</ul>
Configurations Supported by ResourcePool:
<ul>
<li><a href="../../../../../../org/apache/drill/exec/resourcemgr/config/ResourcePoolImpl.html#POOL_MEMORY_SHARE_KEY"><code>ResourcePoolImpl.POOL_MEMORY_SHARE_KEY</code></a>: Percentage of
memory share of parent ResourcePool assigned to this pool</li>
<li><a href="../../../../../../org/apache/drill/exec/resourcemgr/config/ResourcePoolImpl.html#POOL_SELECTOR_KEY"><code>ResourcePoolImpl.POOL_SELECTOR_KEY</code></a>: A selector assigned
to this pool. For details please see package-info.java of
<a href="../../../../../../org/apache/drill/exec/resourcemgr/config/selectors/ResourcePoolSelector.html" title="interface in org.apache.drill.exec.resourcemgr.config.selectors"><code>ResourcePoolSelector</code></a>
</li>
<li><a href="../../../../../../org/apache/drill/exec/resourcemgr/config/ResourcePoolImpl.html#POOL_QUEUE_KEY"><code>ResourcePoolImpl.POOL_QUEUE_KEY</code></a>: Queue configuration
associated with this pool. It should always be configured for a leaf pool only. If configured with an
intermediate pool then it will be ignored.
</li>
</ul>
</p>
<p>
A queue always have 1:1 relationship with a leaf pool. Queries are admitted and executed with a resource slice
from the queue. It supports following configurations:
<ul>
<li><a href="../../../../../../org/apache/drill/exec/resourcemgr/config/QueryQueueConfigImpl.html#MAX_ADMISSIBLE_KEY"><code>QueryQueueConfigImpl.MAX_ADMISSIBLE_KEY</code></a>: Upper bound on the
total number of queries that can be admitted inside a queue. After this limit is reached all the queries
will be moved to waiting state.</li>
<li><a href="../../../../../../org/apache/drill/exec/resourcemgr/config/QueryQueueConfigImpl.html#MAX_WAITING_KEY"><code>QueryQueueConfigImpl.MAX_WAITING_KEY</code></a>: Limits the
total number of queries that can be in waiting state inside a queue. After this limit is reached all the new
queries will be failed immediately.</li>
<li> <a href="../../../../../../org/apache/drill/exec/resourcemgr/config/QueryQueueConfigImpl.html#MAX_QUERY_MEMORY_PER_NODE_KEY"><code>QueryQueueConfigImpl.MAX_QUERY_MEMORY_PER_NODE_KEY</code></a>:
Limits the maximum memory any query in this queue can consume on any node in the cluster. This is to limit a
query from a queue to consume all the resources on a node so that other queues query can also have some
resources available for it. Ideally it's advised that sum of value of this parameter for all queues should not
exceed the total memory on a node.
</li>
<li> <a href="../../../../../../org/apache/drill/exec/resourcemgr/config/QueryQueueConfigImpl.html#WAIT_FOR_PREFERRED_NODES_KEY"><code>QueryQueueConfigImpl.WAIT_FOR_PREFERRED_NODES_KEY</code></a>: This
configuration helps to decide if an admitted query in a queue should wait until it has available resources on all
the nodes assigned to it by planner for its execution. By default it's true. When set to false then for the nodes
which doesn't have available resources for a query will be replaced with another node with enough resources.
</li>
</ul>
</p>
Once all the configuration are parsed an in-memory structures are created then for each query planner will select
a queue where a query can be admitted. The queue selection process happens by traversing the ResourcePoolTree. During
traversal process the query metadata is evaluated against assigned selector of a ResourcePool. If the selector
returns true then traversal continues to it's child pools otherwise it stops there and tries another pool. With
the traversal it finds all the leaf pools which are eligible for admitting the query and store that information in
<a href="../../../../../../org/apache/drill/exec/resourcemgr/config/QueueAssignmentResult.html" title="class in org.apache.drill.exec.resourcemgr.config"><code>QueueAssignmentResult</code></a>. Later the selected pools are passed to
configured QueueSelectionPolicy to select one queue for the query. Planner uses that selected queue's max query
memory per node parameter to limit resource assignment to all the fragments of a query on a node. After a query is
planned with resource constraints it is sent to leader of that queue to ask for admission. If admitted the query
required resources are reserved in global state store and query is executed on the cluster. For details please see
the design document and functional spec linked in <a href="https://issues.apache.org/jira/browse/DRILL-7026">
DRILL-7026</a></div>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/drill/exec/resourcemgr/package-summary.html">Prev&nbsp;Package</a></li>
<li><a href="../../../../../../org/apache/drill/exec/resourcemgr/config/exception/package-summary.html">Next&nbsp;Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/drill/exec/resourcemgr/config/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 1970 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>