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



##########
File path: 
hudi-flink/src/main/java/org/apache/hudi/sink/compact/CompactionCommitSink.java
##########
@@ -108,8 +124,15 @@ public void invoke(CompactionCommitEvent event, Context 
context) throws Exceptio
    * @param events  Commit events ever received for the instant
    */
   private void commitIfNecessary(String instant, 
Collection<CompactionCommitEvent> events) throws IOException {
-    HoodieCompactionPlan compactionPlan = CompactionUtils.getCompactionPlan(
-        this.writeClient.getHoodieTable().getMetaClient(), instant);
+    HoodieCompactionPlan compactionPlan;
+    if (compactionPlanCache.containsKey(instant)) {
+      compactionPlan = compactionPlanCache.get(instant);
+    } else {
+      compactionPlan = CompactionUtils.getCompactionPlan(
+          this.table.getMetaClient(), instant);
+      compactionPlanCache.put(instant, compactionPlan);

Review comment:
       What is the benefit to cache the compaction plan ? Personally i prefer 
less cached items, the less states the better.




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