Class FSTSerializerImpl
- java.lang.Object
-
- org.apache.pinot.segment.local.utils.nativefst.builder.FSTSerializerImpl
-
- All Implemented Interfaces:
FSTSerializer
public final class FSTSerializerImpl extends Object implements FSTSerializer
Serializes a physicalFSTgraphs to a binary format compatible with Jan Daciuk'sfsa's packageImmutableFSTformat.It is possible to serialize the automaton with numbers required for perfect hashing. See
withNumbers()method.- See Also:
ImmutableFST,FST.read(java.io.InputStream)
-
-
Field Summary
Fields Modifier and Type Field Description byte_annotationBytebyte_fillerByte
-
Constructor Summary
Constructors Constructor Description FSTSerializerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<FSTFlags>getFlags()Return supported flags.<T extends OutputStream>
Tserialize(FST fst, T os)Serialize root statesto an output stream inImmutableFSTformat.FSTSerializerImplwithNumbers()Serialize the automaton with the number of right-language sequences in each node.
-
-
-
Field Detail
-
_fillerByte
public byte _fillerByte
- See Also:
ImmutableFST._filler
-
_annotationByte
public byte _annotationByte
- See Also:
ImmutableFST._annotation
-
-
Method Detail
-
withNumbers
public FSTSerializerImpl withNumbers()
Serialize the automaton with the number of right-language sequences in each node. This is required to implement perfect hashing. The numbering also preserves the order of input sequences.- Specified by:
withNumbersin interfaceFSTSerializer- Returns:
- Returns the same object for easier call chaining.
-
serialize
public <T extends OutputStream> T serialize(FST fst, T os) throws IOException
Serialize root statesto an output stream inImmutableFSTformat.- Specified by:
serializein interfaceFSTSerializer- Type Parameters:
T- A subclass ofOutputStream, returned for chaining.- Parameters:
fst- The automaton to serialize.os- The output stream to serialize to.- Returns:
- Returns
osfor chaining. - Throws:
IOException- Rethrown if an I/O error occurs.- See Also:
withNumbers()
-
getFlags
public Set<FSTFlags> getFlags()
Return supported flags.- Specified by:
getFlagsin interfaceFSTSerializer- Returns:
- Returns the set of flags supported by the serializer (and the output automaton).
-
-