Class DictionaryBrowserSupplier
- java.lang.Object
-
- org.apache.lucene.codecs.uniformsplit.DictionaryBrowserSupplier
-
- All Implemented Interfaces:
java.util.function.Supplier<IndexDictionary.Browser>
,Accountable
public class DictionaryBrowserSupplier extends java.lang.Object implements java.util.function.Supplier<IndexDictionary.Browser>, Accountable
Supplier for a new statefulIndexDictionary.Browser
created on the immutableIndexDictionary
.The immutable
IndexDictionary
is lazy loaded thread safely. This lazy loading allows us to load it only whenTermsEnum.seekCeil(org.apache.lucene.util.BytesRef)
orTermsEnum.seekExact(org.apache.lucene.util.BytesRef)
are called (it is not loaded for a direct all-terms enumeration).
-
-
Field Summary
Fields Modifier and Type Field Description protected BlockDecoder
blockDecoder
protected IndexDictionary
dictionary
Lazy loaded immutable index dictionary (trie hold in RAM).protected IndexInput
dictionaryInput
-
Constructor Summary
Constructors Constructor Description DictionaryBrowserSupplier(IndexInput dictionaryInput, long startFilePointer, BlockDecoder blockDecoder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IndexDictionary.Browser
get()
Gets or lazy loads the immutableIndexDictionary
thread safely and creates a newIndexDictionary.Browser
.long
ramBytesUsed()
Return the memory usage of this object in bytes.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
-
-
-
Field Detail
-
dictionaryInput
protected final IndexInput dictionaryInput
-
blockDecoder
protected final BlockDecoder blockDecoder
-
dictionary
protected IndexDictionary dictionary
Lazy loaded immutable index dictionary (trie hold in RAM).
-
-
Constructor Detail
-
DictionaryBrowserSupplier
public DictionaryBrowserSupplier(IndexInput dictionaryInput, long startFilePointer, BlockDecoder blockDecoder) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
get
public IndexDictionary.Browser get()
Gets or lazy loads the immutableIndexDictionary
thread safely and creates a newIndexDictionary.Browser
.- Specified by:
get
in interfacejava.util.function.Supplier<IndexDictionary.Browser>
-
ramBytesUsed
public long ramBytesUsed()
Description copied from interface:Accountable
Return the memory usage of this object in bytes. Negative values are illegal.- Specified by:
ramBytesUsed
in interfaceAccountable
-
-