Class FSTDictionary
java.lang.Object
org.apache.lucene.codecs.uniformsplit.FSTDictionary
- All Implemented Interfaces:
IndexDictionary,Accountable
Immutable stateless
FST-based index dictionary kept in memory.
Use IndexDictionary.Builder to build the IndexDictionary.
Create a stateful IndexDictionary.Browser to seek a term in this
IndexDictionary and get its corresponding block file pointer to
the terms block file.
Its greatest advantage is to be very compact in memory thanks to both
the compaction of the FST as a byte array, and the incremental
encoding of the leaves block pointer values, which are long integers in
increasing order, with PositiveIntOutputs.
With a compact dictionary in memory we can increase the number of blocks.
This allows us to reduce the average block size, which means faster scan
inside a block.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classStatefulFSTDictionary.Browserto seek a term in thisFSTDictionaryand get its corresponding block file pointer in the block file.static classProvides statefulFSTDictionary.Browserto seek in theFSTDictionary.static classBuilds an immutableFSTDictionary. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbrowser()Creates a newIndexDictionary.Browser.longReturn the memory usage of this object in bytes.protected static FSTDictionaryread(DataInput input, BlockDecoder blockDecoder, boolean isFSTOnHeap) Reads aFSTDictionaryfrom the provided input.voidwrite(DataOutput output, BlockEncoder blockEncoder) Writes this dictionary to the provided output.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.util.Accountable
getChildResources
-
Field Details
-
BASE_RAM_USAGE
private static final long BASE_RAM_USAGE -
fst
-
-
Constructor Details
-
FSTDictionary
-
-
Method Details
-
ramBytesUsed
public long ramBytesUsed()Description copied from interface:AccountableReturn the memory usage of this object in bytes. Negative values are illegal.- Specified by:
ramBytesUsedin interfaceAccountable
-
write
Description copied from interface:IndexDictionaryWrites this dictionary to the provided output.- Specified by:
writein interfaceIndexDictionary- Parameters:
blockEncoder- TheBlockEncoderfor specific encoding of this index dictionary; or null if none.- Throws:
IOException
-
read
protected static FSTDictionary read(DataInput input, BlockDecoder blockDecoder, boolean isFSTOnHeap) throws IOException Reads aFSTDictionaryfrom the provided input.- Parameters:
blockDecoder- TheBlockDecoderto use for specific decoding; or null if none.- Throws:
IOException
-
browser
Description copied from interface:IndexDictionaryCreates a newIndexDictionary.Browser.- Specified by:
browserin interfaceIndexDictionary
-