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

Steve Loughran commented on HADOOP-7814:
----------------------------------------

Thinking about this some more, my need is not just have a conf file built from 
a properties file, but to get more of the system environment in during the 
process -java home, various dirs, hostname, etc.

A way to do this -which wouldn't break anything shipping as property file 
support is new- would be 
 # load property files/resources
 # support ${variable} expansion in the properties
 # resolve the preloaded properties from the std XML resources & files.
 # support resolution of system properties (some prefix like sysprop.)
 # support resolution of env variables (some prefix like env.)

This is more ambitious, and while trivial to do in groovy (built in $var 
expansion with functions thrown in), needs more coding in Java;
perhaps some incremental approach is given where variable expansion is an 
option, and in iteration 1 it isn't allowed.

The way to do this safely is not to try an expand the Configuration class. The 
ultimate goal is "Create a configuration instance from one or more properties 
files", not "have methods in Configuration to load properties from files". 
Everything could be done alongside the existing class, with a new class to do 
the construction and configuration of a new config instance.

                
> Add ability to add the contents of a properties file to Configuration
> ---------------------------------------------------------------------
>
>                 Key: HADOOP-7814
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7814
>             Project: Hadoop Common
>          Issue Type: Improvement
>    Affects Versions: 1.0.0
>            Reporter: Kristofer Tomasette
>            Priority: Minor
>         Attachments: HADOOP-7814.patch, HADOOP-7814.patch, HADOOP-7814.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> Add a method  to Configuration that will take a location on the local 
> filesystem of a properties file.  Method should read in the file's properties 
> and add them to the Configuration object.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to