lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Busch (JIRA)" <>
Subject [jira] Commented: (SOLR-875) Consolidate Solr's and Lucene's OpenBitSet classes
Date Tue, 25 Nov 2008 05:27:44 GMT


Michael Busch commented on SOLR-875:

Note that Yonik recently (August '08) commit this to Lucene's OpenBitSet:

fix OpenBitSet.hashCode rotate


Modified: lucene/java/trunk/src/java/org/apache/lucene/util/
--- lucene/java/trunk/src/java/org/apache/lucene/util/ (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/util/ Fri Aug 29 08:33:44
@@ -763,7 +763,7 @@
       long h = 0x98761234;  // something non-zero for length==0
       for (int i = bits.length; --i>=0;) {
       h ^= bits[i];
-      h = (h << 1) | (h >>> 31); // rotate left
+      h = (h << 1) | (h >>> 63); // rotate left
     return (int)((h>>32) ^ h);  // fold leftmost bits into right

This fix wasn't committed to Solr yet.

> Consolidate Solr's and Lucene's OpenBitSet classes
> --------------------------------------------------
>                 Key: SOLR-875
>                 URL:
>             Project: Solr
>          Issue Type: Task
>            Reporter: Michael Busch
>            Priority: Minor
>         Attachments: solr-875.patch
> Currently there are two versions of OpenBitSet and BitUtil in Solr and Lucene.
> We should only have one version of these classes in Lucene, that Solr should use.
> Tasks here:
> - Merge different versions into Lucene
> - Make Solr classes use/extend the classes in Lucene (we need to keep the Solr ones for
> - Deprecate the classes in Solr
> - Change all references in Solr to use the classes in Lucene
> One difficulty here is Solr's BitSetIterator vs. Lucene's OpenBitSetIterator. Both have
a next() method, however one returns an int (BitSetIterator), the other one returns a boolean
and offers a doc() method to get the doc id. So I can't make BitSetIterator extend OpenBitSetIterator.
There are not many places in Solr's core that use BitSetIterator, so we could simply change
e.g. search/ to use OpenBitSetIterator. This would however require to change
the call to next() into two calls to next() and doc(). I wonder if this would be a noticeable
performance hit?
> We could of course also leave both iterators and only merge OpenBitSet and BitUtil, but
I'd prefer to only have one iterator, because they basically do exactly the same.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message