hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jing Zhao (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HADOOP-10625) Configuration: names should be trimmed when putting/getting to properties
Date Fri, 23 May 2014 23:26:02 GMT

     [ https://issues.apache.org/jira/browse/HADOOP-10625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jing Zhao updated HADOOP-10625:
-------------------------------

    Assignee: Wangda Tan

> Configuration: names should be trimmed when putting/getting to properties
> -------------------------------------------------------------------------
>
>                 Key: HADOOP-10625
>                 URL: https://issues.apache.org/jira/browse/HADOOP-10625
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: conf
>    Affects Versions: 2.4.0
>            Reporter: Wangda Tan
>            Assignee: Wangda Tan
>         Attachments: HADOOP-10625.patch
>
>
> Currently, Hadoop will not trim name when putting a pair of k/v to property. But when
loading configuration from file, names will be trimmed:
> (In Configuration.java)
> {code}
>           if ("name".equals(field.getTagName()) && field.hasChildNodes())
>             attr = StringInterner.weakIntern(
>                 ((Text)field.getFirstChild()).getData().trim());
>           if ("value".equals(field.getTagName()) && field.hasChildNodes())
>             value = StringInterner.weakIntern(
>                 ((Text)field.getFirstChild()).getData());
> {code}
> With this behavior, following steps will be problematic:
> 1. User incorrectly set " hadoop.key=value" (with a space before hadoop.key)
> 2. User try to get "hadoop.key", cannot get "value"
> 3. Serialize/deserialize configuration (Like what did in MR)
> 4. User try to get "hadoop.key", can get "value", which will make inconsistency problem.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message