[ 
http://issues.apache.org/jira/browse/HADOOP-377?page=comments#action_12424166 ] 
            
Jean-Baptiste Quenot commented on HADOOP-377:
---------------------------------------------

You're right in this particular case I could do that.  But basically allowing 
to pass an URL is much more flexible: that way the config file can be in a JAR  
or ZIP file (even outside of the classpath), at an HTTP(S) URL, etc.  The 
java.net.URL architecture even allows you to implement easily a custom protocol 
handler (this information is from 
http://java.sun.com/developer/onlineTraining/protocolhandlers/).

Another point: we are using Spring to instantiate the Hadoop configuration.  
And in Spring you can specify custom editors for the properties you set.  We 
pass something like conf://hadoop-client.xml and this is resolved to a Spring 
Resource with a ResourceEditor (a custom editor that resolves to a 
org.springframework.core.io.Resource), which is holding either a File or an 
URL.  Creating a String editor to resolve a path is a bit awkward since a 
String is not a concept that is appropriate to represent a file location in the 
realm of OOP, it is just too generic.  An URL clearly represents the location 
of some piece of data, in our case the Hadoop Client configuration file.

To sum up, I think providing URL support to Hadoop's Configuration gives more 
choice to the end developer.

> Configuration does not handle URL
> ---------------------------------
>
>                 Key: HADOOP-377
>                 URL: http://issues.apache.org/jira/browse/HADOOP-377
>             Project: Hadoop
>          Issue Type: Bug
>            Reporter: Jean-Baptiste Quenot
>         Attachments: 20060721-hadoop-Configuration-URL
>
>
> Current Configuration allows:
> * <String> pointing to a resource in the classpath
> * <Path> local path on the file system
> The attached patch handles java.net.URL.  We use it to load hadoop-client.xml 
> from a JAR.
> Thanks in advance!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to