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


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/HDFSProperties.java:
##########
@@ -0,0 +1,195 @@
+// 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.storage;
+
+import org.apache.doris.common.UserException;
+import org.apache.doris.datasource.property.ConnectorProperty;
+
+import com.google.common.base.Strings;
+import org.apache.commons.collections.MapUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.hadoop.conf.Configuration;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class HDFSProperties extends StorageProperties {
+
+    @ConnectorProperty(names = {"hdfs.authentication.type", 
"hadoop.security.authentication"},
+            required = false,
+            description = "The authentication type of HDFS. The default value 
is 'none'.")
+    private String hdfsAuthenticationType = "simple";
+
+    @ConnectorProperty(names = {"hdfs.authentication.kerberos.principal", 
"hadoop.kerberos.principal"},
+            required = false,
+            description = "The principal of the kerberos authentication.")
+    private String hdfsKerberosPrincipal = "";
+
+    @ConnectorProperty(names = {"hdfs.authentication.kerberos.keytab", 
"hadoop.kerberos.keytab"},
+            required = false,
+            description = "The keytab of the kerberos authentication.")
+    private String hdfsKerberosKeytab = "";
+
+    @ConnectorProperty(names = {"hadoop.username"},
+            required = false,
+            description = "The username of Hadoop. Doris will user this user 
to access HDFS")
+    private String hadoopUsername = "";
+
+    @ConnectorProperty(names = {"hadoop.config.resources"},
+            required = false,
+            description = "The xml files of Hadoop configuration.")
+    private String hadoopConfigResources = "";
+
+    @ConnectorProperty(names = {"hdfs.impersonation.enabled"},
+            required = false,
+            supported = false,
+            description = "Whether to enable the impersonation of HDFS.")
+    private boolean hdfsImpersonationEnabled = false;
+
+    @ConnectorProperty(names = {"fs.defaultFS"}, required = false, description 
= "")
+    private String fsDefaultFS = "";
+
+    /**
+     * The final HDFS configuration map that determines the effective settings.
+     * Priority rules:
+     * 1. If a key exists in `overrideConfig` (user-provided settings), its 
value takes precedence.
+     * 2. If a key is not present in `overrideConfig`, the value from 
`hdfs-site.xml` or `core-site.xml` is used.
+     * 3. This map should be used to read the resolved HDFS configuration, 
ensuring the correct precedence is applied.
+     */
+    Map<String, String> finalHdfsConfig;
+
+    public HDFSProperties(Map<String, String> origProps) {
+        super(Type.HDFS, origProps);
+        loadFinalHdfsConfig(origProps);
+    }
+
+    public static boolean guessIsMe(Map<String, String> props) {
+        if (MapUtils.isEmpty(props)) {
+            return false;
+        }
+        if (props.containsKey("hadoop.config.resources") || 
props.containsKey("hadoop.security.authentication")) {
+            return true;
+        }
+        return false;
+    }
+
+    private void loadFinalHdfsConfig(Map<String, String> origProps) {
+        if (MapUtils.isEmpty(origProps)) {
+            return;
+        }
+        finalHdfsConfig = new HashMap<>();

Review Comment:
   better rename it



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

Reply via email to