jonvex commented on code in PR #11131:
URL: https://github.com/apache/hudi/pull/11131#discussion_r1594396489


##########
hudi-common/src/main/java/org/apache/hudi/storage/HoodieStorageUtils.java:
##########
@@ -34,22 +32,35 @@ public static HoodieStorage 
getStorage(StorageConfiguration<?> conf) {
   }
 
   public static HoodieStorage getStorage(FileSystem fs) {
-    return new HoodieHadoopStorage(fs);
+    return (HoodieStorage) 
ReflectionUtils.loadClass("org.apache.hudi.storage.hadoop.HoodieHadoopStorage", 
new Class<?>[] {FileSystem.class}, fs);
+  }
+
+  public static HoodieStorage getStorage(String basePath) {
+    return (HoodieStorage) 
ReflectionUtils.loadClass("org.apache.hudi.storage.hadoop.HoodieHadoopStorage", 
new Class<?>[] {String.class}, basePath);
   }
 
   public static HoodieStorage getStorage(String basePath, 
StorageConfiguration<?> conf) {
-    return getStorage(HadoopFSUtils.getFs(basePath, conf));
+    return (HoodieStorage) 
ReflectionUtils.loadClass("org.apache.hudi.storage.hadoop.HoodieHadoopStorage", 
new Class<?>[] {String.class, StorageConfiguration.class}, basePath, conf);
+  }
+
+  public static HoodieStorage getStorage(String basePath, Configuration conf) {
+    return (HoodieStorage) 
ReflectionUtils.loadClass("org.apache.hudi.storage.hadoop.HoodieHadoopStorage", 
new Class<?>[] {String.class, Configuration.class}, basePath, conf);
   }
 
   public static HoodieStorage getStorage(StoragePath path, 
StorageConfiguration<?> conf) {
-    return getStorage(HadoopFSUtils.getFs(path, 
conf.unwrapAs(Configuration.class)));
+    return (HoodieStorage) 
ReflectionUtils.loadClass("org.apache.hudi.storage.hadoop.HoodieHadoopStorage", 
new Class<?>[] {StoragePath.class, StorageConfiguration.class}, path, conf);
   }
 
   public static HoodieStorage getRawStorage(HoodieStorage storage) {
-    FileSystem fs = (FileSystem) storage.getFileSystem();
-    if (fs instanceof HoodieWrapperFileSystem) {
-      return getStorage(((HoodieWrapperFileSystem) fs).getFileSystem());
-    }
-    return storage;
+    return (HoodieStorage) 
ReflectionUtils.loadClass("org.apache.hudi.storage.hadoop.HoodieHadoopStorage", 
new Class<?>[] {HoodieStorage.class}, storage);
+  }
+
+  public static StorageConfiguration<?> getNewStorageConf() {

Review Comment:
   Why?



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