hudi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hong Shen (Jira)" <>
Subject [jira] [Created] (HUDI-657) It's lots of ClientUtils.createMetaClient when write to hudi
Date Thu, 05 Mar 2020 02:42:00 GMT
Hong Shen created HUDI-657:

             Summary: It's lots of ClientUtils.createMetaClient when write to hudi
                 Key: HUDI-657
             Project: Apache Hudi (incubating)
          Issue Type: Bug
            Reporter: Hong Shen

When I write data to hudi, I find it's lots of loading table properties log, and each take 
about 75ms, like below. 

20/03/05 09:20:32.379 INFO FSUtils: Hadoop Configuration: fs.defaultFS: [file:///], Config:[Configuration:
core-default.xml, core-site.xml, mapred-default.xml, mapred-site.xml, yarn-default.xml, yarn-site.xml],
FileSystem: [org.apache.hadoop.fs.aliyun.oss.AliyunOSSFileSystem@563f38c4]
20/03/05 09:20:32.431 INFO HoodieTableConfig: Loading table properties from oss://shenhong-test/mr_100_100_100/.hoodie/
20/03/05 09:20:32.453 INFO HoodieTableMetaClient: Finished Loading Table of type MERGE_ON_READ(version=1)
from oss://shenhong-test/mr_100_100_100


It's seems we have to create HoodieTableMetaClient when we use it.  but it's not need to
do that, eg, when we call  getHoodieTable, it transfer metaClient, but the constructed function
in HoodieTable still createMetaClient .

public static <T extends HoodieRecordPayload> HoodieTable<T> getHoodieTable(HoodieTableMetaClient
 HoodieWriteConfig config, JavaSparkContext jsc) {
 switch (metaClient.getTableType()) {
 return new HoodieCopyOnWriteTable<>(config, jsc);
 return new HoodieMergeOnReadTable<>(config, jsc);
 throw new HoodieException("Unsupported table type :" + metaClient.getTableType());


  protected HoodieTable(HoodieWriteConfig config, JavaSparkContext jsc) {
    this.config = config;
    this.hadoopConfiguration = new SerializableConfiguration(jsc.hadoopConfiguration());
    this.viewManager = FileSystemViewManager.createViewManager(new SerializableConfiguration(jsc.hadoopConfiguration()),
    this.metaClient = ClientUtils.createMetaClient(jsc, config, true);
    this.index = HoodieIndex.createIndex(config, jsc);


 I can optimize it if it need.

This message was sent by Atlassian Jira

View raw message