blob: cd7fb1f4f25cc4d2342d33f32e5463ddc48c7a21 [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 (1.8.0_161-google-v7) on Thu Oct 18 16:14:35 PDT 2018 -->
<title>OffsetBasedSource (Apache Beam 2.8.0-SNAPSHOT)</title>
<meta name="date" content="2018-10-18">
<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="OffsetBasedSource (Apache Beam 2.8.0-SNAPSHOT)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":10,"i2":10,"i3":10,"i4":6,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":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/LocalResources.html" title="class in org.apache.beam.sdk.io"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html" title="class in org.apache.beam.sdk.io"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/beam/sdk/io/OffsetBasedSource.html" target="_top">Frames</a></li>
<li><a href="OffsetBasedSource.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><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&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>Field&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.beam.sdk.io</div>
<h2 title="Class OffsetBasedSource" class="title">Class OffsetBasedSource&lt;T&gt;</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.html" title="class in org.apache.beam.sdk.io">org.apache.beam.sdk.io.Source</a>&lt;T&gt;</li>
<li>
<ul class="inheritance">
<li><a href="../../../../../org/apache/beam/sdk/io/BoundedSource.html" title="class in org.apache.beam.sdk.io">org.apache.beam.sdk.io.BoundedSource</a>&lt;T&gt;</li>
<li>
<ul class="inheritance">
<li>org.apache.beam.sdk.io.OffsetBasedSource&lt;T&gt;</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> - Type of records represented by the source.</dd>
</dl>
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.io.Serializable, <a href="../../../../../org/apache/beam/sdk/transforms/display/HasDisplayData.html" title="interface in org.apache.beam.sdk.transforms.display">HasDisplayData</a></dd>
</dl>
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../../../org/apache/beam/sdk/io/FileBasedSource.html" title="class in org.apache.beam.sdk.io">FileBasedSource</a></dd>
</dl>
<hr>
<br>
<pre>public abstract class <span class="typeNameLabel">OffsetBasedSource&lt;T&gt;</span>
extends <a href="../../../../../org/apache/beam/sdk/io/BoundedSource.html" title="class in org.apache.beam.sdk.io">BoundedSource</a>&lt;T&gt;</pre>
<div class="block">A <a href="../../../../../org/apache/beam/sdk/io/BoundedSource.html" title="class in org.apache.beam.sdk.io"><code>BoundedSource</code></a> that uses offsets to define starting and ending positions.
<p><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html" title="class in org.apache.beam.sdk.io"><code>OffsetBasedSource</code></a> is a common base class for all bounded sources where the input can
be represented as a single range, and an input can be efficiently processed in parallel by
splitting the range into a set of disjoint ranges whose union is the original range. This class
should be used for sources that can be cheaply read starting at any given offset. <a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html" title="class in org.apache.beam.sdk.io"><code>OffsetBasedSource</code></a> stores the range and implements splitting into bundles.
<p>Extend <a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html" title="class in org.apache.beam.sdk.io"><code>OffsetBasedSource</code></a> to implement your own offset-based custom source. <a href="../../../../../org/apache/beam/sdk/io/FileBasedSource.html" title="class in org.apache.beam.sdk.io"><code>FileBasedSource</code></a>, which is a subclass of this, adds additional functionality useful for custom
sources that are based on files. If possible implementors should start from <a href="../../../../../org/apache/beam/sdk/io/FileBasedSource.html" title="class in org.apache.beam.sdk.io"><code>FileBasedSource</code></a> instead of <a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html" title="class in org.apache.beam.sdk.io"><code>OffsetBasedSource</code></a>.
<p>Consult <a href="../../../../../org/apache/beam/sdk/io/range/RangeTracker.html" title="interface in org.apache.beam.sdk.io.range"><code>RangeTracker</code></a> for important semantics common to all sources defined by a range
of positions of a certain type, including the semantics of split points (<a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html#isAtSplitPoint--"><code>OffsetBasedSource.OffsetBasedReader.isAtSplitPoint()</code></a>).</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/beam/sdk/io/BoundedSource.html" title="class in org.apache.beam.sdk.io"><code>BoundedSource</code></a>,
<a href="../../../../../org/apache/beam/sdk/io/FileBasedSource.html" title="class in org.apache.beam.sdk.io"><code>FileBasedSource</code></a>,
<a href="../../../../../org/apache/beam/sdk/io/range/RangeTracker.html" title="interface in org.apache.beam.sdk.io.range"><code>RangeTracker</code></a>,
<a href="../../../../../serialized-form.html#org.apache.beam.sdk.io.OffsetBasedSource">Serialized Form</a></dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html" title="class in org.apache.beam.sdk.io">OffsetBasedSource.OffsetBasedReader</a>&lt;<a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html" title="type parameter in OffsetBasedSource.OffsetBasedReader">T</a>&gt;</span></code>
<div class="block">A <a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html" title="class in org.apache.beam.sdk.io"><code>Source.Reader</code></a> that implements code common to readers of all <a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html" title="class in org.apache.beam.sdk.io"><code>OffsetBasedSource</code></a>s.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="nested.classes.inherited.from.class.org.apache.beam.sdk.io.BoundedSource">
<!-- -->
</a>
<h3>Nested classes/interfaces inherited from class&nbsp;org.apache.beam.sdk.io.<a href="../../../../../org/apache/beam/sdk/io/BoundedSource.html" title="class in org.apache.beam.sdk.io">BoundedSource</a></h3>
<code><a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html" title="class in org.apache.beam.sdk.io">BoundedSource.BoundedReader</a>&lt;<a href="../../../../../org/apache/beam/sdk/io/BoundedSource.BoundedReader.html" title="type parameter in BoundedSource.BoundedReader">T</a>&gt;</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="nested.classes.inherited.from.class.org.apache.beam.sdk.io.Source">
<!-- -->
</a>
<h3>Nested classes/interfaces inherited from class&nbsp;org.apache.beam.sdk.io.<a href="../../../../../org/apache/beam/sdk/io/Source.html" title="class in org.apache.beam.sdk.io">Source</a></h3>
<code><a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html" title="class in org.apache.beam.sdk.io">Source.Reader</a>&lt;<a href="../../../../../org/apache/beam/sdk/io/Source.Reader.html" title="type parameter in Source.Reader">T</a>&gt;</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">&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/beam/sdk/io/OffsetBasedSource.html#OffsetBasedSource-long-long-long-">OffsetBasedSource</a></span>(long&nbsp;startOffset,
long&nbsp;endOffset,
long&nbsp;minBundleSize)</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span><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>abstract <a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html" title="class in org.apache.beam.sdk.io">OffsetBasedSource</a>&lt;<a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html" title="type parameter in OffsetBasedSource">T</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html#createSourceForSubrange-long-long-">createSourceForSubrange</a></span>(long&nbsp;start,
long&nbsp;end)</code>
<div class="block">Returns an <a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html" title="class in org.apache.beam.sdk.io"><code>OffsetBasedSource</code></a> for a subrange of the current source.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html#getBytesPerOffset--">getBytesPerOffset</a></span>()</code>
<div class="block">Returns approximately how many bytes of data correspond to a single offset in this source.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html#getEndOffset--">getEndOffset</a></span>()</code>
<div class="block">Returns the specified ending offset of the source.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html#getEstimatedSizeBytes-org.apache.beam.sdk.options.PipelineOptions-">getEstimatedSizeBytes</a></span>(<a href="../../../../../org/apache/beam/sdk/options/PipelineOptions.html" title="interface in org.apache.beam.sdk.options">PipelineOptions</a>&nbsp;options)</code>
<div class="block">An estimate of the total size (in bytes) of the data that would be read from this source.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>abstract long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html#getMaxEndOffset-org.apache.beam.sdk.options.PipelineOptions-">getMaxEndOffset</a></span>(<a href="../../../../../org/apache/beam/sdk/options/PipelineOptions.html" title="interface in org.apache.beam.sdk.options">PipelineOptions</a>&nbsp;options)</code>
<div class="block">Returns the actual ending offset of the current source.</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/OffsetBasedSource.html#getMinBundleSize--">getMinBundleSize</a></span>()</code>
<div class="block">Returns the minimum bundle size that should be used when splitting the source into sub-sources.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html#getStartOffset--">getStartOffset</a></span>()</code>
<div class="block">Returns the starting offset of the source.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html#populateDisplayData-org.apache.beam.sdk.transforms.display.DisplayData.Builder-">populateDisplayData</a></span>(<a href="../../../../../org/apache/beam/sdk/transforms/display/DisplayData.Builder.html" title="interface in org.apache.beam.sdk.transforms.display">DisplayData.Builder</a>&nbsp;builder)</code>
<div class="block">Register display data for the given transform or component.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>java.util.List&lt;? extends <a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html" title="class in org.apache.beam.sdk.io">OffsetBasedSource</a>&lt;<a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html" title="type parameter in OffsetBasedSource">T</a>&gt;&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html#split-long-org.apache.beam.sdk.options.PipelineOptions-">split</a></span>(long&nbsp;desiredBundleSizeBytes,
<a href="../../../../../org/apache/beam/sdk/options/PipelineOptions.html" title="interface in org.apache.beam.sdk.options">PipelineOptions</a>&nbsp;options)</code>
<div class="block">Splits the source into bundles of approximately <code>desiredBundleSizeBytes</code>.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html#toString--">toString</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html#validate--">validate</a></span>()</code>
<div class="block">Checks that this source is valid, before it can be used in a pipeline.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.beam.sdk.io.BoundedSource">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.beam.sdk.io.<a href="../../../../../org/apache/beam/sdk/io/BoundedSource.html" title="class in org.apache.beam.sdk.io">BoundedSource</a></h3>
<code><a href="../../../../../org/apache/beam/sdk/io/BoundedSource.html#createReader-org.apache.beam.sdk.options.PipelineOptions-">createReader</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.beam.sdk.io.Source">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.beam.sdk.io.<a href="../../../../../org/apache/beam/sdk/io/Source.html" title="class in org.apache.beam.sdk.io">Source</a></h3>
<code><a href="../../../../../org/apache/beam/sdk/io/Source.html#getDefaultOutputCoder--">getDefaultOutputCoder</a>, <a href="../../../../../org/apache/beam/sdk/io/Source.html#getOutputCoder--">getOutputCoder</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&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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="OffsetBasedSource-long-long-long-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>OffsetBasedSource</h4>
<pre>public&nbsp;OffsetBasedSource(long&nbsp;startOffset,
long&nbsp;endOffset,
long&nbsp;minBundleSize)</pre>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>startOffset</code> - starting offset (inclusive) of the source. Must be non-negative.</dd>
<dd><code>endOffset</code> - ending offset (exclusive) of the source. Use <code>Long.MAX_VALUE</code> to
indicate that the entire source after <code>startOffset</code> should be read. Must be <code>&gt;
startOffset</code>.</dd>
<dd><code>minBundleSize</code> - minimum bundle size in offset units that should be used when splitting the
source into sub-sources. This value may not be respected if the total range of the source
is smaller than the specified <code>minBundleSize</code>. Must be non-negative.</dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getStartOffset--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getStartOffset</h4>
<pre>public&nbsp;long&nbsp;getStartOffset()</pre>
<div class="block">Returns the starting offset of the source.</div>
</li>
</ul>
<a name="getEndOffset--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getEndOffset</h4>
<pre>public&nbsp;long&nbsp;getEndOffset()</pre>
<div class="block">Returns the specified ending offset of the source. Any returned value greater than or equal to
<a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html#getMaxEndOffset-org.apache.beam.sdk.options.PipelineOptions-"><code>getMaxEndOffset(PipelineOptions)</code></a> should be treated as <a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html#getMaxEndOffset-org.apache.beam.sdk.options.PipelineOptions-"><code>getMaxEndOffset(PipelineOptions)</code></a>.</div>
</li>
</ul>
<a name="getMinBundleSize--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMinBundleSize</h4>
<pre>public&nbsp;long&nbsp;getMinBundleSize()</pre>
<div class="block">Returns the minimum bundle size that should be used when splitting the source into sub-sources.
This value may not be respected if the total range of the source is smaller than the specified
<code>minBundleSize</code>.</div>
</li>
</ul>
<a name="getEstimatedSizeBytes-org.apache.beam.sdk.options.PipelineOptions-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getEstimatedSizeBytes</h4>
<pre>public&nbsp;long&nbsp;getEstimatedSizeBytes(<a href="../../../../../org/apache/beam/sdk/options/PipelineOptions.html" title="interface in org.apache.beam.sdk.options">PipelineOptions</a>&nbsp;options)
throws java.lang.Exception</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../org/apache/beam/sdk/io/BoundedSource.html#getEstimatedSizeBytes-org.apache.beam.sdk.options.PipelineOptions-">BoundedSource</a></code></span></div>
<div class="block">An estimate of the total size (in bytes) of the data that would be read from this source. This
estimate is in terms of external storage size, before any decompression or other processing
done by the reader.
<p>If there is no way to estimate the size of the source implementations MAY return 0L.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/beam/sdk/io/BoundedSource.html#getEstimatedSizeBytes-org.apache.beam.sdk.options.PipelineOptions-">getEstimatedSizeBytes</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/beam/sdk/io/BoundedSource.html" title="class in org.apache.beam.sdk.io">BoundedSource</a>&lt;<a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html" title="type parameter in OffsetBasedSource">T</a>&gt;</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.Exception</code></dd>
</dl>
</li>
</ul>
<a name="split-long-org.apache.beam.sdk.options.PipelineOptions-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>split</h4>
<pre>public&nbsp;java.util.List&lt;? extends <a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html" title="class in org.apache.beam.sdk.io">OffsetBasedSource</a>&lt;<a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html" title="type parameter in OffsetBasedSource">T</a>&gt;&gt;&nbsp;split(long&nbsp;desiredBundleSizeBytes,
<a href="../../../../../org/apache/beam/sdk/options/PipelineOptions.html" title="interface in org.apache.beam.sdk.options">PipelineOptions</a>&nbsp;options)
throws java.lang.Exception</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../org/apache/beam/sdk/io/BoundedSource.html#split-long-org.apache.beam.sdk.options.PipelineOptions-">BoundedSource</a></code></span></div>
<div class="block">Splits the source into bundles of approximately <code>desiredBundleSizeBytes</code>.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/beam/sdk/io/BoundedSource.html#split-long-org.apache.beam.sdk.options.PipelineOptions-">split</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/beam/sdk/io/BoundedSource.html" title="class in org.apache.beam.sdk.io">BoundedSource</a>&lt;<a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html" title="type parameter in OffsetBasedSource">T</a>&gt;</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.Exception</code></dd>
</dl>
</li>
</ul>
<a name="validate--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>validate</h4>
<pre>public&nbsp;void&nbsp;validate()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../org/apache/beam/sdk/io/Source.html#validate--">Source</a></code></span></div>
<div class="block">Checks that this source is valid, before it can be used in a pipeline.
<p>It is recommended to use <a href="http://google.github.io/guava/releases/20.0/api/docs/com/google/common/base/Preconditions.html?is-external=true" title="class or interface in com.google.common.base"><code>Preconditions</code></a> for implementing this
method.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../../org/apache/beam/sdk/io/Source.html#validate--">validate</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/beam/sdk/io/Source.html" title="class in org.apache.beam.sdk.io">Source</a>&lt;<a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html" title="type parameter in OffsetBasedSource">T</a>&gt;</code></dd>
</dl>
</li>
</ul>
<a name="toString--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;java.lang.String&nbsp;toString()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>toString</code>&nbsp;in class&nbsp;<code>java.lang.Object</code></dd>
</dl>
</li>
</ul>
<a name="getBytesPerOffset--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBytesPerOffset</h4>
<pre>public&nbsp;long&nbsp;getBytesPerOffset()</pre>
<div class="block">Returns approximately how many bytes of data correspond to a single offset in this source. Used
for translation between this source's range and methods defined in terms of bytes, such as
<a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html#getEstimatedSizeBytes-org.apache.beam.sdk.options.PipelineOptions-"><code>getEstimatedSizeBytes(org.apache.beam.sdk.options.PipelineOptions)</code></a> and <a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html#split-long-org.apache.beam.sdk.options.PipelineOptions-"><code>split(long, org.apache.beam.sdk.options.PipelineOptions)</code></a>.
<p>Defaults to <code>1</code> byte, which is the common case for, e.g., file sources.</div>
</li>
</ul>
<a name="getMaxEndOffset-org.apache.beam.sdk.options.PipelineOptions-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxEndOffset</h4>
<pre>public abstract&nbsp;long&nbsp;getMaxEndOffset(<a href="../../../../../org/apache/beam/sdk/options/PipelineOptions.html" title="interface in org.apache.beam.sdk.options">PipelineOptions</a>&nbsp;options)
throws java.lang.Exception</pre>
<div class="block">Returns the actual ending offset of the current source. The value returned by this function
will be used to clip the end of the range <code>[startOffset, endOffset)</code> such that the range
used is <code>[startOffset, min(endOffset, maxEndOffset))</code>.
<p>As an example in which <a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html" title="class in org.apache.beam.sdk.io"><code>OffsetBasedSource</code></a> is used to implement a file source, suppose
that this source was constructed with an <code>endOffset</code> of <code>Long.MAX_VALUE</code> to
indicate that a file should be read to the end. Then this function should determine the actual,
exact size of the file in bytes and return it.</div>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.Exception</code></dd>
</dl>
</li>
</ul>
<a name="createSourceForSubrange-long-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>createSourceForSubrange</h4>
<pre>public abstract&nbsp;<a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html" title="class in org.apache.beam.sdk.io">OffsetBasedSource</a>&lt;<a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html" title="type parameter in OffsetBasedSource">T</a>&gt;&nbsp;createSourceForSubrange(long&nbsp;start,
long&nbsp;end)</pre>
<div class="block">Returns an <a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html" title="class in org.apache.beam.sdk.io"><code>OffsetBasedSource</code></a> for a subrange of the current source. The subrange <code>[start, end)</code> must be within the range <code>[startOffset, endOffset)</code> of the current source,
i.e. <code>startOffset &lt;= start &lt; end &lt;= endOffset</code>.</div>
</li>
</ul>
<a name="populateDisplayData-org.apache.beam.sdk.transforms.display.DisplayData.Builder-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>populateDisplayData</h4>
<pre>public&nbsp;void&nbsp;populateDisplayData(<a href="../../../../../org/apache/beam/sdk/transforms/display/DisplayData.Builder.html" title="interface in org.apache.beam.sdk.transforms.display">DisplayData.Builder</a>&nbsp;builder)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../org/apache/beam/sdk/io/Source.html#populateDisplayData-org.apache.beam.sdk.transforms.display.DisplayData.Builder-">Source</a></code></span></div>
<div class="block">Register display data for the given transform or component.
<p><code>populateDisplayData(DisplayData.Builder)</code> is invoked by Pipeline runners to collect
display data via <a href="../../../../../org/apache/beam/sdk/transforms/display/DisplayData.html#from-org.apache.beam.sdk.transforms.display.HasDisplayData-"><code>DisplayData.from(HasDisplayData)</code></a>. Implementations may call <code>super.populateDisplayData(builder)</code> in order to register display data in the current namespace,
but should otherwise use <code>subcomponent.populateDisplayData(builder)</code> to use the namespace
of the subcomponent.
<p>By default, does not register any display data. Implementors may override this method to
provide their own display data.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../org/apache/beam/sdk/transforms/display/HasDisplayData.html#populateDisplayData-org.apache.beam.sdk.transforms.display.DisplayData.Builder-">populateDisplayData</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../../org/apache/beam/sdk/transforms/display/HasDisplayData.html" title="interface in org.apache.beam.sdk.transforms.display">HasDisplayData</a></code></dd>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../../org/apache/beam/sdk/io/Source.html#populateDisplayData-org.apache.beam.sdk.transforms.display.DisplayData.Builder-">populateDisplayData</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../org/apache/beam/sdk/io/Source.html" title="class in org.apache.beam.sdk.io">Source</a>&lt;<a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.html" title="type parameter in OffsetBasedSource">T</a>&gt;</code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>builder</code> - The builder to populate with display data.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../org/apache/beam/sdk/transforms/display/HasDisplayData.html" title="interface in org.apache.beam.sdk.transforms.display"><code>HasDisplayData</code></a></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/LocalResources.html" title="class in org.apache.beam.sdk.io"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../org/apache/beam/sdk/io/OffsetBasedSource.OffsetBasedReader.html" title="class in org.apache.beam.sdk.io"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/apache/beam/sdk/io/OffsetBasedSource.html" target="_top">Frames</a></li>
<li><a href="OffsetBasedSource.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><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&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>Field&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 ======= -->
</body>
</html>