Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-2461

Configuration should trim property names and accept decimal, hexadecimal, and octal numbers

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 0.18.0
    • conf
    • None
    • Reviewed

    Description

      I suggest two improvements in reading configuration:

      • Suppose we have the following property in a conf file.
        <property>
        <name>
        testing.property</name>
        <value>something</value>
        </property>
        

        Try to get it by

        Configuration conf = new Configuration();
        String value = conf.get("testing.property"); //value == null here
        

        We will get null since there is an eol in

        <name>
        testing.property</name>
        

        I suggest to trim all property names.

      • I also suggest configuration to accept decimal, hexadecimal, and octal numbers (e.g. 011 is 9, 0xA is 10)
        It can be easily done by replacing Integer.parseInt(...) with Integer.decode(...) in Configuration.getInt(...), similarly, in Configuration.getLong(...).

      Attachments

        1. 2461_20080425.patch
          3 kB
          Tsz-wo Sze
        2. 2461_20080208.patch
          1 kB
          Tsz-wo Sze
        3. 2461_20071218.patch
          5 kB
          Tsz-wo Sze

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            szetszwo Tsz-wo Sze
            szetszwo Tsz-wo Sze
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment