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> |
fst |
NULL_ACCOUNTABLE
Modifier | Constructor and Description |
---|---|
protected |
FSTDictionary(FST<Long> fst) |
Modifier and Type | Method and Description |
---|---|
FSTDictionary.Browser |
browser()
Creates a new
IndexDictionary.Browser . |
long |
ramBytesUsed() |
protected static FSTDictionary |
read(DataInput input,
BlockDecoder blockDecoder,
boolean isFSTOnHeap)
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, wait
getChildResources
public long ramBytesUsed()
ramBytesUsed
in interface Accountable
public void write(DataOutput output, BlockEncoder blockEncoder) throws IOException
IndexDictionary
write
in interface IndexDictionary
blockEncoder
- The BlockEncoder
for specific encoding of this index dictionary;
or null if none.IOException
protected static FSTDictionary read(DataInput input, BlockDecoder blockDecoder, boolean isFSTOnHeap) throws IOException
FSTDictionary
from the provided input.blockDecoder
- The BlockDecoder
to use for specific decoding; or null if none.IOException
public FSTDictionary.Browser browser()
IndexDictionary
IndexDictionary.Browser
.browser
in interface IndexDictionary
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.