SWJTU-ZhangLei commented on code in PR #48369: URL: https://github.com/apache/doris/pull/48369#discussion_r1982631920
########## fe/fe-core/src/main/java/org/apache/doris/catalog/HdfsStorageVault.java: ########## @@ -85,17 +90,66 @@ public HdfsStorageVault(String name, boolean ifNotExists, boolean setAsDefault) } @Override - public void modifyProperties(Map<String, String> properties) throws DdlException { - for (Map.Entry<String, String> kv : properties.entrySet()) { + public void modifyProperties(Map<String, String> newProperties) throws DdlException { + for (Map.Entry<String, String> kv : newProperties.entrySet()) { replaceIfEffectiveValue(this.properties, kv.getKey(), kv.getValue()); } + checkConnectivity(this.properties); } @Override public Map<String, String> getCopiedProperties() { return Maps.newHashMap(properties); } + public static void checkConnectivity(Map<String, String> newProperties) throws DdlException { + if (newProperties.containsKey(S3Properties.VALIDITY_CHECK) + && newProperties.get(S3Properties.VALIDITY_CHECK).equalsIgnoreCase("false")) { + return; + } + + String hadoopFsName = null; + String pathPrefix = null; + for (Map.Entry<String, String> property : newProperties.entrySet()) { + if (property.getKey().equalsIgnoreCase(HADOOP_FS_NAME)) { + hadoopFsName = property.getValue(); + } else if (property.getKey().equalsIgnoreCase(VAULT_PATH_PREFIX)) { + pathPrefix = property.getValue(); + } + } + Preconditions.checkArgument(!Strings.isNullOrEmpty(hadoopFsName), "%s is null or empty", HADOOP_FS_NAME); + Preconditions.checkArgument(!Strings.isNullOrEmpty(pathPrefix), "%s is null or empty", VAULT_PATH_PREFIX); + + try (DFSFileSystem dfsFileSystem = new DFSFileSystem(newProperties)) { + String remotePath = hadoopFsName + "/" + pathPrefix + "/checkConnectivity"; + Status st = dfsFileSystem.makeDir(remotePath); Review Comment: > What is `checkConnectivity` already exists? Add a timestamp for the check path to solve the problem -- 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