Hadoop Map/Reduce
  1. Hadoop Map/Reduce
  2. MAPREDUCE-5136

TestJobImpl->testJobNoTasks fails with IBM JAVA

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.3-alpha
    • Fix Version/s: 2.1.0-beta
    • Component/s: None
    • Labels:
      None
    • Environment:

      Linux + IBM JAVA 6

    • Target Version/s:
    • Hadoop Flags:
      Reviewed

      Description

      I am not sure if this is a testcase or a design issue. During execution of TestJobImpl->testJobNoTasks() there is an assertion made based on the order of key/value pairs stored in adjacency list. However adjacency list was created by Configuration->getValByRegex() as a HashMap (order is not guaranteed):

      Testcase:
      JobSubmittedEventHandler jseHandler = new JobSubmittedEventHandler("testId",
      "testName", "testNodeName", "\"key2\"=\"value2\" \"key1\"=\"value1\" ");
      ....
      ....
      try {
      Assert.assertTrue(jseHandler.getAssertValue()); <===

      Configuration->getValByRegex():
      public Map<String,String> getValByRegex(String regex) {
      Pattern p = Pattern.compile(regex);
      Map<String,String> result = new HashMap<String,String>(); <=======

      as we all know, HashMap makes absolutely no guarantees about the iteration order. It can (and will) even change completely when new elements are added.

      Changing HashMap to LinkedHashMap fixes the ordering inconsistency, however with a small performance side effect.

        Activity

        Arun C Murthy made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Jason Lowe made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Hadoop Flags Reviewed [ 10343 ]
        Fix Version/s 2.0.5-beta [ 12324032 ]
        Resolution Fixed [ 1 ]
        Jason Lowe made changes -
        Summary TestJobImpl->testJobNoTasks fails with IBM JAVA .. TestJobImpl->testJobNoTasks fails with IBM JAVA
        Amir Sanjar made changes -
        Summary TestJobImpl->testJobNoTasks fails .. TestJobImpl->testJobNoTasks fails with IBM JAVA ..
        Jason Lowe made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Target Version/s 2.0.5-beta [ 12324032 ]
        Assignee Amir Sanjar [ asanjar ]
        Amir Sanjar made changes -
        Attachment MAPREDUCE-5136.patch [ 12577609 ]
        Amir Sanjar made changes -
        Attachment HADOOP-9465.patch [ 12577428 ]
        Sandy Ryza made changes -
        Project Hadoop Common [ 12310240 ] Hadoop Map/Reduce [ 12310941 ]
        Key HADOOP-9465 MAPREDUCE-5136
        Affects Version/s 2.0.3-alpha [ 12323275 ]
        Affects Version/s 2.0.3-alpha [ 12323273 ]
        Component/s conf [ 12310711 ]
        Amir Sanjar made changes -
        Field Original Value New Value
        Attachment HADOOP-9465.patch [ 12577428 ]
        Amir Sanjar created issue -

          People

          • Assignee:
            Amir Sanjar
            Reporter:
            Amir Sanjar
          • Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development