Package org.apache.iceberg.util
Class SnapshotUtil
- java.lang.Object
-
- org.apache.iceberg.util.SnapshotUtil
-
public class SnapshotUtil extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.List<java.lang.Long>
ancestorIds(Snapshot snapshot, java.util.function.Function<java.lang.Long,Snapshot> lookup)
static boolean
ancestorOf(Table table, long snapshotId, long ancestorSnapshotId)
static java.util.List<java.lang.Long>
currentAncestors(Table table)
Return the snapshot IDs for the ancestors of the current table state.static java.util.List<DataFile>
newFiles(java.lang.Long baseSnapshotId, long latestSnapshotId, java.util.function.Function<java.lang.Long,Snapshot> lookup)
static java.util.List<java.lang.Long>
snapshotIdsBetween(Table table, long fromSnapshotId, long toSnapshotId)
-
-
-
Method Detail
-
ancestorOf
public static boolean ancestorOf(Table table, long snapshotId, long ancestorSnapshotId)
- Returns:
- whether ancestorSnapshotId is an ancestor of snapshotId
-
currentAncestors
public static java.util.List<java.lang.Long> currentAncestors(Table table)
Return the snapshot IDs for the ancestors of the current table state.Ancestor IDs are ordered by commit time, descending. The first ID is the current snapshot, followed by its parent, and so on.
- Parameters:
table
- aTable
- Returns:
- a set of snapshot IDs of the known ancestor snapshots, including the current ID
-
snapshotIdsBetween
public static java.util.List<java.lang.Long> snapshotIdsBetween(Table table, long fromSnapshotId, long toSnapshotId)
- Returns:
- List of snapshot ids in the range - (fromSnapshotId, toSnapshotId] This method assumes that fromSnapshotId is an ancestor of toSnapshotId
-
ancestorIds
public static java.util.List<java.lang.Long> ancestorIds(Snapshot snapshot, java.util.function.Function<java.lang.Long,Snapshot> lookup)
-
-