You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Shai Erera (JIRA)" <ji...@apache.org> on 2014/02/09 08:46:19 UTC

[jira] [Updated] (LUCENE-5440) Add LongFixedBitSet and replace usage of OpenBitSet

     [ https://issues.apache.org/jira/browse/LUCENE-5440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shai Erera updated LUCENE-5440:
-------------------------------

    Attachment: LUCENE-5440.patch

Attached patch contains LongFixedBitSet:

* Only set/get(long). No more set/fastSet and int/long variations. This class should be used only for more than 2.1B bits.

* Doesn't implement Bits/DocIdSet -- again, this class should be used only for more than 2.1B bits.

* A static utility method "grows" it if needed while sharing the underlying long[] if possible.

I reviewed code which uses OpenBitSet and turns out most of this code could use a "fixed" bitset already. Some needed a Long version, but otherwise the number of bits was known in advance already. Yet all these classes used obs.set() instead of .fastSet(), which IMO shows the need for this new class and removed confusion.

There are some places in lucene/ code that still use OpenBitSet, such as TestOpenBitSet, javadoc mentions and where doc IDs are used (e.g. FieldCache). I didn't touch them since the new LongFixedBitSet is not intended to be used for doc IDs anyway.

I quickly reviewed some of the solr/ code, and looks like there too we can cutover to (Long)FixedBitSet already, since the number of bits is known in advance. I will do it after I get some feedback about the current patch.

> Add LongFixedBitSet and replace usage of OpenBitSet
> ---------------------------------------------------
>
>                 Key: LUCENE-5440
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5440
>             Project: Lucene - Core
>          Issue Type: Improvement
>          Components: core/search
>            Reporter: Shai Erera
>            Assignee: Shai Erera
>         Attachments: LUCENE-5440.patch
>
>
> Spinoff from here: http://lucene.markmail.org/thread/35gw3amo53dsqsqj. I wrote a LongFixedBitSet which behaves like FixedBitSet, only allows managing more than 2.1B bits. It overcome some issues I've encountered with OpenBitSet, such as the use of set/fastSet as well the implementation of DocIdSet. I'll post a patch shortly and describe it in more detail.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org