You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/10/27 04:21:16 UTC

[GitHub] [hudi] chenshzh commented on a diff in pull request #7017: [HUDI-5066] Support flink hoodie source metaclient cache

chenshzh commented on code in PR #7017:
URL: https://github.com/apache/hudi/pull/7017#discussion_r1006389908


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/HoodieTableSource.java:
##########
@@ -162,7 +163,7 @@ public HoodieTableSource(
     this.limit = limit == null ? NO_LIMIT_CONSTANT : limit;
     this.filters = filters == null ? Collections.emptyList() : filters;
     this.hadoopConf = HadoopConfigurations.getHadoopConf(conf);
-    this.metaClient = StreamerUtil.metaClientForReader(conf, hadoopConf);
+    this.metaClient = Optional.ofNullable(metaClient).orElse(StreamerUtil.metaClientForReader(conf, hadoopConf));

Review Comment:
   > initialization lazy
   
   Here we have some more consideration: 
   
   During planned and optimized **metaclient** or **fileindex** might be used  by different rules' **hoodie source** copy instance for multi times. 
   For example, actually **fileindex** is used in **PushPartitionIntoTableSourceScanRule** and **PushFilterIntoSourceScanRuleBase**
   
   So it seems that initialization lazy will also cause the multi construction ?



-- 
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-unsubscribe@hudi.apache.org

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