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. |
Modifier and Type | Method and Description |
---|---|
int |
cardinality()
Return the exact number of documents that are contained in this set.
|
boolean |
isCacheable()
This method is a hint for
CachingWrapperFilter , if this DocIdSet
should be cached without copying it. |
DocIdSetIterator |
iterator()
Provides a
DocIdSetIterator to access the set. |
long |
ramBytesUsed()
Return the memory usage of this object in bytes.
|
String |
toString() |
bits, getChildResources
public boolean isCacheable()
DocIdSet
CachingWrapperFilter
, if this DocIdSet
should be cached without copying it. The default is to return
false
. If you have an own DocIdSet
implementation
that does its iteration very effective and fast without doing disk I/O,
override this method and return true
.isCacheable
in class DocIdSet
public long ramBytesUsed()
Accountable
public DocIdSetIterator iterator() throws IOException
DocIdSet
DocIdSetIterator
to access the set.
This implementation can return null
if there
are no docs that match.iterator
in class DocIdSet
IOException
public int cardinality()
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.