hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colin Patrick McCabe (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-10080) Variables in configuration properties are substituted in wrong order of precedence
Date Thu, 07 Nov 2013 16:49:21 GMT

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

Colin Patrick McCabe commented on HADOOP-10080:

I agree with tucu.  Let's change the documentation to reflect the current behavior.

It's not really clear that the new behavior being proposed here is better, anyway.  Given
that you can specify system properties on the command-line, one nice use for the current behavior
is being able to override things in the configuration file with a -Pfoo=bar switch on the
command line.  If the configuration file took precedence, this would not be possible.

It's always going to be messy supporting overrides, and it's not clear why the configuration
file "winning" is any more unintuitive than the other way around.

> Variables in configuration properties are substituted in wrong order of precedence
> ----------------------------------------------------------------------------------
>                 Key: HADOOP-10080
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10080
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: conf
>    Affects Versions: 2.2.0
>            Reporter: Sebastian Nagel
>            Priority: Minor
> API doc of [Configuration|https://hadoop.apache.org/docs/stable/api/org/apache/hadoop/conf/Configuration.html]
> {quote}
> Value strings are first processed for variable expansion. The available properties are:
> 1.  Other properties defined in this Configuration; and, if a name is undefined here,
> 2.  Properties in System.getProperties().
> {quote}
> The current implementation of variable expansion, however, gives precedence to system
properties. If a system property is defined it's value is used no matter whether a configuration
property of same name exists.
> This may cause inconsistent behaviour, e.g., if in the API doc example "basedir" is set
as system property ({{-Dbasedir=/mnt/tmp}}) the results of two intuitively equivalent calls
> {code}
>  new Path(conf.get("tempdir"))        // = /mnt/data/tmp
>  new Path(conf.get("basedir"), "tmp") // = /user/wastl/tmp
> {code}

This message was sent by Atlassian JIRA

View raw message