hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ray Chiang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-11199) Configuration should be able to set empty value for property
Date Wed, 22 Oct 2014 17:28:34 GMT

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

Ray Chiang commented on HADOOP-11199:
-------------------------------------

I don't recall the specifics of any example offhand, but I do recall running into an MR/YARN
property situation which looked something like this:

1) Newer property overrides the older property, but the older property is still the default
behavior
2) Both properties are defined in the corresponding .xml file.  Empty/null equivalency is
exploited in that both are documented, but one is "undefined" which prevents the newer one
from overriding the older one.

Sadly, I can't remember the exact property offhand, but I would expect it's in one of mapred-default.xml
or yarn-default.xml since I haven't looked at any others.

I'm fine with having value null/value empty/value fully defined as three definite states--I
just don't know what side effects there would be until all the code is updated.

Right now, I see 31 properties in yarn-default.xml and 16 in mapred-default.xml that are empty/null.

> Configuration should be able to set empty value for property
> ------------------------------------------------------------
>
>                 Key: HADOOP-11199
>                 URL: https://issues.apache.org/jira/browse/HADOOP-11199
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: conf
>            Reporter: Wangda Tan
>         Attachments: HADOOP-11199-01.patch
>
>
> Currently in hadoop.common.conf.Configuration, when you specify a XML like this:
> {code}
> <configuration>
>   <property>
>     <name>conf.name</name>
>     <value></value>
>   </property>
> </configuration>
> {code}
> When you trying to get the conf.name, the returned value is null instead of an empty
string.
> Test code for this,
> {code}
> import java.io.ByteArrayInputStream;
> import org.apache.hadoop.conf.Configuration;
> public class HadoopConfigurationEmptyTest {
>   public static void main(String[] args) {
>     Configuration conf = new Configuration(false);
>     ByteArrayInputStream bais =
>         new ByteArrayInputStream(("<configuration><property>"
>             + "<name>conf.name</name>" + "<value></value>"
>             + "</property></configuration>").getBytes());
>     conf.addResource(bais);
>     System.out.println(conf.get("conf.name"));
>   }
> }
> {code}
> Does this intentionally or a behavior should be fixed?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message