public interface ExpireSnapshots extends PendingUpdate<java.util.List<Snapshot>>
snapshotsfrom a table.
This API accumulates snapshot deletions and commits the new list to the table. This API does not allow deleting the current snapshot.
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.
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.
deleteWith(Consumer) can be used
to pass an alternative deletion method.
PendingUpdate.apply() returns a list of the snapshots that will be removed.
|Modifier and Type||Method and Description|
Passes an alternative delete implementation that will be used for manifests and data files.
Expires all snapshots older than the given timestamp.
Expires a specific
ExpireSnapshots expireSnapshotId(long snapshotId)
Snapshotidentified by id.
snapshotId- long id of the snapshot to expire
ExpireSnapshots expireOlderThan(long timestampMillis)
timestampMillis- a long timestamp, as returned by
ExpireSnapshots deleteWith(java.util.function.Consumer<java.lang.String> deleteFunc)
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.
If this method is not called, unnecessary manifests and data files will still be deleted.
deleteFunc- a function that will be called to delete manifests and data files