[jira] [Updated] (HADOOP-10625) Configuration: names should be trimmed when putting/getting to properties

2014-05-28 Thread Xuan Gong (JIRA)

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

Xuan Gong updated HADOOP-10625:
---

   Resolution: Fixed
Fix Version/s: 2.5.0
   Status: Resolved  (was: Patch Available)

> 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)


[jira] [Updated] (HADOOP-10625) Configuration: names should be trimmed when putting/getting to properties

2014-05-27 Thread Wangda Tan (JIRA)

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

Wangda Tan updated HADOOP-10625:


Attachment: HADOOP-10625.patch

Moved trim name to handleDeprecation, which covers all get/getRaw calls. Added 
test for getRaw.

> 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, 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)


[jira] [Updated] (HADOOP-10625) Configuration: names should be trimmed when putting/getting to properties

2014-05-25 Thread Wangda Tan (JIRA)

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

Wangda Tan updated HADOOP-10625:


Attachment: HADOOP-10625.patch

Thanks [~qwertymaniac] for your comment, I've uploaded a new patch with the new 
behavior description in java doc of Configuration.

> 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, 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)


[jira] [Updated] (HADOOP-10625) Configuration: names should be trimmed when putting/getting to properties

2014-05-23 Thread Jing Zhao (JIRA)

 [ 
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)


[jira] [Updated] (HADOOP-10625) Configuration: names should be trimmed when putting/getting to properties

2014-05-21 Thread Wangda Tan (JIRA)

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

Wangda Tan updated HADOOP-10625:


Status: Patch Available  (was: Open)

> 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
> 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)


[jira] [Updated] (HADOOP-10625) Configuration: names should be trimmed when putting/getting to properties

2014-05-21 Thread Wangda Tan (JIRA)

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

Wangda Tan updated HADOOP-10625:


Attachment: HADOOP-10625.patch

Attach a patch for this.

> 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
> 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)