blob: a0f654608020bba20638989e28073b3c59c86e54 [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (11.0.12) on Mon Nov 08 18:33:49 PST 2021 -->
<title>FlinkSink.Builder</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="dc.created" content="2021-11-08">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../../jquery/jquery-3.5.1.js"></script>
<script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="FlinkSink.Builder";
}
}
catch(err) {
}
//-->
var data = {"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";
var pathtoroot = "../../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../index.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" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</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>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</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 id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.apache.iceberg.flink.sink</a></div>
<h2 title="Class FlinkSink.Builder" class="title">Class FlinkSink.Builder</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.iceberg.flink.sink.FlinkSink.Builder</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Enclosing class:</dt>
<dd><a href="FlinkSink.html" title="class in org.apache.iceberg.flink.sink">FlinkSink</a></dd>
</dl>
<hr>
<pre>public static class <span class="typeNameLabel">FlinkSink.Builder</span>
extends java.lang.Object</pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>org.apache.flink.streaming.api.datastream.DataStreamSink&lt;org.apache.flink.table.data.RowData&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#build()">build</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="FlinkSink.Builder.html" title="class in org.apache.iceberg.flink.sink">FlinkSink.Builder</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#distributionMode(org.apache.iceberg.DistributionMode)">distributionMode</a></span>&#8203;(<a href="../../DistributionMode.html" title="enum in org.apache.iceberg">DistributionMode</a>&nbsp;mode)</code></th>
<td class="colLast">
<div class="block">Configure the write <a href="../../DistributionMode.html" title="enum in org.apache.iceberg"><code>DistributionMode</code></a> that the flink sink will use.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="FlinkSink.Builder.html" title="class in org.apache.iceberg.flink.sink">FlinkSink.Builder</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#equalityFieldColumns(java.util.List)">equalityFieldColumns</a></span>&#8203;(java.util.List&lt;java.lang.String&gt;&nbsp;columns)</code></th>
<td class="colLast">
<div class="block">Configuring the equality field columns for iceberg table that accept CDC or UPSERT events.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="FlinkSink.Builder.html" title="class in org.apache.iceberg.flink.sink">FlinkSink.Builder</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#overwrite(boolean)">overwrite</a></span>&#8203;(boolean&nbsp;newOverwrite)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="FlinkSink.Builder.html" title="class in org.apache.iceberg.flink.sink">FlinkSink.Builder</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#table(org.apache.iceberg.Table)">table</a></span>&#8203;(<a href="../../Table.html" title="interface in org.apache.iceberg">Table</a>&nbsp;newTable)</code></th>
<td class="colLast">
<div class="block">This iceberg <a href="../../Table.html" title="interface in org.apache.iceberg"><code>Table</code></a> instance is used for initializing <code>IcebergStreamWriter</code> which will write all
the records into <a href="../../DataFile.html" title="interface in org.apache.iceberg"><code>DataFile</code></a>s and emit them to downstream operator.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="FlinkSink.Builder.html" title="class in org.apache.iceberg.flink.sink">FlinkSink.Builder</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#tableLoader(org.apache.iceberg.flink.TableLoader)">tableLoader</a></span>&#8203;(<a href="../TableLoader.html" title="interface in org.apache.iceberg.flink">TableLoader</a>&nbsp;newTableLoader)</code></th>
<td class="colLast">
<div class="block">The table loader is used for loading tables in <code>IcebergFilesCommitter</code> lazily, we need this loader because
<a href="../../Table.html" title="interface in org.apache.iceberg"><code>Table</code></a> is not serializable and could not just use the loaded table from Builder#table in the remote task
manager.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="FlinkSink.Builder.html" title="class in org.apache.iceberg.flink.sink">FlinkSink.Builder</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#tableSchema(org.apache.flink.table.api.TableSchema)">tableSchema</a></span>&#8203;(org.apache.flink.table.api.TableSchema&nbsp;newTableSchema)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><a href="FlinkSink.Builder.html" title="class in org.apache.iceberg.flink.sink">FlinkSink.Builder</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#uidPrefix(java.lang.String)">uidPrefix</a></span>&#8203;(java.lang.String&nbsp;newPrefix)</code></th>
<td class="colLast">
<div class="block">Set the uid prefix for FlinkSink operators.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="FlinkSink.Builder.html" title="class in org.apache.iceberg.flink.sink">FlinkSink.Builder</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#writeParallelism(int)">writeParallelism</a></span>&#8203;(int&nbsp;newWriteParallelism)</code></th>
<td class="colLast">
<div class="block">Configuring the write parallel number for iceberg stream writer.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="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, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="table(org.apache.iceberg.Table)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>table</h4>
<pre class="methodSignature">public&nbsp;<a href="FlinkSink.Builder.html" title="class in org.apache.iceberg.flink.sink">FlinkSink.Builder</a>&nbsp;table&#8203;(<a href="../../Table.html" title="interface in org.apache.iceberg">Table</a>&nbsp;newTable)</pre>
<div class="block">This iceberg <a href="../../Table.html" title="interface in org.apache.iceberg"><code>Table</code></a> instance is used for initializing <code>IcebergStreamWriter</code> which will write all
the records into <a href="../../DataFile.html" title="interface in org.apache.iceberg"><code>DataFile</code></a>s and emit them to downstream operator. Providing a table would avoid so many
table loading from each separate task.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>newTable</code> - the loaded iceberg table instance.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><a href="FlinkSink.Builder.html" title="class in org.apache.iceberg.flink.sink"><code>FlinkSink.Builder</code></a> to connect the iceberg table.</dd>
</dl>
</li>
</ul>
<a id="tableLoader(org.apache.iceberg.flink.TableLoader)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>tableLoader</h4>
<pre class="methodSignature">public&nbsp;<a href="FlinkSink.Builder.html" title="class in org.apache.iceberg.flink.sink">FlinkSink.Builder</a>&nbsp;tableLoader&#8203;(<a href="../TableLoader.html" title="interface in org.apache.iceberg.flink">TableLoader</a>&nbsp;newTableLoader)</pre>
<div class="block">The table loader is used for loading tables in <code>IcebergFilesCommitter</code> lazily, we need this loader because
<a href="../../Table.html" title="interface in org.apache.iceberg"><code>Table</code></a> is not serializable and could not just use the loaded table from Builder#table in the remote task
manager.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>newTableLoader</code> - to load iceberg table inside tasks.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><a href="FlinkSink.Builder.html" title="class in org.apache.iceberg.flink.sink"><code>FlinkSink.Builder</code></a> to connect the iceberg table.</dd>
</dl>
</li>
</ul>
<a id="tableSchema(org.apache.flink.table.api.TableSchema)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>tableSchema</h4>
<pre class="methodSignature">public&nbsp;<a href="FlinkSink.Builder.html" title="class in org.apache.iceberg.flink.sink">FlinkSink.Builder</a>&nbsp;tableSchema&#8203;(org.apache.flink.table.api.TableSchema&nbsp;newTableSchema)</pre>
</li>
</ul>
<a id="overwrite(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>overwrite</h4>
<pre class="methodSignature">public&nbsp;<a href="FlinkSink.Builder.html" title="class in org.apache.iceberg.flink.sink">FlinkSink.Builder</a>&nbsp;overwrite&#8203;(boolean&nbsp;newOverwrite)</pre>
</li>
</ul>
<a id="distributionMode(org.apache.iceberg.DistributionMode)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>distributionMode</h4>
<pre class="methodSignature">public&nbsp;<a href="FlinkSink.Builder.html" title="class in org.apache.iceberg.flink.sink">FlinkSink.Builder</a>&nbsp;distributionMode&#8203;(<a href="../../DistributionMode.html" title="enum in org.apache.iceberg">DistributionMode</a>&nbsp;mode)</pre>
<div class="block">Configure the write <a href="../../DistributionMode.html" title="enum in org.apache.iceberg"><code>DistributionMode</code></a> that the flink sink will use. Currently, flink support
<a href="../../DistributionMode.html#NONE"><code>DistributionMode.NONE</code></a> and <a href="../../DistributionMode.html#HASH"><code>DistributionMode.HASH</code></a>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>mode</code> - to specify the write distribution mode.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><a href="FlinkSink.Builder.html" title="class in org.apache.iceberg.flink.sink"><code>FlinkSink.Builder</code></a> to connect the iceberg table.</dd>
</dl>
</li>
</ul>
<a id="writeParallelism(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>writeParallelism</h4>
<pre class="methodSignature">public&nbsp;<a href="FlinkSink.Builder.html" title="class in org.apache.iceberg.flink.sink">FlinkSink.Builder</a>&nbsp;writeParallelism&#8203;(int&nbsp;newWriteParallelism)</pre>
<div class="block">Configuring the write parallel number for iceberg stream writer.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>newWriteParallelism</code> - the number of parallel iceberg stream writer.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><a href="FlinkSink.Builder.html" title="class in org.apache.iceberg.flink.sink"><code>FlinkSink.Builder</code></a> to connect the iceberg table.</dd>
</dl>
</li>
</ul>
<a id="equalityFieldColumns(java.util.List)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>equalityFieldColumns</h4>
<pre class="methodSignature">public&nbsp;<a href="FlinkSink.Builder.html" title="class in org.apache.iceberg.flink.sink">FlinkSink.Builder</a>&nbsp;equalityFieldColumns&#8203;(java.util.List&lt;java.lang.String&gt;&nbsp;columns)</pre>
<div class="block">Configuring the equality field columns for iceberg table that accept CDC or UPSERT events.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>columns</code> - defines the iceberg table's key.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><a href="FlinkSink.Builder.html" title="class in org.apache.iceberg.flink.sink"><code>FlinkSink.Builder</code></a> to connect the iceberg table.</dd>
</dl>
</li>
</ul>
<a id="uidPrefix(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>uidPrefix</h4>
<pre class="methodSignature">public&nbsp;<a href="FlinkSink.Builder.html" title="class in org.apache.iceberg.flink.sink">FlinkSink.Builder</a>&nbsp;uidPrefix&#8203;(java.lang.String&nbsp;newPrefix)</pre>
<div class="block">Set the uid prefix for FlinkSink operators. Note that FlinkSink internally consists of multiple operators (like
writer, committer, dummy sink etc.) Actually operator uid will be appended with a suffix like "uidPrefix-writer".
<br><br>
If provided, this prefix is also applied to operator names.
<br><br>
Flink auto generates operator uid if not set explicitly. It is a recommended
<a href="https://ci.apache.org/projects/flink/flink-docs-master/docs/ops/production_ready/">
best-practice to set uid for all operators</a> before deploying to production. Flink has an option to <code>
pipeline.auto-generate-uid=false</code> to disable auto-generation and force explicit setting of all operator uid.
<br><br>
Be careful with setting this for an existing job, because now we are changing the operator uid from an
auto-generated one to this new value. When deploying the change with a checkpoint, Flink won't be able to restore
the previous Flink sink operator state (more specifically the committer operator state). You need to use <code>
--allowNonRestoredState</code> to ignore the previous sink state. During restore Flink sink state is used to check if
last commit was actually successful or not. <code>--allowNonRestoredState</code> can lead to data loss if the
Iceberg commit failed in the last completed checkpoint.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>newPrefix</code> - prefix for Flink sink operator uid and name</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><a href="FlinkSink.Builder.html" title="class in org.apache.iceberg.flink.sink"><code>FlinkSink.Builder</code></a> to connect the iceberg table.</dd>
</dl>
</li>
</ul>
<a id="build()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>build</h4>
<pre class="methodSignature">public&nbsp;org.apache.flink.streaming.api.datastream.DataStreamSink&lt;org.apache.flink.table.data.RowData&gt;&nbsp;build()</pre>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../index.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" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses.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>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</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 id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
</footer>
</body>
</html>