Package org.apache.iceberg.actions
Interface FileRewritePlanner<I,T extends ContentScanTask<F>,F extends ContentFile<F>,G extends RewriteGroupBase<I,T,F>>
- Type Parameters:
I
- the Java type of the plan info likeRewriteDataFiles.FileGroupInfo
orRewritePositionDeleteFiles.FileGroupInfo
T
- the Java type of the input scan tasks (input)F
- the Java type of the content files (input and output)G
- the Java type of the rewrite file group likeRewriteFileGroup
orRewritePositionDeletesGroup
- All Known Implementing Classes:
BinPackRewriteFilePlanner
,BinPackRewritePositionDeletePlanner
,SizeBasedFileRewritePlanner
public interface FileRewritePlanner<I,T extends ContentScanTask<F>,F extends ContentFile<F>,G extends RewriteGroupBase<I,T,F>>
A class for planning a rewrite operation.
A Rewrite Operation is performed by several classes working in conjunction.
FileRewritePlanner
- (this class) which scans the files in the table and determines which files should be rewritten and how they should be grouped. The grouping is based on partitioning and the planning could create multiple groups within a partition. This produces aFileRewritePlan
.FileRewritePlan
- This immutable output of the planner contains a set of groups likeRewriteFileGroup
orRewritePositionDeletesGroup
, each containing a set of files that are meant to be compacted together by theFileRewriteRunner
.FileRewriteRunner
- The runner is the engine specific implementation that can take aFileRewritePlan
and perform a rewrite on each of the groups within. This is the actual implementation of the rewrite which generates new files.
The lifecycle for the planner looks like the following:
init(Map)
initializes the planner with the configuration parametersplan()
called for generating theFileRewritePlan
for the given parameters.
-
Method Details
-
description
Returns a description for this planner. -
validOptions
Returns a set of supported options for this planner. Only options specified in this list will be accepted at runtime. Any other options will be rejected. -
init
Initializes this planner using provided options.- Parameters:
options
- options to initialize this planner
-
plan
FileRewritePlan<I,T, plan()F, G> Generates the plan for rewrite.- Returns:
- the generated plan which could be executed during the compaction
-