Package org.apache.lucene.util
Class RoaringDocIdSet
java.lang.Object
org.apache.lucene.search.DocIdSet
org.apache.lucene.util.RoaringDocIdSet
- All Implemented Interfaces:
Accountable
DocIdSet
implementation inspired from http://roaringbitmap.org/
The space is divided into blocks of 2^16 bits and each block is encoded independently. In each
block, if less than 2^12 bits are set, then documents are simply stored in a short[]. If more
than 2^16-2^12 bits are set, then the inverse of the set is encoded in a simple short[].
Otherwise a FixedBitSet
is used.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A builder ofRoaringDocIdSet
s.private class
private static class
DocIdSet
implementation that can store documents up to 2^16-1 in a short[]. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final long
private static final int
private final int
private final DocIdSet[]
private static final int
private final long
Fields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Return the exact number of documents that are contained in this set.iterator()
Provides aDocIdSetIterator
to access the set.long
Return the memory usage of this object in bytes.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Field Details
-
BLOCK_SIZE
private static final int BLOCK_SIZE- See Also:
-
MAX_ARRAY_LENGTH
private static final int MAX_ARRAY_LENGTH- See Also:
-
BASE_RAM_BYTES_USED
private static final long BASE_RAM_BYTES_USED -
docIdSets
-
cardinality
private final int cardinality -
ramBytesUsed
private final long ramBytesUsed
-
-
Constructor Details
-
RoaringDocIdSet
-
-
Method Details
-
ramBytesUsed
public long ramBytesUsed()Description copied from interface:Accountable
Return the memory usage of this object in bytes. Negative values are illegal. -
iterator
Description copied from class:DocIdSet
Provides aDocIdSetIterator
to access the set. This implementation can returnnull
if there are no docs that match.- Specified by:
iterator
in classDocIdSet
- Throws:
IOException
-
cardinality
public int cardinality()Return the exact number of documents that are contained in this set. -
toString
-