Issue Details (XML | Word | Printable)

Key: HADOOP-3308
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Chris Douglas
Reporter: Chris Douglas
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Hadoop Common

Improve QuickSort by excluding values eq the pivot from the partition

Created: 24/Apr/08 08:43 PM   Updated: 22/Aug/08 07:50 PM
Component/s: None
Affects Version/s: None
Fix Version/s: 0.18.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works 3308-0.patch 2008-04-24 08:47 PM Chris Douglas 5 kB
Text File Licensed for inclusion in ASF works 3308-1.patch 2008-04-24 11:16 PM Chris Douglas 5 kB
Text File Licensed for inclusion in ASF works 3308-2.patch 2008-04-25 01:19 AM Chris Douglas 6 kB

Hadoop Flags: Reviewed
Resolution Date: 25/Apr/08 11:04 PM


 Description  « Hide
The current implementation of QuickSort naively partitions on either side of the pivot. We can improve this by partitioning on either side of the set of values equal to the pivot. This assumes that comparing keys is expensive compared to swaps and index comparisons (which it certainly is in MapTask, and should be in general).

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Hadoop QA added a comment - 24/Apr/08 10:12 PM
+1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12380870/3308-0.patch
against trunk revision 645773.

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

tests included +1. The patch appears to include 3 new or modified tests.

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

javac +1. The applied patch does not generate any new javac compiler warnings.

release audit +1. The applied patch does not generate any new release audit warnings.

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

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

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

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

This message is automatically generated.


Chris Douglas added a comment - 24/Apr/08 11:17 PM
The code that recurs on the smaller of the partitions didn't; this fixes it.

Hadoop QA added a comment - 25/Apr/08 12:40 AM
+1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12380881/3308-1.patch
against trunk revision 645773.

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

tests included +1. The patch appears to include 3 new or modified tests.

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

javac +1. The applied patch does not generate any new javac compiler warnings.

release audit +1. The applied patch does not generate any new release audit warnings.

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

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

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

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

This message is automatically generated.


Tsz Wo (Nicholas), SZE added a comment - 25/Apr/08 01:14 AM
Since IndexedSortable s and Progressable rep are constants, it would be good to store them in instance variables. If the QuickSort object is shared (i.e. race condition), put everything in an inner-class.

Also, making the recursion class final may help.


Chris Douglas added a comment - 25/Apr/08 01:19 AM
Made the class final per Nicholas's recommendation. Instead of instance vars, it should be sufficient to make them final in the call to sort. Also added an additional test case to test the new code more thoroughly.

Tsz Wo (Nicholas), SZE added a comment - 25/Apr/08 05:26 PM
+1 patch looks good

Hadoop QA added a comment - 25/Apr/08 09:55 PM
+1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12380886/3308-2.patch
against trunk revision 645773.

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

tests included +1. The patch appears to include 3 new or modified tests.

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

javac +1. The applied patch does not generate any new javac compiler warnings.

release audit +1. The applied patch does not generate any new release audit warnings.

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

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

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

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

This message is automatically generated.


Chris Douglas added a comment - 25/Apr/08 11:04 PM
I just committed this

Hudson added a comment - 26/Apr/08 12:17 PM