java.lang.Object
org.apache.lucene.util.fst.OnHeapFSTStore
- All Implemented Interfaces:
Accountable,FSTReader,FSTStore
Provides storage of finite state machine (FST), using byte array or byte store allocated on heap.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longprivate byte[]Used at read time when the FST fits into a single byte[].private ReadWriteDataOutputAReadWriteDataOutput, used during reading when the FST is very large (more than 1 GB).private final intFields inherited from interface org.apache.lucene.util.Accountable
NULL_ACCOUNTABLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the reverse BytesReader for this FSTInitialize the FSTStorelongReturn the memory usage of this object in bytes.voidwriteTo(DataOutput out) Write this FST to another DataOutputMethods 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_BYTES_USED
private static final long BASE_RAM_BYTES_USED -
dataOutput
AReadWriteDataOutput, used during reading when the FST is very large (more than 1 GB). If the FST is less than 1 GB then bytesArray is set instead. -
bytesArray
private byte[] bytesArrayUsed at read time when the FST fits into a single byte[]. -
maxBlockBits
private final int maxBlockBits
-
-
Constructor Details
-
OnHeapFSTStore
public OnHeapFSTStore(int maxBlockBits)
-
-
Method Details
-
init
Description copied from interface:FSTStoreInitialize the FSTStore- Specified by:
initin interfaceFSTStore- Parameters:
in- the DataInput to read fromnumBytes- the number of bytes to read- Returns:
- this FSTStore
- Throws:
IOException- if exception occurred during reading the DataInput
-
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
-
getReverseBytesReader
Description copied from interface:FSTReaderGet the reverse BytesReader for this FST- Specified by:
getReverseBytesReaderin interfaceFSTReader- Returns:
- the reverse BytesReader
-
writeTo
Description copied from interface:FSTReaderWrite this FST to another DataOutput- Specified by:
writeToin interfaceFSTReader- Parameters:
out- the DataOutput- Throws:
IOException- if exception occurred during writing
-