[ 
https://issues.apache.org/jira/browse/HDFS-8750?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14739661#comment-14739661
 ] 

Himanshu commented on HDFS-8750:
--------------------------------

[[email protected]]  HDFS-8750.004.patch should work, I couldn't figure out 
the unit testing for this given that static variable "FILE_SYSTEMS_LOADED" only 
lets loading happen once, so if any other unit test might end up calling the 
initialization and it will never be called again then.

[~cmccabe] yes, it might be backwards incompatible. I am not sure what is the 
right way to deal with that (may be include this only in a new major release of 
hadoop? ). Or, probably add a new configuration property , say 
"fs.use.config.cl", and load using config classloader only if that property is 
set to true. By default property value would be false to keep things backward 
compatible.

> FIleSystem does not honor Configuration.getClassLoader() while loading 
> FileSystem implementations
> -------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-8750
>                 URL: https://issues.apache.org/jira/browse/HDFS-8750
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: fs, HDFS
>            Reporter: Himanshu
>            Assignee: Himanshu
>         Attachments: HDFS-8750.001.patch, HDFS-8750.002.patch, 
> HDFS-8750.003.patch, HDFS-8750.004.patch
>
>
> In FileSystem.loadFileSystems(), at 
> https://github.com/apache/hadoop/blob/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/fs/FileSystem.java#L2652
> a "scheme" -> "FileSystem implementation" map is created from the jars 
> available on classpath. It uses Thread.currentThread().getClassLoader() via 
> ServiceLoader.load(FileSystem.class)
> Instead, loadFileSystems() should take Configuration as an argument and 
> should first check if a classloader is configured in 
> configuration.getClassLoader(), if yes then 
> ServiceLoader.load(FileSystem.class, configuration.getClassLoader()) should 
> be used.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to