Package org.apache.iceberg.actions
Class RewriteManifestsAction
- java.lang.Object
-
- org.apache.iceberg.actions.RewriteManifestsAction
-
- All Implemented Interfaces:
Action<RewriteManifestsActionResult>,SnapshotUpdateAction<RewriteManifestsAction,RewriteManifestsActionResult>
public class RewriteManifestsAction extends java.lang.ObjectAn action that rewrites manifests in a distributed manner and co-locates metadata for partitions.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 tospecId(int). In addition, there is a way to configure a custom location for new manifests viastagingLocation.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcommit(SnapshotUpdate<?> update)RewriteManifestsActionResultexecute()Executes this action.protected java.lang.StringmetadataTableName(MetadataTableType type)RewriteManifestsActionrewriteIf(java.util.function.Predicate<ManifestFile> newPredicate)Rewrites only manifests that match the given predicate.protected RewriteManifestsActionself()ThisTset(java.lang.String property, java.lang.String value)RewriteManifestsActionspecId(int specId)RewriteManifestsActionstagingLocation(java.lang.String newStagingLocation)Passes a location where the manifests should be written.protected Tabletable()RewriteManifestsActionuseCaching(boolean newUseCaching)Configures whether the action should cache manifest entries used in multiple jobs.
-
-
-
Method Detail
-
self
protected RewriteManifestsAction self()
-
table
protected Table table()
-
specId
public RewriteManifestsAction specId(int specId)
-
rewriteIf
public RewriteManifestsAction rewriteIf(java.util.function.Predicate<ManifestFile> newPredicate)
Rewrites only manifests that match the given predicate.- Parameters:
newPredicate- a predicate- Returns:
- this for method chaining
-
stagingLocation
public RewriteManifestsAction stagingLocation(java.lang.String newStagingLocation)
Passes a location where the manifests should be written.- Parameters:
newStagingLocation- a staging location- Returns:
- this for method chaining
-
useCaching
public RewriteManifestsAction useCaching(boolean newUseCaching)
Configures whether the action should cache manifest entries used in multiple jobs.- Parameters:
newUseCaching- a flag whether to use caching- Returns:
- this for method chaining
-
execute
public RewriteManifestsActionResult execute()
Description copied from interface:ActionExecutes this action.- Returns:
- the result of this action
-
set
public ThisT set(java.lang.String property, java.lang.String value)- Specified by:
setin interfaceSnapshotUpdateAction<ThisT,R>
-
commit
protected void commit(SnapshotUpdate<?> update)
-
metadataTableName
protected java.lang.String metadataTableName(MetadataTableType type)
-
-