[ 
https://issues.apache.org/jira/browse/HUDI-2135?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17375155#comment-17375155
 ] 

ASF GitHub Bot commented on HUDI-2135:
--------------------------------------

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



##########
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:
       should we also make this configurable? First in first out or last in 
first out.




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


> Add compaction schedule option for flink
> ----------------------------------------
>
>                 Key: HUDI-2135
>                 URL: https://issues.apache.org/jira/browse/HUDI-2135
>             Project: Apache Hudi
>          Issue Type: Improvement
>          Components: Flink Integration
>            Reporter: Danny Chen
>            Assignee: Danny Chen
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 0.9.0
>
>




--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to