yuzhaojing commented on a change in pull request #4463:
URL: https://github.com/apache/hudi/pull/4463#discussion_r776565278
##########
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:
When the number of filegroups contained in the compression plan is
relatively large, it will be very expensive to createTable and read the
compression plan for each event received.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]