public class FSTDictionary extends Object implements IndexDictionary
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.
| Modifier and Type | Class and Description |
|---|---|
protected class |
FSTDictionary.Browser
Stateful
FSTDictionary.Browser to seek a term in this FSTDictionary
and get its corresponding block file pointer in the block file. |
static class |
FSTDictionary.BrowserSupplier
Provides stateful
FSTDictionary.Browser to seek in the FSTDictionary. |
static class |
FSTDictionary.Builder
Builds an immutable
FSTDictionary. |
| Modifier and Type | Field and Description |
|---|---|
protected FST<Long> |
dictionary |
| Modifier | Constructor and Description |
|---|---|
protected |
FSTDictionary(FST<Long> dictionary) |
| Modifier and Type | Method and Description |
|---|---|
FSTDictionary.Browser |
browser()
Creates a new
IndexDictionary.Browser. |
long |
ramBytesUsed() |
protected static FSTDictionary |
read(DataInput input,
BlockDecoder blockDecoder)
Reads a
FSTDictionary from the provided input. |
void |
write(DataOutput output,
BlockEncoder blockEncoder)
Writes this dictionary to the provided output.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetChildResourcespublic long ramBytesUsed()
ramBytesUsed in interface Accountablepublic void write(DataOutput output, BlockEncoder blockEncoder) throws IOException
IndexDictionarywrite in interface IndexDictionaryblockEncoder - The BlockEncoder for specific encoding of this index dictionary;
or null if none.IOExceptionprotected static FSTDictionary read(DataInput input, BlockDecoder blockDecoder) throws IOException
FSTDictionary from the provided input.blockDecoder - The BlockDecoder to use for specific decoding; or null if none.IOExceptionpublic FSTDictionary.Browser browser()
IndexDictionaryIndexDictionary.Browser.browser in interface IndexDictionaryCopyright © 2000-2020 Apache Software Foundation. All Rights Reserved.