| <!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 (1.8.0_181-google-v7) on Mon Jan 27 16:42:32 PST 2020 --> |
| <title>BlockBasedSource.BlockBasedReader (Apache Beam 2.20.0-SNAPSHOT)</title> |
| <meta name="date" content="2020-01-27"> |
| <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="BlockBasedSource.BlockBasedReader (Apache Beam 2.20.0-SNAPSHOT)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":10,"i1":6,"i2":6,"i3":6,"i4":10,"i5":10,"i6":10,"i7":6,"i8":10}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract 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/BlockBasedSource.Block.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/BoundedReadFromUnboundedSource.html" title="class 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/BlockBasedSource.BlockBasedReader.html" target="_top">Frames</a></li> |
| <li><a href="BlockBasedSource.BlockBasedReader.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 BlockBasedSource.BlockBasedReader" class="title">Class BlockBasedSource.BlockBasedReader<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.BlockBasedSource.BlockBasedReader<T></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Implemented Interfaces:</dt> |
| <dd>java.lang.AutoCloseable</dd> |
| </dl> |
| <dl> |
| <dt>Direct Known Subclasses:</dt> |
| <dd><a href="../../../../../org/apache/beam/sdk/io/AvroSource.AvroReader.html" title="class in org.apache.beam.sdk.io">AvroSource.AvroReader</a></dd> |
| </dl> |
| <dl> |
| <dt>Enclosing class:</dt> |
| <dd><a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.html" title="class in org.apache.beam.sdk.io">BlockBasedSource</a><<a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.html" title="type parameter in BlockBasedSource">T</a>></dd> |
| </dl> |
| <hr> |
| <br> |
| <pre><a href="../../../../../org/apache/beam/sdk/annotations/Experimental.html" title="annotation in org.apache.beam.sdk.annotations">@Experimental</a>(<a href="../../../../../org/apache/beam/sdk/annotations/Experimental.html#value--">value</a>=<a href="../../../../../org/apache/beam/sdk/annotations/Experimental.Kind.html#SOURCE_SINK">SOURCE_SINK</a>) |
| protected abstract static class <span class="typeNameLabel">BlockBasedSource.BlockBasedReader<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">A <code>Reader</code> that reads records from a <a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.html" title="class in org.apache.beam.sdk.io"><code>BlockBasedSource</code></a>. If the source is a |
| subrange of a file, the blocks that will be read by this reader are those such that the first |
| byte of the block is within the range <code>[start, end)</code>.</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="colFirst" scope="col">Modifier</th> |
| <th class="colLast" scope="col">Constructor and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colFirst"><code>protected </code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.BlockBasedReader.html#BlockBasedReader-org.apache.beam.sdk.io.BlockBasedSource-">BlockBasedReader</a></span>(<a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.html" title="class in org.apache.beam.sdk.io">BlockBasedSource</a><<a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.BlockBasedReader.html" title="type parameter in BlockBasedSource.BlockBasedReader">T</a>> source)</code> </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="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract 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><a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.BlockBasedReader.html" title="type parameter in BlockBasedSource.BlockBasedReader">T</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.BlockBasedReader.html#getCurrent--">getCurrent</a></span>()</code> |
| <div class="block">Returns the value of the data item that was read by 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> call.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>abstract <a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.Block.html" title="class in org.apache.beam.sdk.io">BlockBasedSource.Block</a><<a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.BlockBasedReader.html" title="type parameter in BlockBasedSource.BlockBasedReader">T</a>></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.BlockBasedReader.html#getCurrentBlock--">getCurrentBlock</a></span>()</code> |
| <div class="block">Returns the current block (the block that was read by the last successful call to <a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.BlockBasedReader.html#readNextBlock--"><code>readNextBlock()</code></a>).</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>abstract long</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.BlockBasedReader.html#getCurrentBlockOffset--">getCurrentBlockOffset</a></span>()</code> |
| <div class="block">Returns the largest offset such that starting to read from that offset includes the current |
| block.</div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>abstract long</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.BlockBasedReader.html#getCurrentBlockSize--">getCurrentBlockSize</a></span>()</code> |
| <div class="block">Returns the size of the current block in bytes as it is represented in the underlying file, |
| if possible.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>protected long</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.BlockBasedReader.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="i5" class="rowColor"> |
| <td class="colFirst"><code>java.lang.Double</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.BlockBasedReader.html#getFractionConsumed--">getFractionConsumed</a></span>()</code> |
| <div class="block">Returns a value in [0, 1] representing approximately what fraction of the <a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html#getCurrentSource--"><code>current source</code></a> this reader has read so far, or <code>null</code> if such an |
| estimate is not available.</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/BlockBasedSource.BlockBasedReader.html#isAtSplitPoint--">isAtSplitPoint</a></span>()</code> |
| <div class="block">Returns true if the reader is at a split point.</div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>abstract boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.BlockBasedReader.html#readNextBlock--">readNextBlock</a></span>()</code> |
| <div class="block">Read the next block from the input.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>protected boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.BlockBasedReader.html#readNextRecord--">readNextRecord</a></span>()</code> |
| <div class="block">Reads the next record from the <a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.BlockBasedReader.html#getCurrentBlock--"><code>current block</code></a> if possible.</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#allowsDynamicSplitting--">allowsDynamicSplitting</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>, <a href="../../../../../org/apache/beam/sdk/io/FileBasedSource.FileBasedReader.html#startReading-java.nio.channels.ReadableByteChannel-">startReading</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#getSplitPointsConsumed--">getSplitPointsConsumed</a>, <a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html#getSplitPointsRemaining--">getSplitPointsRemaining</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.org.apache.beam.sdk.io.BoundedSource.BoundedReader"> |
| <!-- --> |
| </a> |
| <h3>Methods 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#getCurrentTimestamp--">getCurrentTimestamp</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="BlockBasedReader-org.apache.beam.sdk.io.BlockBasedSource-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>BlockBasedReader</h4> |
| <pre>protected BlockBasedReader(<a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.html" title="class in org.apache.beam.sdk.io">BlockBasedSource</a><<a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.BlockBasedReader.html" title="type parameter in BlockBasedSource.BlockBasedReader">T</a>> source)</pre> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="readNextBlock--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>readNextBlock</h4> |
| <pre>public abstract boolean readNextBlock() |
| throws java.io.IOException</pre> |
| <div class="block">Read the next block from the input.</div> |
| <dl> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code>java.io.IOException</code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getCurrentBlock--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getCurrentBlock</h4> |
| <pre><a href="https://static.javadoc.io/com.google.code.findbugs/jsr305/3.0.2/javax/annotation/Nullable.html?is-external=true" title="class or interface in javax.annotation">@Nullable</a> |
| public abstract <a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.Block.html" title="class in org.apache.beam.sdk.io">BlockBasedSource.Block</a><<a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.BlockBasedReader.html" title="type parameter in BlockBasedSource.BlockBasedReader">T</a>> getCurrentBlock()</pre> |
| <div class="block">Returns the current block (the block that was read by the last successful call to <a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.BlockBasedReader.html#readNextBlock--"><code>readNextBlock()</code></a>). May return null initially, or if no block has been |
| successfully read.</div> |
| </li> |
| </ul> |
| <a name="getCurrentBlockSize--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getCurrentBlockSize</h4> |
| <pre>public abstract long getCurrentBlockSize()</pre> |
| <div class="block">Returns the size of the current block in bytes as it is represented in the underlying file, |
| if possible. This method may return <code>0</code> if the size of the current block is unknown. |
| |
| <p>The size returned by this method must be such that for two successive blocks A and B, |
| <code>offset(A) + size(A) <= offset(B)</code>. If this is not satisfied, the progress reported by |
| the <code>BlockBasedReader</code> will be non-monotonic and will interfere with the quality (but |
| not correctness) of dynamic work rebalancing. |
| |
| <p>This method and <a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.Block.html#getFractionOfBlockConsumed--"><code>BlockBasedSource.Block.getFractionOfBlockConsumed()</code></a> are used to provide an estimate |
| of progress within a block (<code>getCurrentBlock().getFractionOfBlockConsumed() * |
| getCurrentBlockSize()</code>). It is acceptable for the result of this computation to be <code>0</code>, |
| but progress estimation will be inaccurate.</div> |
| </li> |
| </ul> |
| <a name="getCurrentBlockOffset--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getCurrentBlockOffset</h4> |
| <pre>public abstract long getCurrentBlockOffset()</pre> |
| <div class="block">Returns the largest offset such that starting to read from that offset includes the current |
| block.</div> |
| </li> |
| </ul> |
| <a name="getCurrent--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getCurrent</h4> |
| <pre>public final <a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.BlockBasedReader.html" title="type parameter in BlockBasedSource.BlockBasedReader">T</a> getCurrent() |
| throws java.util.NoSuchElementException</pre> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from class: <code><a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#getCurrent--">Source.Reader</a></code></span></div> |
| <div class="block">Returns the value of the data item that was read by 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> call. The returned value must be effectively immutable and remain valid |
| indefinitely. |
| |
| <p>Multiple calls to this method without an intervening call to <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#advance--"><code>Source.Reader.advance()</code></a> should |
| return the same result.</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/BlockBasedSource.BlockBasedReader.html" title="type parameter in BlockBasedSource.BlockBasedReader">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="isAtSplitPoint--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>isAtSplitPoint</h4> |
| <pre>protected boolean isAtSplitPoint()</pre> |
| <div class="block">Returns true if the reader is at a split point. A <code>BlockBasedReader</code> is at a split |
| point if the current record is the first record in a block. In other words, split points are |
| block boundaries.</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/BlockBasedSource.BlockBasedReader.html" title="type parameter in BlockBasedSource.BlockBasedReader">T</a>></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 from the <a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.BlockBasedReader.html#getCurrentBlock--"><code>current block</code></a> if possible. Will |
| call <a href="../../../../../org/apache/beam/sdk/io/BlockBasedSource.BlockBasedReader.html#readNextBlock--"><code>readNextBlock()</code></a> to advance to the next block if not. |
| |
| <p>The first record read from a block is treated as a split point.</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/BlockBasedSource.BlockBasedReader.html" title="type parameter in BlockBasedSource.BlockBasedReader">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="getFractionConsumed--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getFractionConsumed</h4> |
| <pre><a href="https://static.javadoc.io/com.google.code.findbugs/jsr305/3.0.2/javax/annotation/Nullable.html?is-external=true" title="class or interface in javax.annotation">@Nullable</a> |
| public java.lang.Double getFractionConsumed()</pre> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from class: <code><a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html#getFractionConsumed--">BoundedSource.BoundedReader</a></code></span></div> |
| <div class="block">Returns a value in [0, 1] representing approximately what fraction of the <a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html#getCurrentSource--"><code>current source</code></a> this reader has read so far, or <code>null</code> if such an |
| estimate is not available. |
| |
| <p>It is recommended that this method should satisfy the following properties: |
| |
| <ul> |
| <li>Should return 0 before the <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html#start--"><code>Source.Reader.start()</code></a> call. |
| <li>Should return 1 after a <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 that returns false. |
| <li>The returned values should be non-decreasing (though they don't have to be unique). |
| </ul> |
| |
| <p>By default, returns null to indicate that this cannot be estimated. |
| |
| <h3>Thread safety</h3> |
| |
| If <a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html#splitAtFraction-double-"><code>BoundedSource.BoundedReader.splitAtFraction(double)</code></a> is implemented, this method can be called concurrently to other |
| methods (including itself), and it is therefore critical for it to be implemented in a |
| thread-safe way.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html#getFractionConsumed--">getFractionConsumed</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/BlockBasedSource.BlockBasedReader.html" title="type parameter in BlockBasedSource.BlockBasedReader">T</a>></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getCurrentOffset--"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>getCurrentOffset</h4> |
| <pre>protected long getCurrentOffset()</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/BlockBasedSource.BlockBasedReader.html" title="type parameter in BlockBasedSource.BlockBasedReader">T</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="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/BlockBasedSource.Block.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/BoundedReadFromUnboundedSource.html" title="class 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/BlockBasedSource.BlockBasedReader.html" target="_top">Frames</a></li> |
| <li><a href="BlockBasedSource.BlockBasedReader.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> |