pnowojski commented on a change in pull request #11139:  
[FLINK-16015][filesystems]Throw an error when a plugin for a known scheme is 
missing.
URL: https://github.com/apache/flink/pull/11139#discussion_r385571339
 
 

 ##########
 File path: flink-core/src/main/java/org/apache/flink/core/fs/FileSystem.java
 ##########
 @@ -440,8 +467,21 @@ public static FileSystem getUnguardedFileSystem(final URI 
fsUri) throws IOExcept
                                try (TemporaryClassLoaderContext ignored = 
TemporaryClassLoaderContext.of(classLoader)) {
                                        fs = factory.create(uri);
                                }
-                       }
-                       else {
+                       } else if 
(!ALLOWED_FALLBACK_FILESYSTEMS.contains(uri.getScheme()) &&
+                                       
DIRECTLY_SUPPORTED_FILESYSTEM.containsKey(uri.getScheme())) {
+                               final Collection<String> plugins = 
DIRECTLY_SUPPORTED_FILESYSTEM.get(uri.getScheme());
+                               throw new 
UnsupportedFileSystemSchemeException(String.format(
+                                       "Could not find a file system 
implementation for scheme '%s'. The scheme is " +
+                                               "directly supported by Flink 
through the following plugin%s: %s. Please ensure that each " +
+                                               "plugin resides within its own 
subfolder within the plugins directory. See https://ci.apache"; +
+                                               
".org/projects/flink/flink-docs-stable/ops/plugins.html for more information. 
If you want to " +
+                                               "use a Hadoop file system for 
that scheme, please add the scheme to the configuration fs" +
+                                               
".allowed-fallback-filesystems.",
+                                               uri.getScheme(),
+                                               plugins.size() == 1 ? "" : "s",
+                                               String.join(", ", plugins)
+                                       ));
 
 Review comment:
   I'm not sure if I like the `DIRECTLY_SUPPORTED_FILESYSTEM` list, since if it 
drifts out of sync, it can start decreasing the usability.
   
   Maybe as a way to mitigate this issue, we should add a reference to 
https://ci.apache.org/projects/flink/flink-docs-stable/ops/filesystems/ for 
further/more precise  informations?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to