public class SnapshotUtil
extends java.lang.Object
Modifier and Type | Method and 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)
Returns whether ancestorSnapshotId is an ancestor of snapshotId.
|
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)
Returns list of snapshot ids in the range - (fromSnapshotId, toSnapshotId]
|
public static boolean ancestorOf(Table table, long snapshotId, long ancestorSnapshotId)
public static java.util.List<java.lang.Long> currentAncestors(Table table)
Ancestor IDs are ordered by commit time, descending. The first ID is the current snapshot, followed by its parent, and so on.
table
- a Table
public static java.util.List<java.lang.Long> snapshotIdsBetween(Table table, long fromSnapshotId, long toSnapshotId)
This method assumes that fromSnapshotId is an ancestor of toSnapshotId.
public static java.util.List<java.lang.Long> ancestorIds(Snapshot snapshot, java.util.function.Function<java.lang.Long,Snapshot> lookup)