Hadoop Common
  1. Hadoop Common
  2. HADOOP-6578

Configuration should trim whitespace around a lot of value types

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.22.0, 0.23.0
    • Fix Version/s: 0.22.0, 0.23.0
    • Component/s: conf
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      I've seen multiple users make an error where they've listed some whitespace around a class name (eg for configuring a scheduler). This results in a ClassNotFoundException which is very hard to debug, as you don't notice the whitespace in the exception! We should simply trim the whitespace in Configuration.getClass and Configuration.getClasses to avoid this class of user error.

      Similarly, we should trim in getInt, getLong, etc - anywhere that whitespace doesn't have semantic meaning we should be a little less strict on input.

      1. HADOOP-6578.patch
        8 kB
        Michele Catasta

        Issue Links

          Activity

          James Kinley made changes -
          Link This issue is related to HADOOP-9855 [ HADOOP-9855 ]
          Eli Collins made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Eli Collins made changes -
          Fix Version/s 0.22.0 [ 12314296 ]
          Fix Version/s 0.23.0 [ 12315569 ]
          Eli Collins made changes -
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Eli Collins made changes -
          Hadoop Flags [Reviewed]
          Affects Version/s 0.23.0 [ 12315569 ]
          Michele Catasta made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Michele Catasta made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Michele Catasta made changes -
          Attachment HADOOP-6578.patch [ 12438282 ]
          Michele Catasta made changes -
          Attachment HADOOP-6578.patch [ 12438609 ]
          Todd Lipcon made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Michele Catasta made changes -
          Attachment HADOOP-6578.patch [ 12437882 ]
          Michele Catasta made changes -
          Attachment HADOOP-6578.patch [ 12438282 ]
          Michele Catasta made changes -
          Assignee Michele (@pirroh) Catasta [ pirroh ]
          Michele Catasta made changes -
          Attachment HADOOP-6578.patch [ 12437746 ]
          Michele Catasta made changes -
          Attachment HADOOP-6578.patch [ 12437882 ]
          Michele Catasta made changes -
          Attachment HADOOP-6578.patch [ 12437746 ]
          Todd Lipcon made changes -
          Field Original Value New Value
          Summary Configuration should trim whitespace around class name values Configuration should trim whitespace around a lot of value types
          Description I've seen multiple users make an error where they've listed some whitespace around a class name (eg for configuring a scheduler). This results in a ClassNotFoundException which is very hard to debug, as you don't notice the whitespace in the exception! We should simply trim the whitespace in Configuration.getClass and Configuration.getClasses to avoid this class of user error. I've seen multiple users make an error where they've listed some whitespace around a class name (eg for configuring a scheduler). This results in a ClassNotFoundException which is very hard to debug, as you don't notice the whitespace in the exception! We should simply trim the whitespace in Configuration.getClass and Configuration.getClasses to avoid this class of user error.

          Similarly, we should trim in getInt, getLong, etc - anywhere that whitespace doesn't have semantic meaning we should be a little less strict on input.
          Todd Lipcon created issue -

            People

            • Assignee:
              Michele Catasta
              Reporter:
              Todd Lipcon
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development