tengqm commented on code in PR #5634:
URL: https://github.com/apache/gravitino/pull/5634#discussion_r1851194047
##########
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 use provider list "
Review Comment:
```suggestion
"File system provider: '%s' with scheme '%s'
already exists in the provider list, "
```
##########
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 use provider list "
+ + "Please make sure the file system provider
scheme is unique.",
Review Comment:
```suggestion
+ "please make sure the filesystem provider
scheme is unique.",
```
--
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]