org.apache.lucene.facet.search
public class OrdinalsCache extends Object
OrdinalsCache.CachedOrds
holds the ordinals in a raw int[], and therefore consumes as much RAM
as the total number of ordinals found in the segment.
NOTE: every OrdinalsCache.CachedOrds is limited to 2.1B total ordinals. If
that is a limitation for you then consider limiting the segment size to less
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
OrdinalsCache.CachedOrds
Holds the cached ordinals in two paralel
int[] arrays. |
| Constructor and Description |
|---|
OrdinalsCache() |
| Modifier and Type | Method and Description |
|---|---|
static void |
clear()
Clears all entries from the cache.
|
static OrdinalsCache.CachedOrds |
getCachedOrds(AtomicReaderContext context,
CategoryListParams clp)
Returns the
OrdinalsCache.CachedOrds relevant to the given
AtomicReaderContext, or null if there is no
BinaryDocValues in this reader for the requested
CategoryListParams.field. |
static long |
ramBytesUsed()
Returns how many bytes the static ords cache is
consuming.
|
public static OrdinalsCache.CachedOrds getCachedOrds(AtomicReaderContext context, CategoryListParams clp) throws IOException
OrdinalsCache.CachedOrds relevant to the given
AtomicReaderContext, or null if there is no
BinaryDocValues in this reader for the requested
CategoryListParams.field.IOExceptionpublic static long ramBytesUsed()
public static void clear()
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.