|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.facet.taxonomy.OrdinalsReader org.apache.lucene.facet.taxonomy.CachedOrdinalsReader
public class CachedOrdinalsReader
A per-segment cache of documents' facet ordinals. Every
CachedOrdinalsReader.CachedOrds
holds the ordinals in a raw int[]
, and therefore consumes as much RAM as the total
number of ordinals found in the segment, but saves the
CPU cost of decoding ordinals during facet counting.
NOTE: every CachedOrdinalsReader.CachedOrds
is limited to 2.1B
total ordinals. If that is a limitation for you then
consider limiting the segment size to fewer documents, or
use an alternative cache which pages through the category
ordinals.
NOTE: when using this cache, it is advised to use
a DocValuesFormat
that does not cache the data in
memory, at least for the category lists fields, or
otherwise you'll be doing double-caching.
NOTE: create one instance of this and re-use it for all facet implementations (the cache is per-instance, not static).
Nested Class Summary | |
---|---|
static class |
CachedOrdinalsReader.CachedOrds
Holds the cached ordinals in two paralel int[] arrays. |
Nested classes/interfaces inherited from class org.apache.lucene.facet.taxonomy.OrdinalsReader |
---|
OrdinalsReader.OrdinalsSegmentReader |
Constructor Summary | |
---|---|
CachedOrdinalsReader(OrdinalsReader source)
Sole constructor. |
Method Summary | |
---|---|
String |
getIndexFieldName()
Returns the indexed field name this OrdinalsReader is reading from. |
OrdinalsReader.OrdinalsSegmentReader |
getReader(AtomicReaderContext context)
Set current atomic reader. |
long |
ramBytesUsed()
How many bytes is this cache using? |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CachedOrdinalsReader(OrdinalsReader source)
Method Detail |
---|
public String getIndexFieldName()
OrdinalsReader
OrdinalsReader
is reading from.
getIndexFieldName
in class OrdinalsReader
public OrdinalsReader.OrdinalsSegmentReader getReader(AtomicReaderContext context) throws IOException
OrdinalsReader
getReader
in class OrdinalsReader
IOException
public long ramBytesUsed()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |