danny0405 commented on code in PR #13216:
URL: https://github.com/apache/hudi/pull/13216#discussion_r2178832023


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/source/stats/FileStatsIndex.java:
##########
@@ -103,17 +105,22 @@ public String getIndexPartitionName() {
   public HoodieTableMetadata getMetadataTable() {
     // initialize the metadata table lazily
     if (this.metadataTable == null) {
-      HoodieHadoopStorage storage = new HoodieHadoopStorage(basePath, 
FlinkClientUtil.getHadoopConf());
-      HoodieTableMetaClient metaClient = 
HoodieTableMetaClient.builder().setBasePath(basePath).setConf(storage.getConf()).build();
+      initMetaClient();
       this.metadataTable = 
metaClient.getTableFormat().getMetadataFactory().create(
           HoodieFlinkEngineContext.DEFAULT,
-          storage,
-          metadataConfig,
+          metaClient.getStorage(),
+          StreamerUtil.metadataConfig(conf),
           basePath);
     }
     return this.metadataTable;
   }
 
+  private void initMetaClient() {
+    if (this.metaClient == null) {
+      this.metaClient = StreamerUtil.createMetaClient(conf);

Review Comment:
   yeah, for most of the the utilities method we put it here. we also have 
other utilities, you can check all the other utility classes under the same 
package.



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

Reply via email to