public class FullTextIndexTupleSerializer<V extends Comparable<V>> extends DefaultTupleSerializer<ITermDocKey<V>,ITermDocVal>
Constructor and Description |
---|
FullTextIndexTupleSerializer()
De-serialization constructor.
|
FullTextIndexTupleSerializer(IKeyBuilderFactory keyBuilderFactory,
IRabaCoder leafKeysCoder,
IRabaCoder leafValsCoder,
boolean fieldsEnabled) |
Modifier and Type | Method and Description |
---|---|
ITermDocRecord<V> |
deserialize(ITuple tuple)
De-serializes an object from the
value stored
in the tuple (ignores the key stored in the tuple). |
protected ITermDocKey<V> |
deserialize(ITuple tuple,
boolean keyOnly) |
ITermDocKey<V> |
deserializeKey(ITuple tuple)
This is an unsupported operation.
|
boolean |
isFieldsEnabled() |
void |
readExternal(ObjectInput in) |
byte[] |
serializeKey(Object obj)
Serialize a facet of an object's state that places the object into the
total sort order for the index.
|
byte[] |
serializeVal(ITermDocVal obj)
Serializes the object as a byte[] using Java default serialization.
|
void |
writeExternal(ObjectOutput out) |
getDefaultKeyBuilderFactory, getDefaultLeafKeysCoder, getDefaultValuesCoder, getKeyBuilder, getLeafKeysCoder, getLeafValuesCoder, getPrimaryKeyBuilder, newInstance, setLeafKeysCoder, setLeafValuesCoder, toString
public FullTextIndexTupleSerializer()
public FullTextIndexTupleSerializer(IKeyBuilderFactory keyBuilderFactory, IRabaCoder leafKeysCoder, IRabaCoder leafValsCoder, boolean fieldsEnabled)
keyBuilderFactory
- This factory governs the Unicode collation order that will be
imposed on the indexed tokens.leafKeysCoder
- The coder used for the leaf keys (prefix coding is fine).leafValsCoder
- The coder used for the leaf values (custom coding may provide
tighter representations of the ITermDocVal
s in the
index entries).fieldsEnabled
- When true
the fieldId
will be
included as a component in the generated key. When
false
it will not be present in the generated
key.public boolean isFieldsEnabled()
public byte[] serializeKey(Object obj)
ITupleSerializer
IAutoboxBTree.insert(Object, Object)
and friends to convert the
key object into an unsigned variable
length byte[].
Note: This handles the conversion between an object and the unsigned variable length byte[] representation of that object which determines its place within the total index order. Since this transform imposes the total order of the index, different techniques are applied here than are applied to the serialization of the index values.
serializeKey
in interface ITupleSerializer<ITermDocKey<V extends Comparable<V>>,ITermDocVal>
serializeKey
in class DefaultTupleSerializer<ITermDocKey<V extends Comparable<V>>,ITermDocVal>
obj
- A object (MAY NOT be null
).null
(
null
keys are not allowed into an index).public byte[] serializeVal(ITermDocVal obj)
DefaultTupleSerializer
serializeVal
in interface ITupleSerializer<ITermDocKey<V extends Comparable<V>>,ITermDocVal>
serializeVal
in class DefaultTupleSerializer<ITermDocKey<V extends Comparable<V>>,ITermDocVal>
obj
- The object to be serialized (MAY be null
).null
if the reference is null
.public ITermDocKey<V> deserializeKey(ITuple tuple)
DefaultTupleSerializer
ITupleSerializer
or you can specialize
this one so that it can de-serialize your keys using whichever approach
makes the most sense for your data.deserializeKey
in interface ITupleSerializer<ITermDocKey<V extends Comparable<V>>,ITermDocVal>
deserializeKey
in class DefaultTupleSerializer<ITermDocKey<V extends Comparable<V>>,ITermDocVal>
public ITermDocRecord<V> deserialize(ITuple tuple)
DefaultTupleSerializer
value
stored
in the tuple (ignores the key stored in the tuple).deserialize
in interface ITupleSerializer<ITermDocKey<V extends Comparable<V>>,ITermDocVal>
deserialize
in class DefaultTupleSerializer<ITermDocKey<V extends Comparable<V>>,ITermDocVal>
tuple
- The tuple.protected ITermDocKey<V> deserialize(ITuple tuple, boolean keyOnly)
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
readExternal
in class DefaultTupleSerializer<ITermDocKey<V extends Comparable<V>>,ITermDocVal>
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
writeExternal
in class DefaultTupleSerializer<ITermDocKey<V extends Comparable<V>>,ITermDocVal>
IOException
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.