[ http://issues.apache.org/jira/browse/HADOOP-602?page=comments#action_12443059 ] Doug Cutting commented on HADOOP-602: -------------------------------------
The only problem I see with java.util.PriorityQueue is that it doesn't support adjustTop(). So instead of modifying the top entry and calling adjustTop(), one must pop the top entry, modify it, and push it back on. That's twice as slow, as push, pop and adjustTop are all log(n) operations. The implementation has the appropriate method (fixDown), but it's not public. So it could be done, but with a performance penalty. Note also that while pop and push are nearly always really log(n), if items are unevenly distributed in the lists, then adjustTop() is faster yet, since the top can remain on top, while pop always moves the last entry to the top and percolates it back down, and push adds the entry at the end and percolates it up, which will typically really require log(n) pointer swaps. We should probably measure whether this is significant. > Remove Lucene dependency > ------------------------ > > Key: HADOOP-602 > URL: http://issues.apache.org/jira/browse/HADOOP-602 > Project: Hadoop > Issue Type: Improvement > Affects Versions: 0.8.0 > Reporter: Andrzej Bialecki > Assigned To: Andrzej Bialecki > Fix For: 0.8.0 > > > Hadoop uses just a single class from Lucene, namely the PriorityQueue. I > propose to remove this dependency by copying this class into > org.apache.hadoop.util.PriorityQueue and removing lucene-core.jar from > dependencies. > Removing this dependency makes it easier to run map-reduce applications that > use different versions of Lucene. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira