blob: a6645e284368e62469cbc01e1a039a9eb6acdf0d [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>ExpireSnapshots</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="ExpireSnapshots";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract 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/EnvironmentContext.html" title="class in org.apache.iceberg"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../org/apache/iceberg/FieldMetrics.html" title="class in org.apache.iceberg"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?org/apache/iceberg/ExpireSnapshots.html" target="_top">Frames</a></li>
<li><a href="ExpireSnapshots.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</div>
<h2 title="Interface ExpireSnapshots" class="title">Interface ExpireSnapshots</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd><a href="../../../org/apache/iceberg/PendingUpdate.html" title="interface in org.apache.iceberg">PendingUpdate</a>&lt;java.util.List&lt;<a href="../../../org/apache/iceberg/Snapshot.html" title="interface in org.apache.iceberg">Snapshot</a>&gt;&gt;</dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">ExpireSnapshots</span>
extends <a href="../../../org/apache/iceberg/PendingUpdate.html" title="interface in org.apache.iceberg">PendingUpdate</a>&lt;java.util.List&lt;<a href="../../../org/apache/iceberg/Snapshot.html" title="interface in org.apache.iceberg">Snapshot</a>&gt;&gt;</pre>
<div class="block">API for removing old <a href="../../../org/apache/iceberg/Snapshot.html" title="interface in org.apache.iceberg"><code>snapshots</code></a> from a table.
<p>This API accumulates snapshot deletions and commits the new list to the table. This API does
not allow deleting the current snapshot.
<p>When committing, these changes will be applied to the latest table metadata. Commit conflicts
will be resolved by applying the changes to the new latest metadata and reattempting the commit.
<p>Manifest files that are no longer used by valid snapshots will be deleted. Data files that
were deleted by snapshots that are expired will be deleted. <a href="../../../org/apache/iceberg/ExpireSnapshots.html#deleteWith-java.util.function.Consumer-"><code>deleteWith(Consumer)</code></a> can be
used to pass an alternative deletion method.
<p><a href="../../../org/apache/iceberg/PendingUpdate.html#apply--"><code>PendingUpdate.apply()</code></a> returns a list of the snapshots that will be removed.</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></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/iceberg/ExpireSnapshots.html" title="interface in org.apache.iceberg">ExpireSnapshots</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/iceberg/ExpireSnapshots.html#cleanExpiredFiles-boolean-">cleanExpiredFiles</a></span>(boolean&nbsp;clean)</code>
<div class="block">Allows expiration of snapshots without any cleanup of underlying manifest or data files.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="../../../org/apache/iceberg/ExpireSnapshots.html" title="interface in org.apache.iceberg">ExpireSnapshots</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/iceberg/ExpireSnapshots.html#deleteWith-java.util.function.Consumer-">deleteWith</a></span>(java.util.function.Consumer&lt;java.lang.String&gt;&nbsp;deleteFunc)</code>
<div class="block">Passes an alternative delete implementation that will be used for manifests and data files.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../../../org/apache/iceberg/ExpireSnapshots.html" title="interface in org.apache.iceberg">ExpireSnapshots</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/iceberg/ExpireSnapshots.html#executeDeleteWith-java.util.concurrent.ExecutorService-">executeDeleteWith</a></span>(java.util.concurrent.ExecutorService&nbsp;executorService)</code>
<div class="block">Passes an alternative executor service that will be used for manifests and data files deletion.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../org/apache/iceberg/ExpireSnapshots.html" title="interface in org.apache.iceberg">ExpireSnapshots</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/iceberg/ExpireSnapshots.html#expireOlderThan-long-">expireOlderThan</a></span>(long&nbsp;timestampMillis)</code>
<div class="block">Expires all snapshots older than the given timestamp.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../org/apache/iceberg/ExpireSnapshots.html" title="interface in org.apache.iceberg">ExpireSnapshots</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/iceberg/ExpireSnapshots.html#expireSnapshotId-long-">expireSnapshotId</a></span>(long&nbsp;snapshotId)</code>
<div class="block">Expires a specific <a href="../../../org/apache/iceberg/Snapshot.html" title="interface in org.apache.iceberg"><code>Snapshot</code></a> identified by id.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="../../../org/apache/iceberg/ExpireSnapshots.html" title="interface in org.apache.iceberg">ExpireSnapshots</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/iceberg/ExpireSnapshots.html#planWith-java.util.concurrent.ExecutorService-">planWith</a></span>(java.util.concurrent.ExecutorService&nbsp;executorService)</code>
<div class="block">Passes an alternative executor service that will be used for planning.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="../../../org/apache/iceberg/ExpireSnapshots.html" title="interface in org.apache.iceberg">ExpireSnapshots</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../org/apache/iceberg/ExpireSnapshots.html#retainLast-int-">retainLast</a></span>(int&nbsp;numSnapshots)</code>
<div class="block">Retains the most recent ancestors of the current snapshot.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.apache.iceberg.PendingUpdate">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;org.apache.iceberg.<a href="../../../org/apache/iceberg/PendingUpdate.html" title="interface in org.apache.iceberg">PendingUpdate</a></h3>
<code><a href="../../../org/apache/iceberg/PendingUpdate.html#apply--">apply</a>, <a href="../../../org/apache/iceberg/PendingUpdate.html#commit--">commit</a>, <a href="../../../org/apache/iceberg/PendingUpdate.html#updateEvent--">updateEvent</a></code></li>
</ul>
</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="expireSnapshotId-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>expireSnapshotId</h4>
<pre><a href="../../../org/apache/iceberg/ExpireSnapshots.html" title="interface in org.apache.iceberg">ExpireSnapshots</a>&nbsp;expireSnapshotId(long&nbsp;snapshotId)</pre>
<div class="block">Expires a specific <a href="../../../org/apache/iceberg/Snapshot.html" title="interface in org.apache.iceberg"><code>Snapshot</code></a> identified by id.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>snapshotId</code> - long id of the snapshot to expire</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this for method chaining</dd>
</dl>
</li>
</ul>
<a name="expireOlderThan-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>expireOlderThan</h4>
<pre><a href="../../../org/apache/iceberg/ExpireSnapshots.html" title="interface in org.apache.iceberg">ExpireSnapshots</a>&nbsp;expireOlderThan(long&nbsp;timestampMillis)</pre>
<div class="block">Expires all snapshots older than the given timestamp.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>timestampMillis</code> - a long timestamp, as returned by <code>System.currentTimeMillis()</code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this for method chaining</dd>
</dl>
</li>
</ul>
<a name="retainLast-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>retainLast</h4>
<pre><a href="../../../org/apache/iceberg/ExpireSnapshots.html" title="interface in org.apache.iceberg">ExpireSnapshots</a>&nbsp;retainLast(int&nbsp;numSnapshots)</pre>
<div class="block">Retains the most recent ancestors of the current snapshot.
<p>If a snapshot would be expired because it is older than the expiration timestamp, but is one
of the <code>numSnapshots</code> most recent ancestors of the current state, it will be retained.
This will not cause snapshots explicitly identified by id from expiring.
<p>This may keep more than <code>numSnapshots</code> ancestors if snapshots are added concurrently.
This may keep less than <code>numSnapshots</code> ancestors if the current table state does not have
that many.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>numSnapshots</code> - the number of snapshots to retain</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this for method chaining</dd>
</dl>
</li>
</ul>
<a name="deleteWith-java.util.function.Consumer-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>deleteWith</h4>
<pre><a href="../../../org/apache/iceberg/ExpireSnapshots.html" title="interface in org.apache.iceberg">ExpireSnapshots</a>&nbsp;deleteWith(java.util.function.Consumer&lt;java.lang.String&gt;&nbsp;deleteFunc)</pre>
<div class="block">Passes an alternative delete implementation that will be used for manifests and data files.
<p>Manifest files that are no longer used by valid snapshots will be deleted. Data files that
were deleted by snapshots that are expired will be deleted.
<p>If this method is not called, unnecessary manifests and data files will still be deleted.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>deleteFunc</code> - a function that will be called to delete manifests and data files</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this for method chaining</dd>
</dl>
</li>
</ul>
<a name="executeDeleteWith-java.util.concurrent.ExecutorService-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>executeDeleteWith</h4>
<pre><a href="../../../org/apache/iceberg/ExpireSnapshots.html" title="interface in org.apache.iceberg">ExpireSnapshots</a>&nbsp;executeDeleteWith(java.util.concurrent.ExecutorService&nbsp;executorService)</pre>
<div class="block">Passes an alternative executor service that will be used for manifests and data files deletion.
<p>Manifest files that are no longer used by valid snapshots will be deleted. Data files that
were deleted by snapshots that are expired will be deleted.
<p>If this method is not called, unnecessary manifests and data files will still be deleted
using a single threaded executor service.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>executorService</code> - an executor service to parallelize tasks to delete manifests and data
files</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this for method chaining</dd>
</dl>
</li>
</ul>
<a name="planWith-java.util.concurrent.ExecutorService-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>planWith</h4>
<pre><a href="../../../org/apache/iceberg/ExpireSnapshots.html" title="interface in org.apache.iceberg">ExpireSnapshots</a>&nbsp;planWith(java.util.concurrent.ExecutorService&nbsp;executorService)</pre>
<div class="block">Passes an alternative executor service that will be used for planning. If this method is not
called, the default worker pool will be used.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>executorService</code> - an executor service to plan</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this for method chaining</dd>
</dl>
</li>
</ul>
<a name="cleanExpiredFiles-boolean-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>cleanExpiredFiles</h4>
<pre><a href="../../../org/apache/iceberg/ExpireSnapshots.html" title="interface in org.apache.iceberg">ExpireSnapshots</a>&nbsp;cleanExpiredFiles(boolean&nbsp;clean)</pre>
<div class="block">Allows expiration of snapshots without any cleanup of underlying manifest or data files.
<p>Allows control in removing data and manifest files which may be more efficiently removed
using a distributed framework through the actions API.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>clean</code> - setting this to false will skip deleting expired manifests and files</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this for method chaining</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/iceberg/EnvironmentContext.html" title="class in org.apache.iceberg"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../org/apache/iceberg/FieldMetrics.html" title="class in org.apache.iceberg"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?org/apache/iceberg/ExpireSnapshots.html" target="_top">Frames</a></li>
<li><a href="ExpireSnapshots.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>