public class RoaringDocIdSet extends DocIdSet
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.Modifier and Type | Class and Description |
---|---|
static class |
RoaringDocIdSet.Builder
A builder of
RoaringDocIdSet s. |
private class |
RoaringDocIdSet.Iterator |
private static class |
RoaringDocIdSet.ShortArrayDocIdSet
DocIdSet implementation that can store documents up to 2^16-1 in a short[]. |
Modifier and Type | Field and Description |
---|---|
private static long |
BASE_RAM_BYTES_USED |
private static int |
BLOCK_SIZE |
private int |
cardinality |
private DocIdSet[] |
docIdSets |
private static int |
MAX_ARRAY_LENGTH |
private long |
ramBytesUsed |
Modifier | Constructor and Description |
---|---|
private |
RoaringDocIdSet(DocIdSet[] docIdSets,
int cardinality) |
Modifier and Type | Method and Description |
---|---|
int |
cardinality()
Return the exact number of documents that are contained in this set.
|
DocIdSetIterator |
iterator()
Provides a
DocIdSetIterator to access the set. |
long |
ramBytesUsed()
Return the memory usage of this object in bytes.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getChildResources
private static final int BLOCK_SIZE
private static final int MAX_ARRAY_LENGTH
private static final long BASE_RAM_BYTES_USED
private final DocIdSet[] docIdSets
private final int cardinality
private final long ramBytesUsed
private RoaringDocIdSet(DocIdSet[] docIdSets, int cardinality)
public long ramBytesUsed()
Accountable
public DocIdSetIterator iterator() throws java.io.IOException
DocIdSet
DocIdSetIterator
to access the set.
This implementation can return null
if there
are no docs that match.public int cardinality()
public java.lang.String toString()
toString
in class java.lang.Object