blob: ff8f5ef3bd8e8c3f34b543f1788dd84a55911837 [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 -->
<title>SplitAssigner</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="SplitAssigner";
}
}
catch(err) {
}
//-->
var methods = {"i0":18,"i1":6,"i2":6,"i3":18,"i4":6,"i5":6,"i6":6,"i7":18,"i8":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],16:["t5","Default 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/iceberg/flink/source/assigner/SimpleSplitAssignerFactory.html" title="class in org.apache.iceberg.flink.source.assigner"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../../org/apache/iceberg/flink/source/assigner/SplitAssignerFactory.html" title="interface in org.apache.iceberg.flink.source.assigner"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/iceberg/flink/source/assigner/SplitAssigner.html" target="_top">Frames</a></li>
<li><a href="SplitAssigner.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.iceberg.flink.source.assigner</div>
<h2 title="Interface SplitAssigner" class="title">Interface SplitAssigner</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd>java.lang.AutoCloseable, java.io.Closeable</dd>
</dl>
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../../../../org/apache/iceberg/flink/source/assigner/SimpleSplitAssigner.html" title="class in org.apache.iceberg.flink.source.assigner">SimpleSplitAssigner</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">SplitAssigner</span>
extends java.io.Closeable</pre>
<div class="block">SplitAssigner interface is extracted out as a separate component so that we can plug in different
split assignment strategy for different requirements. E.g.
<ul>
<li>Simple assigner with no ordering guarantee or locality aware optimization.
<li>Locality aware assigner that prefer splits that are local.
<li>Snapshot aware assigner that assign splits based on the order they are committed.
<li>Event time alignment assigner that assign splits satisfying certain time ordering within a
single source or across sources.
</ul>
<p>Assigner implementation needs to be thread safe. Enumerator call the assigner APIs mostly from
the coordinator thread. But enumerator may call the <a href="../../../../../../org/apache/iceberg/flink/source/assigner/SplitAssigner.html#pendingSplitCount--"><code>pendingSplitCount()</code></a>
from the I/O threads.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== 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="t5" class="tableTab"><span><a href="javascript:show(16);">Default 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>default void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/iceberg/flink/source/assigner/SplitAssigner.html#close--">close</a></span>()</code>
<div class="block">Some assigners may need to perform certain actions when their corresponding enumerators are
closed</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="../../../../../../org/apache/iceberg/flink/source/assigner/GetSplitResult.html" title="class in org.apache.iceberg.flink.source.assigner">GetSplitResult</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/iceberg/flink/source/assigner/SplitAssigner.html#getNext-java.lang.String-">getNext</a></span>(java.lang.String&nbsp;hostname)</code>
<div class="block">Request a new split from the assigner when enumerator trying to assign splits to awaiting
readers.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>java.util.concurrent.CompletableFuture&lt;java.lang.Void&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/iceberg/flink/source/assigner/SplitAssigner.html#isAvailable--">isAvailable</a></span>()</code>
<div class="block">Enumerator can get a notification via CompletableFuture when the assigner has more splits
available later.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>default void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/iceberg/flink/source/assigner/SplitAssigner.html#onCompletedSplits-java.util.Collection-">onCompletedSplits</a></span>(java.util.Collection&lt;java.lang.String&gt;&nbsp;completedSplitIds)</code>
<div class="block">Some assigner (like event time alignment) may rack in-progress splits to advance watermark upon
completed splits</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/iceberg/flink/source/assigner/SplitAssigner.html#onDiscoveredSplits-java.util.Collection-">onDiscoveredSplits</a></span>(java.util.Collection&lt;<a href="../../../../../../org/apache/iceberg/flink/source/split/IcebergSourceSplit.html" title="class in org.apache.iceberg.flink.source.split">IcebergSourceSplit</a>&gt;&nbsp;splits)</code>
<div class="block">Add new splits discovered by enumerator</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/iceberg/flink/source/assigner/SplitAssigner.html#onUnassignedSplits-java.util.Collection-">onUnassignedSplits</a></span>(java.util.Collection&lt;<a href="../../../../../../org/apache/iceberg/flink/source/split/IcebergSourceSplit.html" title="class in org.apache.iceberg.flink.source.split">IcebergSourceSplit</a>&gt;&nbsp;splits)</code>
<div class="block">Forward addSplitsBack event (for failed reader) to assigner</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/iceberg/flink/source/assigner/SplitAssigner.html#pendingSplitCount--">pendingSplitCount</a></span>()</code>
<div class="block">Return the number of pending splits that haven't been assigned yet.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>default void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/iceberg/flink/source/assigner/SplitAssigner.html#start--">start</a></span>()</code>
<div class="block">Some assigners may need to start background threads or perform other activity such as
registering as listeners to updates from other event sources e.g., watermark tracker.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>java.util.Collection&lt;<a href="../../../../../../org/apache/iceberg/flink/source/split/IcebergSourceSplitState.html" title="class in org.apache.iceberg.flink.source.split">IcebergSourceSplitState</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../org/apache/iceberg/flink/source/assigner/SplitAssigner.html#state--">state</a></span>()</code>
<div class="block">Get assigner state for checkpointing.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="start--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>start</h4>
<pre>default&nbsp;void&nbsp;start()</pre>
<div class="block">Some assigners may need to start background threads or perform other activity such as
registering as listeners to updates from other event sources e.g., watermark tracker.</div>
</li>
</ul>
<a name="close--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>close</h4>
<pre>default&nbsp;void&nbsp;close()</pre>
<div class="block">Some assigners may need to perform certain actions when their corresponding enumerators are
closed</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>close</code>&nbsp;in interface&nbsp;<code>java.lang.AutoCloseable</code></dd>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>close</code>&nbsp;in interface&nbsp;<code>java.io.Closeable</code></dd>
</dl>
</li>
</ul>
<a name="getNext-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNext</h4>
<pre><a href="../../../../../../org/apache/iceberg/flink/source/assigner/GetSplitResult.html" title="class in org.apache.iceberg.flink.source.assigner">GetSplitResult</a>&nbsp;getNext(@Nullable
java.lang.String&nbsp;hostname)</pre>
<div class="block">Request a new split from the assigner when enumerator trying to assign splits to awaiting
readers.
<p>If enumerator wasn't able to assign the split (e.g., reader disconnected), enumerator should
call <a href="../../../../../../org/apache/iceberg/flink/source/assigner/SplitAssigner.html#onUnassignedSplits-java.util.Collection-"><code>onUnassignedSplits(java.util.Collection&lt;org.apache.iceberg.flink.source.split.IcebergSourceSplit&gt;)</code></a> to return the split.</div>
</li>
</ul>
<a name="onDiscoveredSplits-java.util.Collection-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>onDiscoveredSplits</h4>
<pre>void&nbsp;onDiscoveredSplits(java.util.Collection&lt;<a href="../../../../../../org/apache/iceberg/flink/source/split/IcebergSourceSplit.html" title="class in org.apache.iceberg.flink.source.split">IcebergSourceSplit</a>&gt;&nbsp;splits)</pre>
<div class="block">Add new splits discovered by enumerator</div>
</li>
</ul>
<a name="onUnassignedSplits-java.util.Collection-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>onUnassignedSplits</h4>
<pre>void&nbsp;onUnassignedSplits(java.util.Collection&lt;<a href="../../../../../../org/apache/iceberg/flink/source/split/IcebergSourceSplit.html" title="class in org.apache.iceberg.flink.source.split">IcebergSourceSplit</a>&gt;&nbsp;splits)</pre>
<div class="block">Forward addSplitsBack event (for failed reader) to assigner</div>
</li>
</ul>
<a name="onCompletedSplits-java.util.Collection-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>onCompletedSplits</h4>
<pre>default&nbsp;void&nbsp;onCompletedSplits(java.util.Collection&lt;java.lang.String&gt;&nbsp;completedSplitIds)</pre>
<div class="block">Some assigner (like event time alignment) may rack in-progress splits to advance watermark upon
completed splits</div>
</li>
</ul>
<a name="state--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>state</h4>
<pre>java.util.Collection&lt;<a href="../../../../../../org/apache/iceberg/flink/source/split/IcebergSourceSplitState.html" title="class in org.apache.iceberg.flink.source.split">IcebergSourceSplitState</a>&gt;&nbsp;state()</pre>
<div class="block">Get assigner state for checkpointing. This is a super-set API that works for all currently
imagined assigners.</div>
</li>
</ul>
<a name="isAvailable--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isAvailable</h4>
<pre>java.util.concurrent.CompletableFuture&lt;java.lang.Void&gt;&nbsp;isAvailable()</pre>
<div class="block">Enumerator can get a notification via CompletableFuture when the assigner has more splits
available later. Enumerator should schedule assignment in the thenAccept action of the future.
<p>Assigner will return the same future if this method is called again before the previous
future is completed.
<p>The future can be completed from other thread, e.g. the coordinator thread from another
thread for event time alignment.
<p>If enumerator need to trigger action upon the future completion, it may want to run it in
the coordinator thread using <code>SplitEnumeratorContext.runInCoordinatorThread(Runnable)</code>.</div>
</li>
</ul>
<a name="pendingSplitCount--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>pendingSplitCount</h4>
<pre>int&nbsp;pendingSplitCount()</pre>
<div class="block">Return the number of pending splits that haven't been assigned yet.
<p>The enumerator can poll this API to publish a metric on the number of pending splits.
<p>The enumerator can also use this information to throttle split discovery for streaming read.
If there are already many pending splits tracked by the assigner, it is undesirable to discover
more splits and track them in the assigner. That will increase the memory footprint and
enumerator checkpoint size.
<p>Throttling works better together with <a href="../../../../../../org/apache/iceberg/flink/source/ScanContext.html#maxPlanningSnapshotCount--"><code>ScanContext.maxPlanningSnapshotCount()</code></a>.
Otherwise, the next split discovery after throttling will just discover all non-enumerated
snapshots and splits, which defeats the purpose of throttling.</div>
</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/iceberg/flink/source/assigner/SimpleSplitAssignerFactory.html" title="class in org.apache.iceberg.flink.source.assigner"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../../../org/apache/iceberg/flink/source/assigner/SplitAssignerFactory.html" title="interface in org.apache.iceberg.flink.source.assigner"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/iceberg/flink/source/assigner/SplitAssigner.html" target="_top">Frames</a></li>
<li><a href="SplitAssigner.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>