jerryshao commented on code in PR #5634:
URL: https://github.com/apache/gravitino/pull/5634#discussion_r1869326511
##########
catalogs/catalog-hadoop/src/main/java/org/apache/gravitino/catalog/hadoop/fs/FileSystemUtils.java:
##########
@@ -41,12 +41,27 @@ public static Map<String, FileSystemProvider>
getFileSystemProviders(String file
ServiceLoader<FileSystemProvider> allFileSystemProviders =
ServiceLoader.load(FileSystemProvider.class);
+ if (null == fileSystemProviders) {
+ // If the file system providers are not specified, return all file
system providers.
+ Streams.stream(allFileSystemProviders.iterator())
+ .forEach(
+ fileSystemProvider -> {
+ if (resultMap.containsKey(fileSystemProvider.scheme())) {
+ throw new UnsupportedOperationException(
+ String.format(
+ "File system provider: '%s' with scheme '%s' already
exists in the provider list, "
+ + "please make sure the file system provider
scheme is unique.",
+ fileSystemProvider.getClass().getName(),
fileSystemProvider.scheme()));
+ }
+ resultMap.put(fileSystemProvider.scheme(), fileSystemProvider);
+ });
+ return resultMap;
Review Comment:
Do we also need to add HDFS and local FS provider here?
--
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]