@@ -114,10 +114,16 @@ HoodieCleanerPlan requestClean(HoodieEngineContext context) {
114
114
LOG .info ("Nothing to clean here. It is already clean" );
115
115
return HoodieCleanerPlan .newBuilder ().setPolicy (HoodieCleaningPolicy .KEEP_LATEST_COMMITS .name ()).build ();
116
116
}
117
- LOG .info ("Earliest commit to retain for clean : " + (earliestInstant .isPresent () ? earliestInstant .get ().getTimestamp () : "null" ));
118
- LOG .info ("Total partitions to clean : " + partitionsToClean .size () + ", with policy " + config .getCleanerPolicy ());
117
+ LOG .info (
118
+ "Earliest commit to retain for clean : {}" ,
119
+ earliestInstant .isPresent () ? earliestInstant .get ().getTimestamp () : "null" );
120
+ LOG .info (
121
+ "Total partitions to clean : {}, with policy {}" ,
122
+ partitionsToClean .size (),
123
+ config .getCleanerPolicy ());
119
124
int cleanerParallelism = Math .min (partitionsToClean .size (), config .getCleanerParallelism ());
120
- LOG .info ("Using cleanerParallelism: " + cleanerParallelism );
125
+ LOG .info (
126
+ "Using cleanerParallelism: {}" , cleanerParallelism );
121
127
122
128
context .setJobStatus (this .getClass ().getSimpleName (), "Generating list of file slices to be cleaned: " + config .getTableName ());
123
129
@@ -145,11 +151,15 @@ HoodieCleanerPlan requestClean(HoodieEngineContext context) {
145
151
.collect (Collectors .toList ()));
146
152
}
147
153
148
- return new HoodieCleanerPlan (earliestInstant
149
- .map (x -> new HoodieActionInstant (x .getTimestamp (), x .getAction (), x .getState ().name ())).orElse (null ),
150
- planner .getLastCompletedCommitTimestamp (),
151
- config .getCleanerPolicy ().name (), Collections .emptyMap (),
152
- CleanPlanner .LATEST_CLEAN_PLAN_VERSION , cleanOps , partitionsToDelete , prepareExtraMetadata (planner .getSavepointedTimestamps ()));
154
+ return new HoodieCleanerPlan (
155
+ earliestInstant .map (x -> new HoodieActionInstant (x .getTimestamp (), x .getAction (), x .getState ().name ())).orElse (null ),
156
+ planner .getLastCompletedCommitTimestamp (), // Note: This is the start time of the last completed ingestion before this clean.
157
+ config .getCleanerPolicy ().name (),
158
+ Collections .emptyMap (),
159
+ CleanPlanner .LATEST_CLEAN_PLAN_VERSION ,
160
+ cleanOps ,
161
+ partitionsToDelete ,
162
+ prepareExtraMetadata (planner .getSavepointedTimestamps ()));
153
163
} catch (IOException e ) {
154
164
throw new HoodieIOException ("Failed to schedule clean operation" , e );
155
165
}
0 commit comments