danny0405 commented on code in PR #11440:
URL: https://github.com/apache/hudi/pull/11440#discussion_r1674895597


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/action/clean/CleanPlanActionExecutor.java:
##########
@@ -149,17 +150,24 @@ HoodieCleanerPlan requestClean(HoodieEngineContext 
context) {
           .map(x -> new HoodieActionInstant(x.getTimestamp(), x.getAction(), 
x.getState().name())).orElse(null),
           planner.getLastCompletedCommitTimestamp(),
           config.getCleanerPolicy().name(), Collections.emptyMap(),
-          CleanPlanner.LATEST_CLEAN_PLAN_VERSION, cleanOps, 
partitionsToDelete, prepareExtraMetadata(planner.getSavepointedTimestamps()));
+          CleanPlanner.LATEST_CLEAN_PLAN_VERSION, cleanOps, 
partitionsToDelete, prepareExtraMetadata(planner.getSavepointedTimestamps(), 
planner.getEarliestCommitToNotArchive()));
     } catch (IOException e) {
       throw new HoodieIOException("Failed to schedule clean operation", e);
     }
   }
 
-  private Map<String, String> prepareExtraMetadata(List<String> 
savepointedTimestamps) {
-    if (savepointedTimestamps.isEmpty()) {
+  private Map<String, String> prepareExtraMetadata(List<String> 
savepointedTimestamps, Option<String> earliestCommitToNotArchive) {
+    if (savepointedTimestamps.isEmpty() && 
!earliestCommitToNotArchive.isPresent()) {
       return Collections.emptyMap();
     } else {
-      return Collections.singletonMap(SAVEPOINTED_TIMESTAMPS, 
savepointedTimestamps.stream().collect(Collectors.joining(",")));
+      Map<String, String> extraMetadata = new HashMap<>();
+      if (!savepointedTimestamps.isEmpty()) {
+        extraMetadata.put(SAVEPOINTED_TIMESTAMPS, 
savepointedTimestamps.stream().collect(Collectors.joining(",")));
+      }
+      if (earliestCommitToNotArchive.isPresent()) {
+        extraMetadata.put(EARLIEST_COMMIT_TO_NOT_ARCHIVE, 
earliestCommitToNotArchive.get());

Review Comment:
   Can we put the name more straight-forward like `SKIPPED_REPLACED_SAVEPOINTS`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@hudi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to