public interface ExpireSnapshots extends Action<ExpireSnapshots,ExpireSnapshots.Result>
Similar to ExpireSnapshots
but may use a query engine to distribute
parts of the work.
Modifier and Type | Interface and Description |
---|---|
static interface |
ExpireSnapshots.Result
The action result that contains a summary of the execution.
|
Modifier and Type | Method and Description |
---|---|
ExpireSnapshots |
deleteWith(java.util.function.Consumer<java.lang.String> deleteFunc)
Passes an alternative delete implementation that will be used for manifests, data and delete
files.
|
ExpireSnapshots |
executeDeleteWith(java.util.concurrent.ExecutorService executorService)
Passes an alternative executor service that will be used for files removal.
|
ExpireSnapshots |
expireOlderThan(long timestampMillis)
Expires all snapshots older than the given timestamp.
|
ExpireSnapshots |
expireSnapshotId(long snapshotId)
Expires a specific
Snapshot identified by id. |
ExpireSnapshots |
retainLast(int numSnapshots)
Retains the most recent ancestors of the current snapshot.
|
ExpireSnapshots expireSnapshotId(long snapshotId)
Snapshot
identified by id.
Identical to ExpireSnapshots.expireSnapshotId(long)
snapshotId
- id of the snapshot to expireExpireSnapshots expireOlderThan(long timestampMillis)
Identical to ExpireSnapshots.expireOlderThan(long)
timestampMillis
- a long timestamp, as returned by System.currentTimeMillis()
ExpireSnapshots retainLast(int numSnapshots)
If a snapshot would be expired because it is older than the expiration timestamp, but is one
of the numSnapshots
most recent ancestors of the current state, it will be retained.
This will not cause snapshots explicitly identified by id from expiring.
Identical to ExpireSnapshots.retainLast(int)
numSnapshots
- the number of snapshots to retainExpireSnapshots deleteWith(java.util.function.Consumer<java.lang.String> deleteFunc)
Manifest files that are no longer used by valid snapshots will be deleted. Content files that were marked as logically deleted by snapshots that are expired will be deleted as well.
If this method is not called, unnecessary manifests and content files will still be deleted.
Identical to ExpireSnapshots.deleteWith(Consumer)
deleteFunc
- a function that will be called to delete manifests and data filesExpireSnapshots executeDeleteWith(java.util.concurrent.ExecutorService executorService)
deleteWith(Consumer)
or if the
FileIO does not support bulk deletes
. Otherwise, parallelism
should be controlled by the IO specific deleteFiles
method.
If this method is not called and bulk deletes are not supported, unnecessary manifests and content files will still be deleted in the current thread.
Identical to ExpireSnapshots.executeDeleteWith(ExecutorService)
executorService
- the service to use