blob: 57a9ef46f367c0b692fe496aaa4f9407ddf6e441 [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>RuleQueue (Apache Calcite API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../../../../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="RuleQueue (Apache Calcite API)";
}
}
catch(err) {
}
//-->
var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":9,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/RuleQueue.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" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</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>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.apache.calcite.plan.volcano</a></div>
<h2 title="Class RuleQueue" class="title">Class RuleQueue</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.calcite.plan.volcano.RuleQueue</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<pre>class <span class="typeNameLabel">RuleQueue</span>
extends java.lang.Object</pre>
<div class="block">Priority queue of relexps whose rules have not been called, and rule-matches
which have not yet been acted upon.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private static class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="RuleQueue.PhaseMatchList.html" title="class in org.apache.calcite.plan.volcano">RuleQueue.PhaseMatchList</a></span></code></th>
<td class="colLast">
<div class="block">PhaseMatchList represents a set of <a href="VolcanoRuleMatch.html" title="class in org.apache.calcite.plan.volcano"><code>rule-matches</code></a>
for a particular
<a href="VolcanoPlannerPhase.html" title="enum in org.apache.calcite.plan.volcano"><code>phase of the planner's execution</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="RuleQueue.RelImportanceComparator.html" title="class in org.apache.calcite.plan.volcano">RuleQueue.RelImportanceComparator</a></span></code></th>
<td class="colLast">
<div class="block">Compares <a href="../../rel/RelNode.html" title="interface in org.apache.calcite.rel"><code>RelNode</code></a> objects according to their cached 'importance'.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private static class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="RuleQueue.RuleMatchImportanceComparator.html" title="class in org.apache.calcite.plan.volcano">RuleQueue.RuleMatchImportanceComparator</a></span></code></th>
<td class="colLast">
<div class="block">Compares <a href="VolcanoRuleMatch.html" title="class in org.apache.calcite.plan.volcano"><code>VolcanoRuleMatch</code></a> objects according to their importance.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- =========== FIELD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Field</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private static java.util.Set&lt;java.lang.String&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#ALL_RULES">ALL_RULES</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>(package private) java.util.Set&lt;<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#boostedSubsets">boostedSubsets</a></span></code></th>
<td class="colLast">
<div class="block">The set of RelSubsets whose importance is currently in an artificially
raised state.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private static org.slf4j.Logger</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#LOGGER">LOGGER</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private static java.util.Comparator&lt;<a href="VolcanoRuleMatch.html" title="class in org.apache.calcite.plan.volcano">VolcanoRuleMatch</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#MATCH_COMPARATOR">MATCH_COMPARATOR</a></span></code></th>
<td class="colLast">
<div class="block">Sorts rule-matches into decreasing order of importance.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>(package private) java.util.Map&lt;<a href="VolcanoPlannerPhase.html" title="enum in org.apache.calcite.plan.volcano">VolcanoPlannerPhase</a>,&#8203;<a href="RuleQueue.PhaseMatchList.html" title="class in org.apache.calcite.plan.volcano">RuleQueue.PhaseMatchList</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#matchListMap">matchListMap</a></span></code></th>
<td class="colLast">
<div class="block">Map of <a href="VolcanoPlannerPhase.html" title="enum in org.apache.calcite.plan.volcano"><code>VolcanoPlannerPhase</code></a> to a list of rule-matches.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private static double</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#ONE_MINUS_EPSILON">ONE_MINUS_EPSILON</a></span></code></th>
<td class="colLast">
<div class="block">Largest value which is less than one.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private java.util.Map&lt;<a href="VolcanoPlannerPhase.html" title="enum in org.apache.calcite.plan.volcano">VolcanoPlannerPhase</a>,&#8203;java.util.Set&lt;java.lang.String&gt;&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#phaseRuleMapping">phaseRuleMapping</a></span></code></th>
<td class="colLast">
<div class="block">Maps a <a href="VolcanoPlannerPhase.html" title="enum in org.apache.calcite.plan.volcano"><code>VolcanoPlannerPhase</code></a> to a set of rule descriptions.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private <a href="VolcanoPlanner.html" title="class in org.apache.calcite.plan.volcano">VolcanoPlanner</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#planner">planner</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private com.google.common.collect.Ordering&lt;<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#relImportanceOrdering">relImportanceOrdering</a></span></code></th>
<td class="colLast">
<div class="block">Compares relexps according to their cached 'importance'.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>(package private) java.util.Map&lt;<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>,&#8203;java.lang.Double&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#subsetImportances">subsetImportances</a></span></code></th>
<td class="colLast">
<div class="block">The importance of each subset.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(org.apache.calcite.plan.volcano.VolcanoPlanner)">RuleQueue</a></span>&#8203;(<a href="VolcanoPlanner.html" title="class in org.apache.calcite.plan.volcano">VolcanoPlanner</a>&nbsp;planner)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>(package private) void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#addMatch(org.apache.calcite.plan.volcano.VolcanoRuleMatch)">addMatch</a></span>&#8203;(<a href="VolcanoRuleMatch.html" title="class in org.apache.calcite.plan.volcano">VolcanoRuleMatch</a>&nbsp;match)</code></th>
<td class="colLast">
<div class="block">Adds a rule match.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#boostImportance(java.util.Collection,double)">boostImportance</a></span>&#8203;(java.util.Collection&lt;<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>&gt;&nbsp;subsets,
double&nbsp;factor)</code></th>
<td class="colLast">
<div class="block">Artificially boosts the importance of the given <a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano"><code>RelSubset</code></a>s by a
given factor.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>private void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#checkDuplicateSubsets(java.util.Deque,org.apache.calcite.plan.RelOptRuleOperand,org.apache.calcite.rel.RelNode%5B%5D)">checkDuplicateSubsets</a></span>&#8203;(java.util.Deque&lt;<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>&gt;&nbsp;subsets,
<a href="../RelOptRuleOperand.html" title="class in org.apache.calcite.plan">RelOptRuleOperand</a>&nbsp;operand,
<a href="../../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>[]&nbsp;rels)</code></th>
<td class="colLast">
<div class="block">Recursively checks whether there are any duplicate subsets along any path
from root of the operand tree to one of the leaves.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#clear()">clear</a></span>()</code></th>
<td class="colLast">
<div class="block">Clear internal data structure for this rule queue.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>(package private) double</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#computeImportance(org.apache.calcite.plan.volcano.RelSubset)">computeImportance</a></span>&#8203;(<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>&nbsp;subset)</code></th>
<td class="colLast">
<div class="block">Computes the <dfn>importance</dfn> of a node.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>private double</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#computeImportanceOfChild(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.plan.volcano.RelSubset,org.apache.calcite.plan.volcano.RelSubset)">computeImportanceOfChild</a></span>&#8203;(<a href="../../rel/metadata/RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>&nbsp;child,
<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>&nbsp;parent)</code></th>
<td class="colLast">
<div class="block">Returns the importance of a child to a parent.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>private static double</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#computeOneMinusEpsilon()">computeOneMinusEpsilon</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>private void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#dump()">dump</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>private void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#dump(java.io.PrintWriter)">dump</a></span>&#8203;(java.io.PrintWriter&nbsp;pw)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>double</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getImportance(org.apache.calcite.plan.volcano.RelSet)">getImportance</a></span>&#8203;(<a href="RelSet.html" title="class in org.apache.calcite.plan.volcano">RelSet</a>&nbsp;set)</code></th>
<td class="colLast">
<div class="block">Computes the importance of a set (which is that of its most important
subset).</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>(package private) double</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getImportance(org.apache.calcite.plan.volcano.RelSubset)">getImportance</a></span>&#8203;(<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>&nbsp;rel)</code></th>
<td class="colLast">
<div class="block">Returns the importance of an equivalence class of relational expressions.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#phaseCompleted(org.apache.calcite.plan.volcano.VolcanoPlannerPhase)">phaseCompleted</a></span>&#8203;(<a href="VolcanoPlannerPhase.html" title="enum in org.apache.calcite.plan.volcano">VolcanoPlannerPhase</a>&nbsp;phase)</code></th>
<td class="colLast">
<div class="block">Removes the <a href="RuleQueue.PhaseMatchList.html" title="class in org.apache.calcite.plan.volcano"><code>rule-match list</code></a> for the given planner
phase.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>(package private) <a href="VolcanoRuleMatch.html" title="class in org.apache.calcite.plan.volcano">VolcanoRuleMatch</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#popMatch(org.apache.calcite.plan.volcano.VolcanoPlannerPhase)">popMatch</a></span>&#8203;(<a href="VolcanoPlannerPhase.html" title="enum in org.apache.calcite.plan.volcano">VolcanoPlannerPhase</a>&nbsp;phase)</code></th>
<td class="colLast">
<div class="block">Removes the rule match with the highest importance, and returns it.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#recompute(org.apache.calcite.plan.volcano.RelSubset)">recompute</a></span>&#8203;(<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>&nbsp;subset)</code></th>
<td class="colLast">
<div class="block">Equivalent to
<a href="#recompute(org.apache.calcite.plan.volcano.RelSubset,boolean)"><code>recompute(subset, false)</code></a>.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#recompute(org.apache.calcite.plan.volcano.RelSubset,boolean)">recompute</a></span>&#8203;(<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>&nbsp;subset,
boolean&nbsp;force)</code></th>
<td class="colLast">
<div class="block">Recomputes the importance of the given RelSubset.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>private boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#skipMatch(org.apache.calcite.plan.volcano.VolcanoRuleMatch)">skipMatch</a></span>&#8203;(<a href="VolcanoRuleMatch.html" title="class in org.apache.calcite.plan.volcano">VolcanoRuleMatch</a>&nbsp;match)</code></th>
<td class="colLast">
<div class="block">Returns whether to skip a match.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>private double</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toDouble(org.apache.calcite.plan.RelOptCost)">toDouble</a></span>&#8203;(<a href="../RelOptCost.html" title="interface in org.apache.calcite.plan">RelOptCost</a>&nbsp;cost)</code></th>
<td class="colLast">
<div class="block">Converts a cost to a scalar quantity.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>(package private) void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#updateImportance(org.apache.calcite.plan.volcano.RelSubset,java.lang.Double)">updateImportance</a></span>&#8203;(<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>&nbsp;subset,
java.lang.Double&nbsp;importance)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a id="LOGGER">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>LOGGER</h4>
<pre>private static final&nbsp;org.slf4j.Logger LOGGER</pre>
</li>
</ul>
<a id="ALL_RULES">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ALL_RULES</h4>
<pre>private static final&nbsp;java.util.Set&lt;java.lang.String&gt; ALL_RULES</pre>
</li>
</ul>
<a id="ONE_MINUS_EPSILON">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ONE_MINUS_EPSILON</h4>
<pre>private static final&nbsp;double ONE_MINUS_EPSILON</pre>
<div class="block">Largest value which is less than one.</div>
</li>
</ul>
<a id="subsetImportances">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>subsetImportances</h4>
<pre>final&nbsp;java.util.Map&lt;<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>,&#8203;java.lang.Double&gt; subsetImportances</pre>
<div class="block">The importance of each subset.</div>
</li>
</ul>
<a id="boostedSubsets">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>boostedSubsets</h4>
<pre>final&nbsp;java.util.Set&lt;<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>&gt; boostedSubsets</pre>
<div class="block">The set of RelSubsets whose importance is currently in an artificially
raised state. Typically this only includes RelSubsets which have only
logical RelNodes.</div>
</li>
</ul>
<a id="matchListMap">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>matchListMap</h4>
<pre>final&nbsp;java.util.Map&lt;<a href="VolcanoPlannerPhase.html" title="enum in org.apache.calcite.plan.volcano">VolcanoPlannerPhase</a>,&#8203;<a href="RuleQueue.PhaseMatchList.html" title="class in org.apache.calcite.plan.volcano">RuleQueue.PhaseMatchList</a>&gt; matchListMap</pre>
<div class="block">Map of <a href="VolcanoPlannerPhase.html" title="enum in org.apache.calcite.plan.volcano"><code>VolcanoPlannerPhase</code></a> to a list of rule-matches. Initially,
there is an empty <a href="RuleQueue.PhaseMatchList.html" title="class in org.apache.calcite.plan.volcano"><code>RuleQueue.PhaseMatchList</code></a> for each planner phase. As the
planner invokes <a href="#addMatch(org.apache.calcite.plan.volcano.VolcanoRuleMatch)"><code>addMatch(VolcanoRuleMatch)</code></a> the rule-match is
added to the appropriate PhaseMatchList(s). As the planner completes
phases, the matching entry is removed from this list to avoid unused
work.</div>
</li>
</ul>
<a id="MATCH_COMPARATOR">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>MATCH_COMPARATOR</h4>
<pre>private static final&nbsp;java.util.Comparator&lt;<a href="VolcanoRuleMatch.html" title="class in org.apache.calcite.plan.volcano">VolcanoRuleMatch</a>&gt; MATCH_COMPARATOR</pre>
<div class="block">Sorts rule-matches into decreasing order of importance.</div>
</li>
</ul>
<a id="planner">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>planner</h4>
<pre>private final&nbsp;<a href="VolcanoPlanner.html" title="class in org.apache.calcite.plan.volcano">VolcanoPlanner</a> planner</pre>
</li>
</ul>
<a id="relImportanceOrdering">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>relImportanceOrdering</h4>
<pre>private final&nbsp;com.google.common.collect.Ordering&lt;<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>&gt; relImportanceOrdering</pre>
<div class="block">Compares relexps according to their cached 'importance'.</div>
</li>
</ul>
<a id="phaseRuleMapping">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>phaseRuleMapping</h4>
<pre>private final&nbsp;java.util.Map&lt;<a href="VolcanoPlannerPhase.html" title="enum in org.apache.calcite.plan.volcano">VolcanoPlannerPhase</a>,&#8203;java.util.Set&lt;java.lang.String&gt;&gt; phaseRuleMapping</pre>
<div class="block">Maps a <a href="VolcanoPlannerPhase.html" title="enum in org.apache.calcite.plan.volcano"><code>VolcanoPlannerPhase</code></a> to a set of rule descriptions. Named rules
may be invoked in their corresponding phase.
<p>See <a href="VolcanoPlannerPhaseRuleMappingInitializer.html" title="interface in org.apache.calcite.plan.volcano"><code>VolcanoPlannerPhaseRuleMappingInitializer</code></a> for more
information regarding the contents of this Map and how it is initialized.</div>
</li>
</ul>
</li>
</ul>
</section>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a id="&lt;init&gt;(org.apache.calcite.plan.volcano.VolcanoPlanner)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>RuleQueue</h4>
<pre>RuleQueue&#8203;(<a href="VolcanoPlanner.html" title="class in org.apache.calcite.plan.volcano">VolcanoPlanner</a>&nbsp;planner)</pre>
</li>
</ul>
</li>
</ul>
</section>
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="clear()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clear</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;clear()</pre>
<div class="block">Clear internal data structure for this rule queue.</div>
</li>
</ul>
<a id="phaseCompleted(org.apache.calcite.plan.volcano.VolcanoPlannerPhase)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>phaseCompleted</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;phaseCompleted&#8203;(<a href="VolcanoPlannerPhase.html" title="enum in org.apache.calcite.plan.volcano">VolcanoPlannerPhase</a>&nbsp;phase)</pre>
<div class="block">Removes the <a href="RuleQueue.PhaseMatchList.html" title="class in org.apache.calcite.plan.volcano"><code>rule-match list</code></a> for the given planner
phase.</div>
</li>
</ul>
<a id="getImportance(org.apache.calcite.plan.volcano.RelSet)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getImportance</h4>
<pre class="methodSignature">public&nbsp;double&nbsp;getImportance&#8203;(<a href="RelSet.html" title="class in org.apache.calcite.plan.volcano">RelSet</a>&nbsp;set)</pre>
<div class="block">Computes the importance of a set (which is that of its most important
subset).</div>
</li>
</ul>
<a id="recompute(org.apache.calcite.plan.volcano.RelSubset,boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>recompute</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;recompute&#8203;(<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>&nbsp;subset,
boolean&nbsp;force)</pre>
<div class="block">Recomputes the importance of the given RelSubset.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>subset</code> - RelSubset whose importance is to be recomputed</dd>
<dd><code>force</code> - if true, forces an importance update even if the subset has
not been registered</dd>
</dl>
</li>
</ul>
<a id="recompute(org.apache.calcite.plan.volcano.RelSubset)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>recompute</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;recompute&#8203;(<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>&nbsp;subset)</pre>
<div class="block">Equivalent to
<a href="#recompute(org.apache.calcite.plan.volcano.RelSubset,boolean)"><code>recompute(subset, false)</code></a>.</div>
</li>
</ul>
<a id="boostImportance(java.util.Collection,double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>boostImportance</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;boostImportance&#8203;(java.util.Collection&lt;<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>&gt;&nbsp;subsets,
double&nbsp;factor)</pre>
<div class="block">Artificially boosts the importance of the given <a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano"><code>RelSubset</code></a>s by a
given factor.
<p>Iterates over the currently boosted RelSubsets and removes their
importance boost, forcing a recalculation of the RelSubsets' importances
(see <a href="#recompute(org.apache.calcite.plan.volcano.RelSubset)"><code>recompute(RelSubset)</code></a>).
<p>Once RelSubsets have been restored to their normal importance, the
given RelSubsets have their importances boosted. A RelSubset's boosted
importance is always less than 1.0 (and never equal to 1.0).</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>subsets</code> - RelSubsets to boost importance (priority)</dd>
<dd><code>factor</code> - the amount to boost their importances (e.g., 1.25 increases
importance by 25%)</dd>
</dl>
</li>
</ul>
<a id="updateImportance(org.apache.calcite.plan.volcano.RelSubset,java.lang.Double)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>updateImportance</h4>
<pre class="methodSignature">void&nbsp;updateImportance&#8203;(<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>&nbsp;subset,
java.lang.Double&nbsp;importance)</pre>
</li>
</ul>
<a id="getImportance(org.apache.calcite.plan.volcano.RelSubset)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getImportance</h4>
<pre class="methodSignature">double&nbsp;getImportance&#8203;(<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>&nbsp;rel)</pre>
<div class="block">Returns the importance of an equivalence class of relational expressions.
Subset importances are held in a lookup table, and importance changes
gradually propagate through that table.
<p>If a subset in the same set but with a different calling convention is
deemed to be important, then this subset has at least half of its
importance. (This rule is designed to encourage conversions to take
place.)</p></div>
</li>
</ul>
<a id="addMatch(org.apache.calcite.plan.volcano.VolcanoRuleMatch)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addMatch</h4>
<pre class="methodSignature">void&nbsp;addMatch&#8203;(<a href="VolcanoRuleMatch.html" title="class in org.apache.calcite.plan.volcano">VolcanoRuleMatch</a>&nbsp;match)</pre>
<div class="block">Adds a rule match. The rule-matches are automatically added to all
existing <a href="RuleQueue.PhaseMatchList.html" title="class in org.apache.calcite.plan.volcano"><code>per-phase rule-match lists</code></a> which allow
the rule referenced by the match.</div>
</li>
</ul>
<a id="computeImportance(org.apache.calcite.plan.volcano.RelSubset)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>computeImportance</h4>
<pre class="methodSignature">double&nbsp;computeImportance&#8203;(<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>&nbsp;subset)</pre>
<div class="block">Computes the <dfn>importance</dfn> of a node. Importance is defined as
follows:
<ul>
<li>the root <a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano"><code>RelSubset</code></a> has an importance of 1</li>
<li>the importance of any other subset is the max of its importance to
its parents</li>
<li>The importance of children is pro-rated according to the cost of the
children. Consider a node which has a cost of 3, and children with costs
of 2 and 5. The total cost is 10. If the node has an importance of .5,
then the children will have importance of .1 and .25. The retains .15
importance points, to reflect the fact that work needs to be done on the
node's algorithm.</li>
</ul>
<p>The formula for the importance <i>I</i> of node n is:
<blockquote>I<sub>n</sub> = Max<sub>parents p of n</sub>{I<sub>p</sub> .
W <sub>n, p</sub>}</blockquote>
<p>where W<sub>n, p</sub>, the weight of n within its parent p, is
<blockquote>W<sub>n, p</sub> = Cost<sub>n</sub> / (SelfCost<sub>p</sub> +
Cost<sub>n0</sub> + ... + Cost<sub>nk</sub>)
</blockquote></div>
</li>
</ul>
<a id="dump()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>dump</h4>
<pre class="methodSignature">private&nbsp;void&nbsp;dump()</pre>
</li>
</ul>
<a id="dump(java.io.PrintWriter)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>dump</h4>
<pre class="methodSignature">private&nbsp;void&nbsp;dump&#8203;(java.io.PrintWriter&nbsp;pw)</pre>
</li>
</ul>
<a id="popMatch(org.apache.calcite.plan.volcano.VolcanoPlannerPhase)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>popMatch</h4>
<pre class="methodSignature"><a href="VolcanoRuleMatch.html" title="class in org.apache.calcite.plan.volcano">VolcanoRuleMatch</a>&nbsp;popMatch&#8203;(<a href="VolcanoPlannerPhase.html" title="enum in org.apache.calcite.plan.volcano">VolcanoPlannerPhase</a>&nbsp;phase)</pre>
<div class="block">Removes the rule match with the highest importance, and returns it.
<p>Returns <code>null</code> if there are no more matches.</p>
<p>Note that the VolcanoPlanner may still decide to reject rule matches
which have become invalid, say if one of their operands belongs to an
obsolete set or has importance=0.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.AssertionError</code> - if this method is called with a phase
previously marked as completed via
<a href="#phaseCompleted(org.apache.calcite.plan.volcano.VolcanoPlannerPhase)"><code>phaseCompleted(VolcanoPlannerPhase)</code></a>.</dd>
</dl>
</li>
</ul>
<a id="skipMatch(org.apache.calcite.plan.volcano.VolcanoRuleMatch)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>skipMatch</h4>
<pre class="methodSignature">private&nbsp;boolean&nbsp;skipMatch&#8203;(<a href="VolcanoRuleMatch.html" title="class in org.apache.calcite.plan.volcano">VolcanoRuleMatch</a>&nbsp;match)</pre>
<div class="block">Returns whether to skip a match. This happens if any of the
<a href="../../rel/RelNode.html" title="interface in org.apache.calcite.rel"><code>RelNode</code></a>s have importance zero.</div>
</li>
</ul>
<a id="checkDuplicateSubsets(java.util.Deque,org.apache.calcite.plan.RelOptRuleOperand,org.apache.calcite.rel.RelNode[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>checkDuplicateSubsets</h4>
<pre class="methodSignature">private&nbsp;void&nbsp;checkDuplicateSubsets&#8203;(java.util.Deque&lt;<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>&gt;&nbsp;subsets,
<a href="../RelOptRuleOperand.html" title="class in org.apache.calcite.plan">RelOptRuleOperand</a>&nbsp;operand,
<a href="../../rel/RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>[]&nbsp;rels)</pre>
<div class="block">Recursively checks whether there are any duplicate subsets along any path
from root of the operand tree to one of the leaves.
<p>It is OK for a match to have duplicate subsets if they are not on the
same path. For example,
<blockquote><pre>
Join
/ \
X X
</pre></blockquote>
<p>is a valid match.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../util/Util.FoundOne.html" title="class in org.apache.calcite.util">Util.FoundOne</a></code> - on match</dd>
</dl>
</li>
</ul>
<a id="computeImportanceOfChild(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.plan.volcano.RelSubset,org.apache.calcite.plan.volcano.RelSubset)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>computeImportanceOfChild</h4>
<pre class="methodSignature">private&nbsp;double&nbsp;computeImportanceOfChild&#8203;(<a href="../../rel/metadata/RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>&nbsp;child,
<a href="RelSubset.html" title="class in org.apache.calcite.plan.volcano">RelSubset</a>&nbsp;parent)</pre>
<div class="block">Returns the importance of a child to a parent. This is defined by the
importance of the parent, pro-rated by the cost of the child. For
example, if the parent has importance = 0.8 and cost 100, then a child
with cost 50 will have importance 0.4, and a child with cost 25 will have
importance 0.2.</div>
</li>
</ul>
<a id="toDouble(org.apache.calcite.plan.RelOptCost)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toDouble</h4>
<pre class="methodSignature">private&nbsp;double&nbsp;toDouble&#8203;(<a href="../RelOptCost.html" title="interface in org.apache.calcite.plan">RelOptCost</a>&nbsp;cost)</pre>
<div class="block">Converts a cost to a scalar quantity.</div>
</li>
</ul>
<a id="computeOneMinusEpsilon()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>computeOneMinusEpsilon</h4>
<pre class="methodSignature">private static&nbsp;double&nbsp;computeOneMinusEpsilon()</pre>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/RuleQueue.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" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses.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>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright &#169; 2012&#x2013;2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</body>
</html>