CalvinKirs commented on code in PR #46833:
URL: https://github.com/apache/doris/pull/46833#discussion_r1944126668


##########
fe/fe-core/src/main/java/org/apache/doris/datasource/property/storage/StorageProperties.java:
##########
@@ -0,0 +1,108 @@
+// 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.ConnectionProperties;
+import org.apache.doris.datasource.property.ConnectorProperty;
+
+import com.google.common.collect.Lists;
+import lombok.Getter;
+
+import java.lang.reflect.Field;
+import java.util.List;
+import java.util.Map;
+
+public class StorageProperties extends ConnectionProperties {
+
+    public static final String FS_HDFS_SUPPORT = "fs.hdfs.support";
+    public static final String FS_S3_SUPPORT = "fs.s3.support";
+    public static final String FS_GCS_SUPPORT = "fs.gcs.support";
+    public static final String FS_AZURE_SUPPORT = "fs.azure.support";
+
+    public enum Type {
+        HDFS,
+        S3,
+        UNKNOWN
+    }
+
+    @Getter
+    protected Type type;
+
+    /**
+     * The purpose of this method is to create a list of StorageProperties 
based on the user specified properties.
+     *
+     * @param origProps
+     * @return
+     * @throws UserException
+     */
+    public static List<StorageProperties> create(Map<String, String> 
origProps) {
+        List<StorageProperties> storageProperties = Lists.newArrayList();
+        // 1. parse the storage properties by user specified fs.xxx.support 
properties
+        if (isFsSupport(origProps, FS_HDFS_SUPPORT)) {
+            storageProperties.add(new HDFSProperties(origProps));
+        } else {
+            // always try to add hdfs properties, because in previous version, 
we don't have fs.xxx.support properties,
+            // the hdfs properties may be loaded from the configuration file.
+            // so there is no way to guess the storage type.
+            storageProperties.add(new HDFSProperties(origProps));
+        }
+

Review Comment:
   If we do this, then S3 (or any other cloud storage using the HDFS protocol) 
will inherit HDFS parameters. In other words, we would have to set hadoop.name 
and hadoop.config.resources. Does that make sense?



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