Jibing-Li commented on code in PR #13969: URL: https://github.com/apache/doris/pull/13969#discussion_r1013905264
########## fe/fe-core/src/main/java/org/apache/doris/catalog/HiveMetaStoreClientHelper.java: ########## @@ -135,28 +140,46 @@ public static String getFormat(String input) throws DdlException { } } - public static HiveMetaStoreClient getClient(String metaStoreUris) throws DdlException { + public static IMetaStoreClient getClient(String metaStoreUris) throws DdlException { HiveConf hiveConf = new HiveConf(); hiveConf.setVar(HiveConf.ConfVars.METASTOREURIS, metaStoreUris); - HiveMetaStoreClient hivemetastoreclient = null; + return getClient(hiveConf); + } + + public static IMetaStoreClient getClient(HiveConf hiveConf) throws DdlException { + hiveConf.set(ConfVars.METASTORE_CLIENT_SOCKET_TIMEOUT.name(), + String.valueOf(Config.hive_metastore_client_timeout_second)); + Properties prop = hiveConf.getAllProperties(); + for (String key : prop.stringPropertyNames()) { + LOG.info("cmy debug key: {}, value: {}", key, prop.getProperty(key)); + } + IMetaStoreClient metaStoreClient = null; + String type = hiveConf.get(HIVE_METASTORE_TYPE); + LOG.info("cmy debug type: {}", type); Review Comment: LOG.debug? ########## fe/fe-core/src/main/java/org/apache/doris/catalog/HiveMetaStoreClientHelper.java: ########## @@ -135,28 +140,46 @@ public static String getFormat(String input) throws DdlException { } } - public static HiveMetaStoreClient getClient(String metaStoreUris) throws DdlException { + public static IMetaStoreClient getClient(String metaStoreUris) throws DdlException { HiveConf hiveConf = new HiveConf(); hiveConf.setVar(HiveConf.ConfVars.METASTOREURIS, metaStoreUris); - HiveMetaStoreClient hivemetastoreclient = null; + return getClient(hiveConf); + } + + public static IMetaStoreClient getClient(HiveConf hiveConf) throws DdlException { + hiveConf.set(ConfVars.METASTORE_CLIENT_SOCKET_TIMEOUT.name(), + String.valueOf(Config.hive_metastore_client_timeout_second)); + Properties prop = hiveConf.getAllProperties(); + for (String key : prop.stringPropertyNames()) { + LOG.info("cmy debug key: {}, value: {}", key, prop.getProperty(key)); Review Comment: Set to LOG.debug? ########## fe/fe-core/src/main/java/org/apache/doris/datasource/EsExternalCatalog.java: ########## @@ -74,61 +76,45 @@ public class EsExternalCatalog extends ExternalCatalog { /** * Default constructor for EsExternalCatalog. */ - public EsExternalCatalog(long catalogId, String name, Map<String, String> props) throws DdlException { + public EsExternalCatalog(long catalogId, String name, Map<String, String> props) { this.id = catalogId; this.name = name; this.type = "es"; - validate(props); + setProperties(props); this.catalogProperty = new CatalogProperty(); this.catalogProperty.setProperties(props); } - private void validate(Map<String, String> properties) throws DdlException { - if (properties == null) { - throw new DdlException( - "Please set properties of elasticsearch table, " + "they are: hosts, user, password, index"); - } - - if (StringUtils.isBlank(properties.get(PROP_HOSTS))) { - throw new DdlException("Hosts of ES table is null."); - } - nodes = properties.get(PROP_HOSTS).trim().split(","); - // check protocol - for (String seed : nodes) { - if (!seed.startsWith("http")) { - throw new DdlException("the protocol must be used"); - } + private void setProperties(Map<String, String> properties) { Review Comment: I think we need to call `setProperties` in `gsonPostProcess` as well to make sure all properties are set after metadata replay. -- 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...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org