public class RewriteManifestsAction
extends java.lang.Object
By default, this action rewrites all manifests for the current partition spec and writes the result
to the metadata folder. The behavior can be modified by passing a custom predicate to rewriteIf(Predicate)
and a custom spec id to specId(int)
. In addition, there is a way to configure a custom location
for new manifests via stagingLocation
.
Modifier and Type | Method and Description |
---|---|
protected void |
commit(SnapshotUpdate<?> update) |
RewriteManifestsActionResult |
execute()
Executes this action.
|
protected java.util.List<java.lang.String> |
getManifestListPaths(java.lang.Iterable<Snapshot> snapshots)
Returns all the path locations of all Manifest Lists for a given list of snapshots
|
protected java.util.List<java.lang.String> |
getOtherMetadataFilePaths(TableOperations ops)
Returns all Metadata file paths which may not be in the current metadata.
|
protected java.lang.String |
metadataTableName(MetadataTableType type) |
protected java.lang.String |
metadataTableName(java.lang.String tableName,
MetadataTableType type) |
RewriteManifestsAction |
rewriteIf(java.util.function.Predicate<ManifestFile> newPredicate)
Rewrites only manifests that match the given predicate.
|
protected RewriteManifestsAction |
self() |
ThisT |
set(java.lang.String property,
java.lang.String value) |
RewriteManifestsAction |
specId(int specId) |
RewriteManifestsAction |
stagingLocation(java.lang.String newStagingLocation)
Passes a location where the manifests should be written.
|
protected Table |
table() |
RewriteManifestsAction |
useCaching(boolean newUseCaching)
Configures whether the action should cache manifest entries used in multiple jobs.
|
protected RewriteManifestsAction self()
protected Table table()
public RewriteManifestsAction specId(int specId)
public RewriteManifestsAction rewriteIf(java.util.function.Predicate<ManifestFile> newPredicate)
newPredicate
- a predicatepublic RewriteManifestsAction stagingLocation(java.lang.String newStagingLocation)
newStagingLocation
- a staging locationpublic RewriteManifestsAction useCaching(boolean newUseCaching)
newUseCaching
- a flag whether to use cachingpublic RewriteManifestsActionResult execute()
Action
public ThisT set(java.lang.String property, java.lang.String value)
set
in interface SnapshotUpdateAction<ThisT,R>
protected void commit(SnapshotUpdate<?> update)
protected java.lang.String metadataTableName(MetadataTableType type)
protected java.lang.String metadataTableName(java.lang.String tableName, MetadataTableType type)
protected java.util.List<java.lang.String> getManifestListPaths(java.lang.Iterable<Snapshot> snapshots)
snapshots
- snapshotsprotected java.util.List<java.lang.String> getOtherMetadataFilePaths(TableOperations ops)
ops
- TableOperations for the table we will be getting paths from