danny0405 commented on a change in pull request #3226:
URL: https://github.com/apache/hudi/pull/3226#discussion_r664206548



##########
File path: 
hudi-flink/src/main/java/org/apache/hudi/sink/compact/HoodieFlinkCompactor.java
##########
@@ -75,15 +75,28 @@ public static void main(String[] args) throws Exception {
 
     // judge whether have operation
     // to compute the compaction instant time and do compaction.
-    String compactionInstantTime = 
CompactionUtil.getCompactionInstantTime(metaClient);
-    boolean scheduled = 
writeClient.scheduleCompactionAtInstant(compactionInstantTime, Option.empty());
-    if (!scheduled) {
+    if (cfg.schedule) {
+      String compactionInstantTime = 
CompactionUtil.getCompactionInstantTime(metaClient);
+      boolean scheduled = 
writeClient.scheduleCompactionAtInstant(compactionInstantTime, Option.empty());
+      if (!scheduled) {
+        // do nothing.
+        LOG.info("No compaction plan for this job ");
+        return;
+      }
+    }
+
+    table.getMetaClient().reloadActiveTimeline();
+
+    // the last instant takes the highest priority
+    Option<HoodieInstant> lastRequested = 
table.getActiveTimeline().filterPendingCompactionTimeline()

Review comment:
       I think we can.




-- 
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