| <!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 --> |
| <title>CompressedSource.CompressedReader (Apache Beam 2.38.0-SNAPSHOT)</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="CompressedSource.CompressedReader (Apache Beam 2.38.0-SNAPSHOT)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":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="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/beam/sdk/io/CompressedSource.html" title="class in org.apache.beam.sdk.io"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressionMode.html" title="enum in org.apache.beam.sdk.io"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/beam/sdk/io/CompressedSource.CompressedReader.html" target="_top">Frames</a></li> |
| <li><a href="CompressedSource.CompressedReader.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../../allclasses-noframe.html">All 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: </li> |
| <li>Nested | </li> |
| <li><a href="#fields.inherited.from.class.org.apache.beam.sdk.io.BoundedSource.BoundedReader">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </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.beam.sdk.io</div> |
| <h2 title="Class CompressedSource.CompressedReader" class="title">Class CompressedSource.CompressedReader<T></h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li>java.lang.Object</li> |
| <li> |
| <ul class="inheritance"> |
| <li><a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html" title="class in org.apache.beam.sdk.io">org.apache.beam.sdk.io.Source.Reader</a><T></li> |
| <li> |
| <ul class="inheritance"> |
| <li><a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html" title="class in org.apache.beam.sdk.io">org.apache.beam.sdk.io.BoundedSource.BoundedReader</a><T></li> |
| <li> |
| <ul class="inheritance"> |
| <li><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html" title="class in org.apache.beam.sdk.io">org.apache.beam.sdk.io.OffsetBasedSource.OffsetBasedReader</a><T></li> |
| <li> |
| <ul class="inheritance"> |
| <li><a href="../../../../../org/apache/beam/sdk/io/FileBasedSource.FileBasedReader.html" title="class in org.apache.beam.sdk.io">org.apache.beam.sdk.io.FileBasedSource.FileBasedReader</a><T></li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.beam.sdk.io.CompressedSource.CompressedReader<T></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt><span class="paramLabel">Type Parameters:</span></dt> |
| <dd><code>T</code> - The type of records read from the source.</dd> |
| </dl> |
| <dl> |
| <dt>All Implemented Interfaces:</dt> |
| <dd>java.lang.AutoCloseable</dd> |
| </dl> |
| <dl> |
| <dt>Enclosing class:</dt> |
| <dd><a href="../../../../../org/apache/beam/sdk/io/CompressedSource.html" title="class in org.apache.beam.sdk.io">CompressedSource</a><<a href="../../../../../org/apache/beam/sdk/io/CompressedSource.html" title="type parameter in CompressedSource">T</a>></dd> |
| </dl> |
| <hr> |
| <br> |
| <pre>public static class <span class="typeNameLabel">CompressedSource.CompressedReader<T></span> |
| extends <a href="../../../../../org/apache/beam/sdk/io/FileBasedSource.FileBasedReader.html" title="class in org.apache.beam.sdk.io">FileBasedSource.FileBasedReader</a><T></pre> |
| <div class="block">Reader for a <a href="../../../../../org/apache/beam/sdk/io/CompressedSource.html" title="class in org.apache.beam.sdk.io"><code>CompressedSource</code></a>. Decompresses its input and uses a delegate reader to |
| read elements from the decompressed input.</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> |
| <ul class="blockList"> |
| <li class="blockList"><a name="fields.inherited.from.class.org.apache.beam.sdk.io.BoundedSource.BoundedReader"> |
| <!-- --> |
| </a> |
| <h3>Fields inherited from class org.apache.beam.sdk.io.<a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html" title="class in org.apache.beam.sdk.io">BoundedSource.BoundedReader</a></h3> |
| <code><a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html#SPLIT_POINTS_UNKNOWN">SPLIT_POINTS_UNKNOWN</a></code></li> |
| </ul> |
| </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"> </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/beam/sdk/io/CompressedSource.CompressedReader.html#CompressedReader-org.apache.beam.sdk.io.CompressedSource-org.apache.beam.sdk.io.FileBasedSource.FileBasedReader-">CompressedReader</a></span>(<a href="../../../../../org/apache/beam/sdk/io/CompressedSource.html" title="class in org.apache.beam.sdk.io">CompressedSource</a><<a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html" title="type parameter in CompressedSource.CompressedReader">T</a>> source, |
| <a href="../../../../../org/apache/beam/sdk/io/FileBasedSource.FileBasedReader.html" title="class in org.apache.beam.sdk.io">FileBasedSource.FileBasedReader</a><<a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html" title="type parameter in CompressedSource.CompressedReader">T</a>> readerDelegate)</code> |
| <div class="block">Create a <code>CompressedReader</code> from a <code>CompressedSource</code> and delegate reader.</div> |
| </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"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </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>boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html#allowsDynamicSplitting--">allowsDynamicSplitting</a></span>()</code> |
| <div class="block">Whether this reader should allow dynamic splitting of the offset ranges.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code><a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html" title="type parameter in CompressedSource.CompressedReader">T</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html#getCurrent--">getCurrent</a></span>()</code> |
| <div class="block">Gets the current record from the delegate reader.</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>protected long</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html#getCurrentOffset--">getCurrentOffset</a></span>()</code> |
| <div class="block">Returns the <i>starting</i> offset of the <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#getCurrent--"><code>current record</code></a>, |
| which has been read by the last successful <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#start--"><code>Source.Reader.start()</code></a> or <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#advance--"><code>Source.Reader.advance()</code></a> call.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code><a href="https://static.javadoc.io/joda-time/joda-time/2.10.10/org/joda/time/Instant.html?is-external=true" title="class or interface in org.joda.time">Instant</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html#getCurrentTimestamp--">getCurrentTimestamp</a></span>()</code> |
| <div class="block">By default, returns the minimum possible timestamp.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>long</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html#getSplitPointsConsumed--">getSplitPointsConsumed</a></span>()</code> |
| <div class="block">Returns the total amount of parallelism in the consumed (returned and processed) range of |
| this reader's current <a href="../../../../../org/apache/beam/sdk/io/BoundedSource.html" title="class in org.apache.beam.sdk.io"><code>BoundedSource</code></a> (as would be returned by <a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html#getCurrentSource--"><code>BoundedSource.BoundedReader.getCurrentSource()</code></a>).</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>long</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html#getSplitPointsRemaining--">getSplitPointsRemaining</a></span>()</code> |
| <div class="block">Returns the total amount of parallelism in the unprocessed part of this reader's current |
| <a href="../../../../../org/apache/beam/sdk/io/BoundedSource.html" title="class in org.apache.beam.sdk.io"><code>BoundedSource</code></a> (as would be returned by <a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html#getCurrentSource--"><code>BoundedSource.BoundedReader.getCurrentSource()</code></a>).</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html#isAtSplitPoint--">isAtSplitPoint</a></span>()</code> |
| <div class="block">Returns true only for the first record; compressed sources cannot be split.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html#readNextRecord--">readNextRecord</a></span>()</code> |
| <div class="block">Reads the next record via the delegate reader.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>protected void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html#startReading-java.nio.channels.ReadableByteChannel-">startReading</a></span>(java.nio.channels.ReadableByteChannel channel)</code> |
| <div class="block">Creates a decompressing channel from the input channel and passes it to its delegate reader's |
| <code>FileBasedReader#startReading(ReadableByteChannel)</code>.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.org.apache.beam.sdk.io.FileBasedSource.FileBasedReader"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class org.apache.beam.sdk.io.<a href="../../../../../org/apache/beam/sdk/io/FileBasedSource.FileBasedReader.html" title="class in org.apache.beam.sdk.io">FileBasedSource.FileBasedReader</a></h3> |
| <code><a href="../../../../../org/apache/beam/sdk/io/FileBasedSource.FileBasedReader.html#advanceImpl--">advanceImpl</a>, <a href="../../../../../org/apache/beam/sdk/io/FileBasedSource.FileBasedReader.html#close--">close</a>, <a href="../../../../../org/apache/beam/sdk/io/FileBasedSource.FileBasedReader.html#getCurrentSource--">getCurrentSource</a>, <a href="../../../../../org/apache/beam/sdk/io/FileBasedSource.FileBasedReader.html#startImpl--">startImpl</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.org.apache.beam.sdk.io.OffsetBasedSource.OffsetBasedReader"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class org.apache.beam.sdk.io.<a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html" title="class in org.apache.beam.sdk.io">OffsetBasedSource.OffsetBasedReader</a></h3> |
| <code><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html#advance--">advance</a>, <a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html#getFractionConsumed--">getFractionConsumed</a>, <a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html#isDone--">isDone</a>, <a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html#isStarted--">isStarted</a>, <a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html#splitAtFraction-double-">splitAtFraction</a>, <a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html#start--">start</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.Object</h3> |
| <code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="CompressedReader-org.apache.beam.sdk.io.CompressedSource-org.apache.beam.sdk.io.FileBasedSource.FileBasedReader-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>CompressedReader</h4> |
| <pre>public CompressedReader(<a href="../../../../../org/apache/beam/sdk/io/CompressedSource.html" title="class in org.apache.beam.sdk.io">CompressedSource</a><<a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html" title="type parameter in CompressedSource.CompressedReader">T</a>> source, |
| <a href="../../../../../org/apache/beam/sdk/io/FileBasedSource.FileBasedReader.html" title="class in org.apache.beam.sdk.io">FileBasedSource.FileBasedReader</a><<a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html" title="type parameter in CompressedSource.CompressedReader">T</a>> readerDelegate)</pre> |
| <div class="block">Create a <code>CompressedReader</code> from a <code>CompressedSource</code> and delegate reader.</div> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="getCurrent--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getCurrent</h4> |
| <pre>public <a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html" title="type parameter in CompressedSource.CompressedReader">T</a> getCurrent() |
| throws java.util.NoSuchElementException</pre> |
| <div class="block">Gets the current record from the delegate reader.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#getCurrent--">getCurrent</a></code> in class <code><a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html" title="class in org.apache.beam.sdk.io">Source.Reader</a><<a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html" title="type parameter in CompressedSource.CompressedReader">T</a>></code></dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.util.NoSuchElementException</code> - if <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#start--"><code>Source.Reader.start()</code></a> was never called, or if the last |
| <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#start--"><code>Source.Reader.start()</code></a> or <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#advance--"><code>Source.Reader.advance()</code></a> returned <code>false</code>.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="allowsDynamicSplitting--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>allowsDynamicSplitting</h4> |
| <pre>public boolean allowsDynamicSplitting()</pre> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from class: <code><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html#allowsDynamicSplitting--">OffsetBasedSource.OffsetBasedReader</a></code></span></div> |
| <div class="block">Whether this reader should allow dynamic splitting of the offset ranges. |
| |
| <p>True by default. Override this to return false if the reader cannot support dynamic |
| splitting correctly. If this returns false, <a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html#splitAtFraction-double-"><code>OffsetBasedSource.OffsetBasedReader.splitAtFraction(double)</code></a> will |
| refuse all split requests.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="../../../../../org/apache/beam/sdk/io/FileBasedSource.FileBasedReader.html#allowsDynamicSplitting--">allowsDynamicSplitting</a></code> in class <code><a href="../../../../../org/apache/beam/sdk/io/FileBasedSource.FileBasedReader.html" title="class in org.apache.beam.sdk.io">FileBasedSource.FileBasedReader</a><<a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html" title="type parameter in CompressedSource.CompressedReader">T</a>></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getSplitPointsConsumed--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getSplitPointsConsumed</h4> |
| <pre>public final long getSplitPointsConsumed()</pre> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from class: <code><a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html#getSplitPointsConsumed--">BoundedSource.BoundedReader</a></code></span></div> |
| <div class="block">Returns the total amount of parallelism in the consumed (returned and processed) range of |
| this reader's current <a href="../../../../../org/apache/beam/sdk/io/BoundedSource.html" title="class in org.apache.beam.sdk.io"><code>BoundedSource</code></a> (as would be returned by <a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html#getCurrentSource--"><code>BoundedSource.BoundedReader.getCurrentSource()</code></a>). This corresponds to all split point records (see <a href="../../../../../org/apache/beam/sdk/io/range/RangeTracker.html" title="interface in org.apache.beam.sdk.io.range"><code>RangeTracker</code></a>) |
| returned by this reader, <em>excluding</em> the last split point returned if the reader is |
| not finished. |
| |
| <p>Consider the following examples: (1) An input that can be read in parallel down to the |
| individual records, such as <a href="../../../../../org/apache/beam/sdk/io/CountingSource.html#upTo-long-"><code>CountingSource.upTo(long)</code></a>, is called "perfectly splittable". |
| (2) a "block-compressed" file format such as <a href="../../../../../org/apache/beam/sdk/io/AvroIO.html" title="class in org.apache.beam.sdk.io"><code>AvroIO</code></a>, in which a block of records has |
| to be read as a whole, but different blocks can be read in parallel. (3) An "unsplittable" |
| input such as a cursor in a database. |
| |
| <ul> |
| <li>Any <a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html" title="class in org.apache.beam.sdk.io"><code>reader</code></a> that is unstarted (aka, has never had a call to <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#start--"><code>Source.Reader.start()</code></a>) has a consumed parallelism of 0. This condition holds independent of whether |
| the input is splittable. |
| <li>Any <a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html" title="class in org.apache.beam.sdk.io"><code>reader</code></a> that has only returned its first element (aka, has |
| never had a call to <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#advance--"><code>Source.Reader.advance()</code></a>) has a consumed parallelism of 0: the first |
| element is the current element and is still being processed. This condition holds |
| independent of whether the input is splittable. |
| <li>For an empty reader (in which the call to <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#start--"><code>Source.Reader.start()</code></a> returned false), the consumed |
| parallelism is 0. This condition holds independent of whether the input is splittable. |
| <li>For a non-empty, finished reader (in which the call to <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#start--"><code>Source.Reader.start()</code></a> returned true and |
| a call to <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#advance--"><code>Source.Reader.advance()</code></a> has returned false), the value returned must be at least 1 |
| and should equal the total parallelism in the source. |
| <li>For example (1): After returning record #30 (starting at 1) out of 50 in a perfectly |
| splittable 50-record input, this value should be 29. When finished, the consumed |
| parallelism should be 50. |
| <li>For example (2): In a block-compressed value consisting of 5 blocks, the value should |
| stay at 0 until the first record of the second block is returned; stay at 1 until the |
| first record of the third block is returned, etc. Only once the end-of-file is reached |
| then the fifth block has been consumed and the value should stay at 5. |
| <li>For example (3): For any non-empty unsplittable input, the consumed parallelism is 0 |
| until the reader is finished (because the last call to <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#advance--"><code>Source.Reader.advance()</code></a> returned false, |
| at which point it becomes 1. |
| </ul> |
| |
| <p>A reader that is implemented using a <a href="../../../../../org/apache/beam/sdk/io/range/RangeTracker.html" title="interface in org.apache.beam.sdk.io.range"><code>RangeTracker</code></a> is encouraged to use the range |
| tracker's ability to count split points to implement this method. See <a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html" title="class in org.apache.beam.sdk.io"><code>OffsetBasedSource.OffsetBasedReader</code></a> and <a href="../../../../../org/apache/beam/sdk/io/range/OffsetRangeTracker.html" title="class in org.apache.beam.sdk.io.range"><code>OffsetRangeTracker</code></a> for an example. |
| |
| <p>Defaults to <a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html#SPLIT_POINTS_UNKNOWN"><code>BoundedSource.BoundedReader.SPLIT_POINTS_UNKNOWN</code></a>. Any value less than 0 will be interpreted as |
| unknown. |
| |
| <h3>Thread safety</h3> |
| |
| See the javadoc on <a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html" title="class in org.apache.beam.sdk.io"><code>BoundedSource.BoundedReader</code></a> for information about thread safety.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html#getSplitPointsConsumed--">getSplitPointsConsumed</a></code> in class <code><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html" title="class in org.apache.beam.sdk.io">OffsetBasedSource.OffsetBasedReader</a><<a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html" title="type parameter in CompressedSource.CompressedReader">T</a>></code></dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html#getSplitPointsRemaining--"><code>BoundedSource.BoundedReader.getSplitPointsRemaining()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getSplitPointsRemaining--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getSplitPointsRemaining</h4> |
| <pre>public final long getSplitPointsRemaining()</pre> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from class: <code><a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html#getSplitPointsRemaining--">BoundedSource.BoundedReader</a></code></span></div> |
| <div class="block">Returns the total amount of parallelism in the unprocessed part of this reader's current |
| <a href="../../../../../org/apache/beam/sdk/io/BoundedSource.html" title="class in org.apache.beam.sdk.io"><code>BoundedSource</code></a> (as would be returned by <a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html#getCurrentSource--"><code>BoundedSource.BoundedReader.getCurrentSource()</code></a>). This corresponds |
| to all unprocessed split point records (see <a href="../../../../../org/apache/beam/sdk/io/range/RangeTracker.html" title="interface in org.apache.beam.sdk.io.range"><code>RangeTracker</code></a>), including the last split |
| point returned, in the remainder part of the source. |
| |
| <p>This function should be implemented only <strong>in addition to <a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html#getSplitPointsConsumed--"><code>BoundedSource.BoundedReader.getSplitPointsConsumed()</code></a></strong> and only if <em>an exact value can be returned</em>. |
| |
| <p>Consider the following examples: (1) An input that can be read in parallel down to the |
| individual records, such as <a href="../../../../../org/apache/beam/sdk/io/CountingSource.html#upTo-long-"><code>CountingSource.upTo(long)</code></a>, is called "perfectly splittable". |
| (2) a "block-compressed" file format such as <a href="../../../../../org/apache/beam/sdk/io/AvroIO.html" title="class in org.apache.beam.sdk.io"><code>AvroIO</code></a>, in which a block of records has |
| to be read as a whole, but different blocks can be read in parallel. (3) An "unsplittable" |
| input such as a cursor in a database. |
| |
| <p>Assume for examples (1) and (2) that the number of records or blocks remaining is known: |
| |
| <ul> |
| <li>Any <a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html" title="class in org.apache.beam.sdk.io"><code>reader</code></a> for which the last call to <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#start--"><code>Source.Reader.start()</code></a> or <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#advance--"><code>Source.Reader.advance()</code></a> has returned true should should not return 0, because this reader itself |
| represents parallelism at least 1. This condition holds independent of whether the |
| input is splittable. |
| <li>A finished reader (for which <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#start--"><code>Source.Reader.start()</code></a> or <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#advance--"><code>Source.Reader.advance()</code></a>) has returned false |
| should return a value of 0. This condition holds independent of whether the input is |
| splittable. |
| <li>For example 1: After returning record #30 (starting at 1) out of 50 in a perfectly |
| splittable 50-record input, this value should be 21 (20 remaining + 1 current) if the |
| total number of records is known. |
| <li>For example 2: After returning a record in block 3 in a block-compressed file |
| consisting of 5 blocks, this value should be 3 (since blocks 4 and 5 can be processed |
| in parallel by new readers produced via dynamic work rebalancing, while the current |
| reader continues processing block 3) if the total number of blocks is known. |
| <li>For example (3): a reader for any non-empty unsplittable input, should return 1 until |
| it is finished, at which point it should return 0. |
| <li>For any reader: After returning the last split point in a file (e.g., the last record |
| in example (1), the first record in the last block for example (2), or the first record |
| in the file for example (3), this value should be 1: apart from the current task, no |
| additional remainder can be split off. |
| </ul> |
| |
| <p>Defaults to <a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html#SPLIT_POINTS_UNKNOWN"><code>BoundedSource.BoundedReader.SPLIT_POINTS_UNKNOWN</code></a>. Any value less than 0 will be interpreted as |
| unknown. |
| |
| <h3>Thread safety</h3> |
| |
| See the javadoc on <a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html" title="class in org.apache.beam.sdk.io"><code>BoundedSource.BoundedReader</code></a> for information about thread safety.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html#getSplitPointsRemaining--">getSplitPointsRemaining</a></code> in class <code><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html" title="class in org.apache.beam.sdk.io">OffsetBasedSource.OffsetBasedReader</a><<a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html" title="type parameter in CompressedSource.CompressedReader">T</a>></code></dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html#getSplitPointsConsumed--"><code>BoundedSource.BoundedReader.getSplitPointsConsumed()</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="isAtSplitPoint--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isAtSplitPoint</h4> |
| <pre>protected final boolean isAtSplitPoint()</pre> |
| <div class="block">Returns true only for the first record; compressed sources cannot be split.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html#isAtSplitPoint--">isAtSplitPoint</a></code> in class <code><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html" title="class in org.apache.beam.sdk.io">OffsetBasedSource.OffsetBasedReader</a><<a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html" title="type parameter in CompressedSource.CompressedReader">T</a>></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="startReading-java.nio.channels.ReadableByteChannel-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>startReading</h4> |
| <pre>protected final void startReading(java.nio.channels.ReadableByteChannel channel) |
| throws java.io.IOException</pre> |
| <div class="block">Creates a decompressing channel from the input channel and passes it to its delegate reader's |
| <code>FileBasedReader#startReading(ReadableByteChannel)</code>.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../../../../../org/apache/beam/sdk/io/FileBasedSource.FileBasedReader.html#startReading-java.nio.channels.ReadableByteChannel-">startReading</a></code> in class <code><a href="../../../../../org/apache/beam/sdk/io/FileBasedSource.FileBasedReader.html" title="class in org.apache.beam.sdk.io">FileBasedSource.FileBasedReader</a><<a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html" title="type parameter in CompressedSource.CompressedReader">T</a>></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>channel</code> - a byte channel representing the file backing the reader.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.io.IOException</code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="readNextRecord--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>readNextRecord</h4> |
| <pre>protected final boolean readNextRecord() |
| throws java.io.IOException</pre> |
| <div class="block">Reads the next record via the delegate reader.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../../../../../org/apache/beam/sdk/io/FileBasedSource.FileBasedReader.html#readNextRecord--">readNextRecord</a></code> in class <code><a href="../../../../../org/apache/beam/sdk/io/FileBasedSource.FileBasedReader.html" title="class in org.apache.beam.sdk.io">FileBasedSource.FileBasedReader</a><<a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html" title="type parameter in CompressedSource.CompressedReader">T</a>></code></dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd><code>true</code> if a record was successfully read, <code>false</code> if the end of the |
| channel was reached before successfully reading a new record.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.io.IOException</code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getCurrentOffset--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getCurrentOffset</h4> |
| <pre>protected final long getCurrentOffset() |
| throws java.util.NoSuchElementException</pre> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from class: <code><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html#getCurrentOffset--">OffsetBasedSource.OffsetBasedReader</a></code></span></div> |
| <div class="block">Returns the <i>starting</i> offset of the <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#getCurrent--"><code>current record</code></a>, |
| which has been read by the last successful <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#start--"><code>Source.Reader.start()</code></a> or <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#advance--"><code>Source.Reader.advance()</code></a> call. |
| |
| <p>If no such call has been made yet, the return value is unspecified. |
| |
| <p>See <a href="../../../../../org/apache/beam/sdk/io/range/RangeTracker.html" title="interface in org.apache.beam.sdk.io.range"><code>RangeTracker</code></a> for description of offset semantics.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html#getCurrentOffset--">getCurrentOffset</a></code> in class <code><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html" title="class in org.apache.beam.sdk.io">OffsetBasedSource.OffsetBasedReader</a><<a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html" title="type parameter in CompressedSource.CompressedReader">T</a>></code></dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.util.NoSuchElementException</code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getCurrentTimestamp--"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>getCurrentTimestamp</h4> |
| <pre>public <a href="https://static.javadoc.io/joda-time/joda-time/2.10.10/org/joda/time/Instant.html?is-external=true" title="class or interface in org.joda.time">Instant</a> getCurrentTimestamp() |
| throws java.util.NoSuchElementException</pre> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from class: <code><a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html#getCurrentTimestamp--">BoundedSource.BoundedReader</a></code></span></div> |
| <div class="block">By default, returns the minimum possible timestamp.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html#getCurrentTimestamp--">getCurrentTimestamp</a></code> in class <code><a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html" title="class in org.apache.beam.sdk.io">BoundedSource.BoundedReader</a><<a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressedReader.html" title="type parameter in CompressedSource.CompressedReader">T</a>></code></dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.util.NoSuchElementException</code> - if the reader is at the beginning of the input and <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#start--"><code>Source.Reader.start()</code></a> or <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#advance--"><code>Source.Reader.advance()</code></a> wasn't called, or if the last <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#start--"><code>Source.Reader.start()</code></a> or <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#advance--"><code>Source.Reader.advance()</code></a> returned <code>false</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="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/beam/sdk/io/CompressedSource.html" title="class in org.apache.beam.sdk.io"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../../org/apache/beam/sdk/io/CompressedSource.CompressionMode.html" title="enum in org.apache.beam.sdk.io"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../../index.html?org/apache/beam/sdk/io/CompressedSource.CompressedReader.html" target="_top">Frames</a></li> |
| <li><a href="CompressedSource.CompressedReader.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../../allclasses-noframe.html">All 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: </li> |
| <li>Nested | </li> |
| <li><a href="#fields.inherited.from.class.org.apache.beam.sdk.io.BoundedSource.BoundedReader">Field</a> | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| </body> |
| </html> |