CTTY commented on code in PR #17661:
URL: https://github.com/apache/hudi/pull/17661#discussion_r2648605266
##########
hudi-common/src/main/java/org/apache/hudi/storage/HoodieStorageUtils.java:
##########
@@ -44,4 +44,27 @@ public static HoodieStorage getStorage(StoragePath path,
StorageConfiguration<?>
throw new HoodieException("Unable to create " + storageClass, e);
}
}
+
+ /**
+ * Creates a {@link HoodieStorage} instance using custom constructor
parameters.
+ * This method uses reflection to instantiate the storage class with
provided parameter types.
+ *
+ * @param conf storage configuration containing the storage class name
+ * @param paramTypes array of parameter types for the constructor
+ * @param params array of parameter values for the constructor
+ * @return {@link HoodieStorage} instance
+ * @throws HoodieException if unable to create the storage instance
+ */
+ public static HoodieStorage getStorage(StorageConfiguration<?> conf,
Review Comment:
I don't think we should add this method. This will fail all storage
implementations that don't have a constructor that takes `params`.
Looking at other changes, it seems like only purpose of this method is to
instantiate `HoodieHadoopStorage` when you only have `FileSystem` available. We
should get path somehow and use the util method that takes `{StoragePath.class,
StorageConfiguration.class}`. In the worst case, we should stay using
`HoodieHadoopStorage` constructor when `path` is not even available
--
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]