blob: c80cee2a53defa9cdc945b4e2ddc09626e4b9905 [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>ReaderLifecycle (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="ReaderLifecycle (Drill : 1.20.3 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete 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/ReaderLifecycle.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/physical/impl/scan/v3/lifecycle/OutputBatchBuilder.MapSource.html" title="class in org.apache.drill.exec.physical.impl.scan.v3.lifecycle"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ScanEventListener.html" title="class in org.apache.drill.exec.physical.impl.scan.v3.lifecycle"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../../../index.html?org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ReaderLifecycle.html" target="_top">Frames</a></li>
<li><a href="ReaderLifecycle.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><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 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.scan.v3.lifecycle</div>
<h2 title="Class ReaderLifecycle" class="title">Class ReaderLifecycle</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.drill.exec.physical.impl.scan.v3.lifecycle.ReaderLifecycle</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html" title="interface in org.apache.drill.exec.physical.impl.scan">RowBatchReader</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">ReaderLifecycle</span>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
implements <a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html" title="interface in org.apache.drill.exec.physical.impl.scan">RowBatchReader</a></pre>
<div class="block">Manages the schema and batch construction for a managed reader. Allows the
reader itself to be as simple as possible. This class implements the basic
<a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html" title="interface in org.apache.drill.exec.physical.impl.scan"><code>RowBatchReader</code></a> protocol based on three methods, and converts it to
the two-method protocol of the managed reader. The <code>open()</code> call of the
<code>RowBatchReader</code> is combined with the constructor of the
<a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/ManagedReader.html" title="interface in org.apache.drill.exec.physical.impl.scan.v3"><code>ManagedReader</code></a>, enforcing the rule that the managed reader is created
just-in-time when it is to be used, which avoids accidentally holding
resources for the life of the scan. Also allows most of the reader's fields
to be <code>final</code>.
<p>
Coordinates the components that wrap a reader to create the final output
batch:
<ul>
<li>The actual reader which loads (possibly a subset of) the columns requested
from the input source.</li>
<li>Implicit columns manager instance which populates implicit file columns,
partition columns, and Drill's internal implicit columns.</li>
<li>The missing columns handler which "makes up" values for projected columns
not read by the reader.</li>
<li>Batch assembler, which combines the three sources of vectors to create
the output batch with the schema specified by the schema tracker.</li>
</ul>
<p>
This class coordinates the reader-visible aspects of the scan:
<ul>
<li>The <a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/SchemaNegotiator.html" title="interface in org.apache.drill.exec.physical.impl.scan.v3"><code>SchemaNegotiator</code></a> (or subclass) which provides schema-related
input to the reader and which creates the reader's <a href="../../../../../../../../../org/apache/drill/exec/physical/resultSet/ResultSetLoader.html" title="interface in org.apache.drill.exec.physical.resultSet"><code>ResultSetLoader</code></a>,
among other tasks. The schema negotiator is specific to each kind of scan and
is thus created via the <a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/ScanLifecycleBuilder.html" title="class in org.apache.drill.exec.physical.impl.scan.v3"><code>ScanLifecycleBuilder</code></a>.</li>
<li>The reader, which is designed to be as simple as possible, with all
generic overhead tasks handled by this "shim" between the scan operator and
the actual reader implementation.</li>
</ul>
<p>
The reader is schema-driven. See <a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/schema/ScanSchemaTracker.html" title="interface in org.apache.drill.exec.physical.impl.scan.v3.schema"><code>ScanSchemaTracker</code></a> for an overview.
<ul>
<li>The reader is given a <i>reader input schema</i>, via the schema
negotiator, which specifies the desired output schema. The schema can be
fully dynamic (a wildcard), fully defined (a prior reader already chose
column types), or a hybrid.</li>
<li>The reader can load a subset of columns. Those that are left out become
"missing columns" to be filled in by this class.</li>
<li>The <i>reader output schema</i> along with implicit and missing columns,
together define the scan's output schema.</li>
</ul>
<p>
The framework handles the projection task so the reader does not have to
worry about it. Reading an unwanted column is low cost: the result set loader
will have provided a "dummy" column writer that simply discards the value.
This is just as fast as having the reader use if-statements or a table to
determine which columns to save.</div>
</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>protected <a href="../../../../../../../../../org/apache/drill/exec/record/metadata/TupleMetadata.html" title="interface in org.apache.drill.exec.record.metadata">TupleMetadata</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ReaderLifecycle.html#readerInputSchema">readerInputSchema</a></span></code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <a href="../../../../../../../../../org/apache/drill/exec/physical/resultSet/ResultSetLoader.html" title="interface in org.apache.drill.exec.physical.resultSet">ResultSetLoader</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ReaderLifecycle.html#tableLoader">tableLoader</a></span></code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ReaderLifecycle.html#ReaderLifecycle-org.apache.drill.exec.physical.impl.scan.v3.lifecycle.ScanLifecycle-long-">ReaderLifecycle</a></span>(<a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ScanLifecycle.html" title="class in org.apache.drill.exec.physical.impl.scan.v3.lifecycle">ScanLifecycle</a>&nbsp;scanLifecycle,
long&nbsp;limit)</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="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="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="../../../../../../../../../org/apache/drill/exec/physical/resultSet/ResultSetLoader.html" title="interface in org.apache.drill.exec.physical.resultSet">ResultSetLoader</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ReaderLifecycle.html#buildLoader--">buildLoader</a></span>()</code>&nbsp;</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/scan/v3/lifecycle/ReaderLifecycle.html#close--">close</a></span>()</code>
<div class="block">Release resources.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ReaderLifecycle.html#defineSchema--">defineSchema</a></span>()</code>
<div class="block">Called for the first reader within a scan.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../../../org/apache/drill/common/exceptions/CustomErrorContext.html" title="interface in org.apache.drill.common.exceptions">CustomErrorContext</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ReaderLifecycle.html#errorContext--">errorContext</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/MissingColumnHandlerBuilder.html" title="class in org.apache.drill.exec.physical.impl.scan.v3.lifecycle">MissingColumnHandlerBuilder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ReaderLifecycle.html#missingColumnsBuilder-org.apache.drill.exec.record.metadata.TupleMetadata-">missingColumnsBuilder</a></span>(<a href="../../../../../../../../../org/apache/drill/exec/record/metadata/TupleMetadata.html" title="interface in org.apache.drill.exec.record.metadata">TupleMetadata</a>&nbsp;readerSchema)</code>&nbsp;</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ReaderLifecycle.html#name--">name</a></span>()</code>
<div class="block">Name used when reporting errors.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ReaderLifecycle.html#next--">next</a></span>()</code>
<div class="block">Read the next batch.</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/scan/v3/lifecycle/ReaderLifecycle.html#open--">open</a></span>()</code>
<div class="block">Setup the record reader.</div>
</td>
</tr>
<tr id="i8" 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/scan/v3/lifecycle/ReaderLifecycle.html#output--">output</a></span>()</code>
<div class="block">Return the container with the reader's output.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../../../org/apache/drill/exec/record/metadata/TupleMetadata.html" title="interface in org.apache.drill.exec.record.metadata">TupleMetadata</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ReaderLifecycle.html#readerInputSchema--">readerInputSchema</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="../../../../../../../../../org/apache/drill/exec/record/metadata/TupleMetadata.html" title="interface in org.apache.drill.exec.record.metadata">TupleMetadata</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ReaderLifecycle.html#readerOutputSchema--">readerOutputSchema</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ScanLifecycle.html" title="class in org.apache.drill.exec.physical.impl.scan.v3.lifecycle">ScanLifecycle</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ReaderLifecycle.html#scanLifecycle--">scanLifecycle</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/ScanLifecycleBuilder.html" title="class in org.apache.drill.exec.physical.impl.scan.v3">ScanLifecycleBuilder</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ReaderLifecycle.html#scanOptions--">scanOptions</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/schema/ScanSchemaTracker.html" title="interface in org.apache.drill.exec.physical.impl.scan.v3.schema">ScanSchemaTracker</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ReaderLifecycle.html#schemaTracker--">schemaTracker</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ReaderLifecycle.html#schemaVersion--">schemaVersion</a></span>()</code>
<div class="block">Return the version of the schema returned by <a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html#output--"><code>RowBatchReader.output()</code></a>.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code><a href="../../../../../../../../../org/apache/drill/exec/physical/resultSet/ResultSetLoader.html" title="interface in org.apache.drill.exec.physical.resultSet">ResultSetLoader</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ReaderLifecycle.html#tableLoader--">tableLoader</a></span>()</code>&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</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="readerInputSchema">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readerInputSchema</h4>
<pre>protected final&nbsp;<a href="../../../../../../../../../org/apache/drill/exec/record/metadata/TupleMetadata.html" title="interface in org.apache.drill.exec.record.metadata">TupleMetadata</a> readerInputSchema</pre>
</li>
</ul>
<a name="tableLoader">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>tableLoader</h4>
<pre>protected&nbsp;<a href="../../../../../../../../../org/apache/drill/exec/physical/resultSet/ResultSetLoader.html" title="interface in org.apache.drill.exec.physical.resultSet">ResultSetLoader</a> tableLoader</pre>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="ReaderLifecycle-org.apache.drill.exec.physical.impl.scan.v3.lifecycle.ScanLifecycle-long-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>ReaderLifecycle</h4>
<pre>public&nbsp;ReaderLifecycle(<a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ScanLifecycle.html" title="class in org.apache.drill.exec.physical.impl.scan.v3.lifecycle">ScanLifecycle</a>&nbsp;scanLifecycle,
long&nbsp;limit)</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="scanLifecycle--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>scanLifecycle</h4>
<pre>public&nbsp;<a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ScanLifecycle.html" title="class in org.apache.drill.exec.physical.impl.scan.v3.lifecycle">ScanLifecycle</a>&nbsp;scanLifecycle()</pre>
</li>
</ul>
<a name="readerInputSchema--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readerInputSchema</h4>
<pre>public&nbsp;<a href="../../../../../../../../../org/apache/drill/exec/record/metadata/TupleMetadata.html" title="interface in org.apache.drill.exec.record.metadata">TupleMetadata</a>&nbsp;readerInputSchema()</pre>
</li>
</ul>
<a name="errorContext--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>errorContext</h4>
<pre>public&nbsp;<a href="../../../../../../../../../org/apache/drill/common/exceptions/CustomErrorContext.html" title="interface in org.apache.drill.common.exceptions">CustomErrorContext</a>&nbsp;errorContext()</pre>
</li>
</ul>
<a name="schemaTracker--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>schemaTracker</h4>
<pre>public&nbsp;<a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/schema/ScanSchemaTracker.html" title="interface in org.apache.drill.exec.physical.impl.scan.v3.schema">ScanSchemaTracker</a>&nbsp;schemaTracker()</pre>
</li>
</ul>
<a name="scanOptions--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>scanOptions</h4>
<pre>public&nbsp;<a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/ScanLifecycleBuilder.html" title="class in org.apache.drill.exec.physical.impl.scan.v3">ScanLifecycleBuilder</a>&nbsp;scanOptions()</pre>
</li>
</ul>
<a name="name--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>name</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html#name--">RowBatchReader</a></code></span></div>
<div class="block">Name used when reporting errors. Can simply be the class name.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html#name--">name</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html" title="interface in org.apache.drill.exec.physical.impl.scan">RowBatchReader</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>display name for errors</dd>
</dl>
</li>
</ul>
<a name="tableLoader--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>tableLoader</h4>
<pre>public&nbsp;<a href="../../../../../../../../../org/apache/drill/exec/physical/resultSet/ResultSetLoader.html" title="interface in org.apache.drill.exec.physical.resultSet">ResultSetLoader</a>&nbsp;tableLoader()</pre>
</li>
</ul>
<a name="open--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>open</h4>
<pre>public&nbsp;boolean&nbsp;open()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html#open--">RowBatchReader</a></code></span></div>
<div class="block">Setup the record reader. Called just before the first call
to <code>next()</code>. Allocate resources here, not in the constructor.
Example: open files, allocate buffers, etc.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html#open--">open</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html" title="interface in org.apache.drill.exec.physical.impl.scan">RowBatchReader</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the reader is open and ready to read (possibly no)
rows. false for a "soft" failure in which no schema or data is available,
but the scanner should not fail, it should move onto another reader</dd>
</dl>
</li>
</ul>
<a name="buildLoader--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>buildLoader</h4>
<pre>public&nbsp;<a href="../../../../../../../../../org/apache/drill/exec/physical/resultSet/ResultSetLoader.html" title="interface in org.apache.drill.exec.physical.resultSet">ResultSetLoader</a>&nbsp;buildLoader()</pre>
</li>
</ul>
<a name="defineSchema--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>defineSchema</h4>
<pre>public&nbsp;boolean&nbsp;defineSchema()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html#defineSchema--">RowBatchReader</a></code></span></div>
<div class="block">Called for the first reader within a scan. Allows the reader to
provide an empty batch with only the schema filled in. Readers that
are "early schema" (know the schema up front) should return true
and create an empty batch. Readers that are "late schema" should
return false. In that case, the scan operator will ask the reader
to load an actual data batch, and infer the schema from that batch.
<p>
This step is optional and is purely for performance.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html#defineSchema--">defineSchema</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html" title="interface in org.apache.drill.exec.physical.impl.scan">RowBatchReader</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if this reader can (and has) defined an empty batch
to describe the schema, false otherwise</dd>
</dl>
</li>
</ul>
<a name="next--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>next</h4>
<pre>public&nbsp;boolean&nbsp;next()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html#next--">RowBatchReader</a></code></span></div>
<div class="block">Read the next batch. Reading continues until either EOF,
or until the mutator indicates that the batch is full.
The batch is considered valid if it is non-empty. Returning
<code>true</code> with an empty batch is valid, and is helpful on
the very first batch (returning schema only.) An empty batch
with a <code>false</code> return code indicates EOF and the batch
will be discarded. A non-empty batch along with a <code>false</code>
return result indicates a final, valid batch, but that EOF was
reached and no more data is available.
<p>
This somewhat complex protocol avoids the need to allocate a
final batch just to find out that no more data is available;
it allows EOF to be returned along with the final batch.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html#next--">next</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html" title="interface in org.apache.drill.exec.physical.impl.scan">RowBatchReader</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>true</code> if more data may be available (and so
<code>next()</code> should be called again, <code>false</code> to indicate
that EOF was reached</dd>
</dl>
</li>
</ul>
<a name="missingColumnsBuilder-org.apache.drill.exec.record.metadata.TupleMetadata-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>missingColumnsBuilder</h4>
<pre>public&nbsp;<a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/MissingColumnHandlerBuilder.html" title="class in org.apache.drill.exec.physical.impl.scan.v3.lifecycle">MissingColumnHandlerBuilder</a>&nbsp;missingColumnsBuilder(<a href="../../../../../../../../../org/apache/drill/exec/record/metadata/TupleMetadata.html" title="interface in org.apache.drill.exec.record.metadata">TupleMetadata</a>&nbsp;readerSchema)</pre>
</li>
</ul>
<a name="readerOutputSchema--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>readerOutputSchema</h4>
<pre>public&nbsp;<a href="../../../../../../../../../org/apache/drill/exec/record/metadata/TupleMetadata.html" title="interface in org.apache.drill.exec.record.metadata">TupleMetadata</a>&nbsp;readerOutputSchema()</pre>
</li>
</ul>
<a name="output--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>output</h4>
<pre>public&nbsp;<a href="../../../../../../../../../org/apache/drill/exec/record/VectorContainer.html" title="class in org.apache.drill.exec.record">VectorContainer</a>&nbsp;output()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html#output--">RowBatchReader</a></code></span></div>
<div class="block">Return the container with the reader's output. This method is called
at two times:
<ul>
<li>Directly after the call to <a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html#open--"><code>RowBatchReader.open()</code></a>. If the data source
can provide a schema at open time, then the reader should provide an
empty batch with the schema set. The scanner will return this schema
downstream to inform other operators of the schema.</li>
<li>Directly after a successful call to <a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html#next--"><code>RowBatchReader.next()</code></a> to retrieve
the batch produced by that call. (No call is made if <code>next()</code>
returns false.</li>
</ul>
Note that most operators require the same vectors be present in
each container. So, in practice, a reader must return the same
container, and same set of vectors, on each call.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html#output--">output</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html" title="interface in org.apache.drill.exec.physical.impl.scan">RowBatchReader</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a vector container, with the record count and schema
set, that announces the schema after <code>open()</code> (optional)
or returns rows read after <code>next()</code> (required)</dd>
</dl>
</li>
</ul>
<a name="schemaVersion--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>schemaVersion</h4>
<pre>public&nbsp;int&nbsp;schemaVersion()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html#schemaVersion--">RowBatchReader</a></code></span></div>
<div class="block">Return the version of the schema returned by <a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html#output--"><code>RowBatchReader.output()</code></a>. The schema
is assumed to start at -1 (no schema). The reader is free to use any
numbering system it likes as long as:
<ul>
<li>The numbers are non-negative, and increase (by any increment),</li>
<li>Numbers between successive calls are idential if the batch schemas are
identical,</li>
<li>The number increases if a batch has a different schema than the
previous batch.</li>
</ul>
Numbers increment (or not) on calls to <code>next()</code>. Thus Two successive
calls to this method should return the same number if no <code>next()</code>
call lies between.
<p>
If the reader can return a schema on open (so-called "early-schema), then
this method must return a non-negative version number, even if the schema
happens to be empty (such as reading an empty file.)
<p>
However, if the reader cannot return a schema on open (so-called "late
schema"), then this method must return -1 (and <code>output()</code> must
return null) to indicate now schema is available when called before the
first call to <code>next()</code>.
<p>
No calls will be made to this method before <code>open()</code> after
close(){@code or after {@code next()} returns false. The implementation
is thus not required to handle these cases.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html#schemaVersion--">schemaVersion</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html" title="interface in org.apache.drill.exec.physical.impl.scan">RowBatchReader</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the schema version, or -1 if no schema version is yet available</dd>
</dl>
</li>
</ul>
<a name="close--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>close</h4>
<pre>public&nbsp;void&nbsp;close()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html#close--">RowBatchReader</a></code></span></div>
<div class="block">Release resources. Called just after a failure, when the scanner
is cancelled, or after <code>next()</code> returns EOF. Release
all resources and close files. Guaranteed to be called if
<code>open()</code> returns normally; will not be called if <code>open()</code>
throws an exception.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html#close--">close</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/RowBatchReader.html" title="interface in org.apache.drill.exec.physical.impl.scan">RowBatchReader</a></code></dd>
</dl>
</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/ReaderLifecycle.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/physical/impl/scan/v3/lifecycle/OutputBatchBuilder.MapSource.html" title="class in org.apache.drill.exec.physical.impl.scan.v3.lifecycle"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../../../../../org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ScanEventListener.html" title="class in org.apache.drill.exec.physical.impl.scan.v3.lifecycle"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../../../../index.html?org/apache/drill/exec/physical/impl/scan/v3/lifecycle/ReaderLifecycle.html" target="_top">Frames</a></li>
<li><a href="ReaderLifecycle.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><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 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>