blob: eca8061080baa425111e0395ba66032496782192 [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>PriorityQueue (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="PriorityQueue (Drill : 1.20.3 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</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><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/PriorityQueue.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>Prev&nbsp;Class</li>
<li><a href="../../../../../../../org/apache/drill/exec/physical/impl/TopN/PriorityQueueTemplate.html" title="class in org.apache.drill.exec.physical.impl.TopN"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/drill/exec/physical/impl/TopN/PriorityQueue.html" target="_top">Frames</a></li>
<li><a href="PriorityQueue.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>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&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>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.drill.exec.physical.impl.TopN</div>
<h2 title="Interface PriorityQueue" class="title">Interface PriorityQueue</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../../../../../org/apache/drill/exec/physical/impl/TopN/PriorityQueueTemplate.html" title="class in org.apache.drill.exec.physical.impl.TopN">PriorityQueueTemplate</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">PriorityQueue</span></pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../../../../org/apache/drill/exec/compile/TemplateClassDefinition.html" title="class in org.apache.drill.exec.compile">TemplateClassDefinition</a>&lt;<a href="../../../../../../../org/apache/drill/exec/physical/impl/TopN/PriorityQueue.html" title="interface in org.apache.drill.exec.physical.impl.TopN">PriorityQueue</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/drill/exec/physical/impl/TopN/PriorityQueue.html#TEMPLATE_DEFINITION">TEMPLATE_DEFINITION</a></span></code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</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="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/drill/exec/physical/impl/TopN/PriorityQueue.html#add-org.apache.drill.exec.physical.impl.sort.RecordBatchData-">add</a></span>(<a href="../../../../../../../org/apache/drill/exec/physical/impl/sort/RecordBatchData.html" title="class in org.apache.drill.exec.physical.impl.sort">RecordBatchData</a>&nbsp;batch)</code>
<div class="block">The elements in the given batch are added to the priority queue.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/drill/exec/physical/impl/TopN/PriorityQueue.html#cleanup--">cleanup</a></span>()</code>
<div class="block">Releases all the memory consumed by the priority queue.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/drill/exec/physical/impl/TopN/PriorityQueue.html#generate--">generate</a></span>()</code>
<div class="block">This method must be called before fetching the final priority queue hyper batch and final Sv4 vector.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../org/apache/drill/exec/record/selection/SelectionVector4.html" title="class in org.apache.drill.exec.record.selection">SelectionVector4</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/drill/exec/physical/impl/TopN/PriorityQueue.html#getFinalSv4--">getFinalSv4</a></span>()</code>
<div class="block">Retrieves the selection vector used to select the elements in the priority queue from the hyper batch
provided by the <a href="../../../../../../../org/apache/drill/exec/physical/impl/TopN/PriorityQueue.html#getHyperBatch--"><code>getHyperBatch()</code></a> method.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../../../../../org/apache/drill/exec/record/VectorContainer.html" title="class in org.apache.drill.exec.record">VectorContainer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/drill/exec/physical/impl/TopN/PriorityQueue.html#getHyperBatch--">getHyperBatch</a></span>()</code>
<div class="block">Retrieves the final priority queue HyperBatch containing the results.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../org/apache/drill/exec/record/selection/SelectionVector4.html" title="class in org.apache.drill.exec.record.selection">SelectionVector4</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/drill/exec/physical/impl/TopN/PriorityQueue.html#getSv4--">getSv4</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/drill/exec/physical/impl/TopN/PriorityQueue.html#init-int-org.apache.drill.exec.memory.BufferAllocator-boolean-">init</a></span>(int&nbsp;limit,
<a href="../../../../../../../org/apache/drill/exec/memory/BufferAllocator.html" title="interface in org.apache.drill.exec.memory">BufferAllocator</a>&nbsp;allocator,
boolean&nbsp;hasSv2)</code>
<div class="block">Initializes the priority queue.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/drill/exec/physical/impl/TopN/PriorityQueue.html#isInitialized--">isInitialized</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../org/apache/drill/exec/physical/impl/TopN/PriorityQueue.html#resetQueue-org.apache.drill.exec.record.VectorContainer-org.apache.drill.exec.record.selection.SelectionVector4-">resetQueue</a></span>(<a href="../../../../../../../org/apache/drill/exec/record/VectorContainer.html" title="class in org.apache.drill.exec.record">VectorContainer</a>&nbsp;container,
<a href="../../../../../../../org/apache/drill/exec/record/selection/SelectionVector4.html" title="class in org.apache.drill.exec.record.selection">SelectionVector4</a>&nbsp;vector4)</code>
<div class="block">Cleanup the old state of queue and recreate a new one with HyperContainer containing vectors in input container
and the corresponding indexes (in SV4 format) from input SelectionVector4</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="TEMPLATE_DEFINITION">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>TEMPLATE_DEFINITION</h4>
<pre>static final&nbsp;<a href="../../../../../../../org/apache/drill/exec/compile/TemplateClassDefinition.html" title="class in org.apache.drill.exec.compile">TemplateClassDefinition</a>&lt;<a href="../../../../../../../org/apache/drill/exec/physical/impl/TopN/PriorityQueue.html" title="interface in org.apache.drill.exec.physical.impl.TopN">PriorityQueue</a>&gt; TEMPLATE_DEFINITION</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="add-org.apache.drill.exec.physical.impl.sort.RecordBatchData-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>add</h4>
<pre>void&nbsp;add(<a href="../../../../../../../org/apache/drill/exec/physical/impl/sort/RecordBatchData.html" title="class in org.apache.drill.exec.physical.impl.sort">RecordBatchData</a>&nbsp;batch)
throws <a href="../../../../../../../org/apache/drill/exec/exception/SchemaChangeException.html" title="class in org.apache.drill.exec.exception">SchemaChangeException</a></pre>
<div class="block">The elements in the given batch are added to the priority queue. Note that the priority queue
only retains the top elements that fit within the size specified by the <a href="../../../../../../../org/apache/drill/exec/physical/impl/TopN/PriorityQueue.html#init-int-org.apache.drill.exec.memory.BufferAllocator-boolean-"><code>init(int, BufferAllocator, boolean)</code></a>
method.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>batch</code> - The batch containing elements we want to add.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/drill/exec/exception/SchemaChangeException.html" title="class in org.apache.drill.exec.exception">SchemaChangeException</a></code></dd>
</dl>
</li>
</ul>
<a name="init-int-org.apache.drill.exec.memory.BufferAllocator-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>init</h4>
<pre>void&nbsp;init(int&nbsp;limit,
<a href="../../../../../../../org/apache/drill/exec/memory/BufferAllocator.html" title="interface in org.apache.drill.exec.memory">BufferAllocator</a>&nbsp;allocator,
boolean&nbsp;hasSv2)
throws <a href="../../../../../../../org/apache/drill/exec/exception/SchemaChangeException.html" title="class in org.apache.drill.exec.exception">SchemaChangeException</a></pre>
<div class="block">Initializes the priority queue. This method must be called before any other methods on the priority
queue are called.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>limit</code> - The size of the priority queue.</dd>
<dd><code>allocator</code> - The <a href="../../../../../../../org/apache/drill/exec/memory/BufferAllocator.html" title="interface in org.apache.drill.exec.memory"><code>BufferAllocator</code></a> to use when creating the priority queue.</dd>
<dd><code>hasSv2</code> - True when incoming batches have 2 byte selection vectors. False otherwise.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/drill/exec/exception/SchemaChangeException.html" title="class in org.apache.drill.exec.exception">SchemaChangeException</a></code></dd>
</dl>
</li>
</ul>
<a name="generate--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>generate</h4>
<pre>void&nbsp;generate()</pre>
<div class="block">This method must be called before fetching the final priority queue hyper batch and final Sv4 vector.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/drill/exec/exception/SchemaChangeException.html" title="class in org.apache.drill.exec.exception">SchemaChangeException</a></code></dd>
</dl>
</li>
</ul>
<a name="getHyperBatch--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getHyperBatch</h4>
<pre><a href="../../../../../../../org/apache/drill/exec/record/VectorContainer.html" title="class in org.apache.drill.exec.record">VectorContainer</a>&nbsp;getHyperBatch()</pre>
<div class="block">Retrieves the final priority queue HyperBatch containing the results. <b>Note:</b> this should be called
after <a href="../../../../../../../org/apache/drill/exec/physical/impl/TopN/PriorityQueue.html#generate--"><code>generate()</code></a>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The final priority queue HyperBatch containing the results.</dd>
</dl>
</li>
</ul>
<a name="getSv4--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSv4</h4>
<pre><a href="../../../../../../../org/apache/drill/exec/record/selection/SelectionVector4.html" title="class in org.apache.drill.exec.record.selection">SelectionVector4</a>&nbsp;getSv4()</pre>
</li>
</ul>
<a name="getFinalSv4--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFinalSv4</h4>
<pre><a href="../../../../../../../org/apache/drill/exec/record/selection/SelectionVector4.html" title="class in org.apache.drill.exec.record.selection">SelectionVector4</a>&nbsp;getFinalSv4()</pre>
<div class="block">Retrieves the selection vector used to select the elements in the priority queue from the hyper batch
provided by the <a href="../../../../../../../org/apache/drill/exec/physical/impl/TopN/PriorityQueue.html#getHyperBatch--"><code>getHyperBatch()</code></a> method. <b>Note:</b> this should be called after <a href="../../../../../../../org/apache/drill/exec/physical/impl/TopN/PriorityQueue.html#generate--"><code>generate()</code></a>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The selection vector used to select the elements in the priority queue.</dd>
</dl>
</li>
</ul>
<a name="resetQueue-org.apache.drill.exec.record.VectorContainer-org.apache.drill.exec.record.selection.SelectionVector4-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resetQueue</h4>
<pre>void&nbsp;resetQueue(<a href="../../../../../../../org/apache/drill/exec/record/VectorContainer.html" title="class in org.apache.drill.exec.record">VectorContainer</a>&nbsp;container,
<a href="../../../../../../../org/apache/drill/exec/record/selection/SelectionVector4.html" title="class in org.apache.drill.exec.record.selection">SelectionVector4</a>&nbsp;vector4)
throws <a href="../../../../../../../org/apache/drill/exec/exception/SchemaChangeException.html" title="class in org.apache.drill.exec.exception">SchemaChangeException</a></pre>
<div class="block">Cleanup the old state of queue and recreate a new one with HyperContainer containing vectors in input container
and the corresponding indexes (in SV4 format) from input SelectionVector4</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>container</code> - </dd>
<dd><code>vector4</code> - </dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../../../../../../org/apache/drill/exec/exception/SchemaChangeException.html" title="class in org.apache.drill.exec.exception">SchemaChangeException</a></code></dd>
</dl>
</li>
</ul>
<a name="cleanup--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>cleanup</h4>
<pre>void&nbsp;cleanup()</pre>
<div class="block">Releases all the memory consumed by the priority queue.</div>
</li>
</ul>
<a name="isInitialized--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>isInitialized</h4>
<pre>boolean&nbsp;isInitialized()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= 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><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/PriorityQueue.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>Prev&nbsp;Class</li>
<li><a href="../../../../../../../org/apache/drill/exec/physical/impl/TopN/PriorityQueueTemplate.html" title="class in org.apache.drill.exec.physical.impl.TopN"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../index.html?org/apache/drill/exec/physical/impl/TopN/PriorityQueue.html" target="_top">Frames</a></li>
<li><a href="PriorityQueue.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>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li>Constr&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>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</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>