[
https://issues.apache.org/jira/browse/HADOOP-10625?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14012285#comment-14012285
]
Hudson commented on HADOOP-10625:
---------------------------------
FAILURE: Integrated in Hadoop-Yarn-trunk #567 (See
[https://builds.apache.org/job/Hadoop-Yarn-trunk/567/])
HADOOP-10625. Trim configuration names when putting/getting them to properties
(xgong: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1598072)
* /hadoop/common/trunk/hadoop-common-project/hadoop-common/CHANGES.txt
*
/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
*
/hadoop/common/trunk/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/conf/TestConfiguration.java
> 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
> Fix For: 2.5.0
>
> Attachments: HADOOP-10625.patch, HADOOP-10625.patch,
> 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)