Hadoop Common
  1. Hadoop Common
  2. HADOOP-5705

Improved tries in TotalOrderPartitioner to eliminate large leaf nodes.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.19.1
    • Fix Version/s: 0.21.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      With the old technology, if a particular node in the trie has many children that contain no split points, TotalOrderPartitioner creates a separate empty leaf node for each one. This takes a lot of space, which in turn limits the depth to which we can grow these trees to avoid making too many sparse nodes, so there is a parameter that defaults to 2 to control the depth. With this patch, I can guarantee that each split point will create only three trie nodes in the trie: an empty one, a leaf that contains only one split point, and the internal nodes as needed, for a total space of perhaps 50-200 bytes per split point, even if the entire trie is elaborated. There are pathological cases that can cause a recursion overflow during creation, so i have set the default tree max depth to 200, but I expect almost all tries to be fully elaborated, which means in turn that each byte of the sought key gets touched at most twice.

      1. hadoop-5705-no-names.patch
        8 kB
        Dick King
      2. hadoop-5705.patch
        8 kB
        Dick King

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Patch Available Patch Available
        2d 8h 31m 1 Chris Douglas 20/Apr/09 10:52
        Patch Available Patch Available Resolved Resolved
        3d 11h 5m 1 Chris Douglas 23/Apr/09 21:57
        Resolved Resolved Closed Closed
        487d 23h 39m 1 Tom White 24/Aug/10 21:37
        Tom White made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Owen O'Malley made changes -
        Component/s mapred [ 12310690 ]
        Hide
        Hudson added a comment -

        Integrated in Hadoop-trunk #817 (See http://hudson.zones.apache.org/hudson/job/Hadoop-trunk/817/)
        . Improve TotalOrderPartitioner efficiency by updating the trie construction. Contributed by Dick King.

        Show
        Hudson added a comment - Integrated in Hadoop-trunk #817 (See http://hudson.zones.apache.org/hudson/job/Hadoop-trunk/817/ ) . Improve TotalOrderPartitioner efficiency by updating the trie construction. Contributed by Dick King.
        Chris Douglas made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Hadoop Flags [Reviewed]
        Fix Version/s 0.21.0 [ 12313563 ]
        Resolution Fixed [ 1 ]
        Hide
        Chris Douglas added a comment -

        +1

        I committed this. Thanks, Dick

        Show
        Chris Douglas added a comment - +1 I committed this. Thanks, Dick
        Hide
        Dick King added a comment -

        No new tests are needed by this patch because it improves performance without causing any changes to the behavior of the total ordering partitioner.

        If you believe that tries are worthwhile at all, then you must believe that it's worthwhile to run the tries as deeply as possible. Java's recursion stack depth is 500 IIRC, so I set the depth limit to 200. I surmise that almost all input split set adjacent element pairs differ before the 200th byte but that cosuming 201 stack frames won't break very many contexts where this is called.

        Show
        Dick King added a comment - No new tests are needed by this patch because it improves performance without causing any changes to the behavior of the total ordering partitioner. If you believe that tries are worthwhile at all, then you must believe that it's worthwhile to run the tries as deeply as possible. Java's recursion stack depth is 500 IIRC, so I set the depth limit to 200. I surmise that almost all input split set adjacent element pairs differ before the 200th byte but that cosuming 201 stack frames won't break very many contexts where this is called.
        Dick King made changes -
        Attachment hadoop-5705-no-names.patch [ 12406276 ]
        Hide
        Dick King added a comment -

        Fixed the patch to remove a comment that contained my name

        Show
        Dick King added a comment - Fixed the patch to remove a comment that contained my name
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12405833/hadoop-5705.patch
        against trunk revision 767643.

        +1 @author. The patch does not contain any @author tags.

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no tests are needed for this patch.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 findbugs. The patch does not introduce any new Findbugs warnings.

        +1 Eclipse classpath. The patch retains Eclipse classpath integrity.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed core unit tests.

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/228/testReport/
        Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/228/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/228/artifact/trunk/build/test/checkstyle-errors.html
        Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/228/console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12405833/hadoop-5705.patch against trunk revision 767643. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no tests are needed for this patch. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 Eclipse classpath. The patch retains Eclipse classpath integrity. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/228/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/228/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/228/artifact/trunk/build/test/checkstyle-errors.html Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch-vesta.apache.org/228/console This message is automatically generated.
        Hide
        Dick King added a comment -

        The patch applies to trunk – and 0.20 – and 0.19 . In fact, it's only really shaken out in 0.21 .

        I didn't mean to give the impression that it was version specific. I probably made a mistake when I created JIRA.

        Show
        Dick King added a comment - The patch applies to trunk – and 0.20 – and 0.19 . In fact, it's only really shaken out in 0.21 . I didn't mean to give the impression that it was version specific. I probably made a mistake when I created JIRA.
        Chris Douglas made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Assignee Dick King [ dking ]
        Hide
        Hong Tang added a comment -

        Dick, just click "submit patch" will change the status to "patch available".

        Could you be sure to the patch applies to trunk (instead of 0.19)?

        Show
        Hong Tang added a comment - Dick, just click "submit patch" will change the status to "patch available". Could you be sure to the patch applies to trunk (instead of 0.19)?
        Hide
        Jakob Homan added a comment -

        Under Available Workflow Actions, hit Submit Patch.

        Show
        Jakob Homan added a comment - Under Available Workflow Actions, hit Submit Patch.
        Hide
        Dick King added a comment -

        The patch is ready.

        I don't know how to mark the status of the issue as "patch available". Could someone tell me?

        Show
        Dick King added a comment - The patch is ready. I don't know how to mark the status of the issue as "patch available". Could someone tell me?
        Dick King made changes -
        Field Original Value New Value
        Attachment hadoop-5705.patch [ 12405833 ]
        Dick King created issue -

          People

          • Assignee:
            Dick King
            Reporter:
            Dick King
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development