SteNicholas commented on code in PR #100:
URL: 
https://github.com/apache/incubator-paimon-webui/pull/100#discussion_r1411999590


##########
paimon-web-api/src/main/java/org/apache/paimon/web/api/catalog/PaimonServiceFactory.java:
##########
@@ -26,15 +26,30 @@
 
 import org.apache.commons.lang3.StringUtils;
 
+import java.util.HashMap;
+import java.util.Map;
+
 /** Paimon service factory. */
 public class PaimonServiceFactory {
 
-    public static PaimonService createFileSystemCatalogService(String name, 
String warehouse) {
+    public static PaimonService createFileSystemCatalogService(
+            String name, String warehouse, Map<String, String> catalogOptions) 
{
+        if (catalogOptions == null) {
+            catalogOptions = new HashMap<>();
+        }
         Options options = new Options();
         options.set(CatalogProperties.WAREHOUSE, warehouse + "/" + name);
-
+        String fileSystemType = catalogOptions.get("fileSystemType");
+        if ("s3".equals(fileSystemType)) {

Review Comment:
   ```suggestion
           if ("s3".equalsIgnoreCase(fileSystemType)) {
   ```



##########
paimon-web-api/src/main/java/org/apache/paimon/web/api/catalog/PaimonServiceFactory.java:
##########
@@ -26,15 +26,30 @@
 
 import org.apache.commons.lang3.StringUtils;
 
+import java.util.HashMap;
+import java.util.Map;
+
 /** Paimon service factory. */
 public class PaimonServiceFactory {
 
-    public static PaimonService createFileSystemCatalogService(String name, 
String warehouse) {
+    public static PaimonService createFileSystemCatalogService(
+            String name, String warehouse, Map<String, String> catalogOptions) 
{
+        if (catalogOptions == null) {
+            catalogOptions = new HashMap<>();
+        }
         Options options = new Options();
         options.set(CatalogProperties.WAREHOUSE, warehouse + "/" + name);
-
+        String fileSystemType = catalogOptions.get("fileSystemType");
+        if ("s3".equals(fileSystemType)) {
+            options.set(CatalogProperties.S3_ENDPOINT, 
catalogOptions.get("endpoint"));
+            options.set(CatalogProperties.S3_ACCESS_KEY, 
catalogOptions.get("accessKey"));
+            options.set(CatalogProperties.S3_SECRET_KEY, 
catalogOptions.get("secretKey"));
+        } else if ("oss".equals(fileSystemType)) {

Review Comment:
   ```suggestion
           } else if ("oss".equalsIgnoreCase(fileSystemType)) {
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to