You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "morningman (via GitHub)" <gi...@apache.org> on 2023/06/14 08:07:13 UTC

[GitHub] [doris] morningman commented on a diff in pull request #20591: [fix](multi-catalog)fix s3 check, complete catalog properties

morningman commented on code in PR #20591:
URL: https://github.com/apache/doris/pull/20591#discussion_r1229185186


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HiveMetaStoreCache.java:
##########
@@ -373,12 +374,15 @@ private FileCacheValue loadFiles(FileCacheKey key) {
         }
     }
 
-    private JobConf getJobConf() {
-        Configuration configuration = new HdfsConfiguration();
-        for (Map.Entry<String, String> entry : catalog.getCatalogProperty().getHadoopProperties().entrySet()) {
-            configuration.set(entry.getKey(), entry.getValue());
+    private synchronized JobConf getJobConf() {
+        if (jobConf == null) {
+            Configuration configuration = new HdfsConfiguration();
+            for (Map.Entry<String, String> entry : catalog.getCatalogProperty().getHadoopProperties().entrySet()) {
+                configuration.set(entry.getKey(), entry.getValue());

Review Comment:
   There is a problem, that if we alter the catalog's properties, it will never refresh.
   So we need to refresh this jobConf when refreshing the catalog or altering the catalog



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/CatalogMgr.java:
##########
@@ -417,7 +418,8 @@ public ShowResultSet showCatalogs(ShowCatalogStmt showStmt, String currentCtlg)
                 if (!Strings.isNullOrEmpty(catalog.getResource())) {
                     rows.add(Arrays.asList("resource", catalog.getResource()));
                 }
-                for (Map.Entry<String, String> elem : catalog.getProperties().entrySet()) {
+                Map<String, String> sortedMap = new TreeMap<>(catalog.getProperties()).descendingMap();

Review Comment:
   Add comment to explain why using tree map



##########
fe/fe-core/src/main/java/org/apache/doris/datasource/property/constants/MinioProperties.java:
##########
@@ -0,0 +1,39 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.datasource.property.constants;
+
+import org.apache.doris.datasource.credentials.CloudCredential;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+public class MinioProperties extends BaseProperties {
+
+    public static final String MINIO_PREFIX = "minio.";
+    public static final String ENDPOINT = "minio.endpoint";
+    public static final String REGION = "minio.region";

Review Comment:
   minio does not have `region`, we can use an arbitrary one, user no need to set it.



##########
fe/fe-core/src/main/java/org/apache/doris/fs/remote/dfs/DFSFileSystem.java:
##########
@@ -126,7 +126,7 @@ private UserGroupInformation getUgi(Configuration conf) throws UserException {
             String hadoopUserName = conf.get(HdfsResource.HADOOP_USER_NAME);
             if (hadoopUserName == null) {
                 hadoopUserName = "hadoop";
-                LOG.warn("hadoop.username is unset, use default user: hadoop");
+                LOG.warn(HdfsResource.HADOOP_USER_NAME + " is unset, use default user: hadoop");

Review Comment:
   use `debug` level



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

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org