public class RDFFullTextIndexTupleSerializer extends DefaultTupleSerializer<ITermDocKey,ITermDocVal>
FullTextIndexTupleSerializer
to support IV
s as
document identifiers.
Since IV
s have a variable length encoding we have to indicate the
length of the IV
either in the key or the value of the ITuple
. I've put this information into the value side of the tuple in order to keep
the key format simpler.
Note: The RDF database does not make use of the "field" concept in the keys of the full text index. The fieldId will always be reported as -1.
Constructor and Description |
---|
RDFFullTextIndexTupleSerializer()
De-serialization constructor.
|
RDFFullTextIndexTupleSerializer(IKeyBuilderFactory keyBuilderFactory,
IRabaCoder leafKeysCoder,
IRabaCoder leafValsCoder,
boolean fieldsEnabled) |
Modifier and Type | Method and Description |
---|---|
ITermDocRecord |
deserialize(ITuple tuple)
De-serializes an object from the
value stored
in the tuple (ignores the key stored in the tuple). |
protected ITermDocKey |
deserialize(ITuple tuple,
boolean keyOnly) |
ITermDocKey |
deserializeKey(ITuple tuple)
This is an unsupported operation.
|
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 RDFFullTextIndexTupleSerializer()
public RDFFullTextIndexTupleSerializer(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 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,ITermDocVal>
serializeKey
in class DefaultTupleSerializer<ITermDocKey,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,ITermDocVal>
serializeVal
in class DefaultTupleSerializer<ITermDocKey,ITermDocVal>
obj
- The object to be serialized (MAY be null
).null
if the reference is null
.public ITermDocKey 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,ITermDocVal>
deserializeKey
in class DefaultTupleSerializer<ITermDocKey,ITermDocVal>
public ITermDocRecord deserialize(ITuple tuple)
DefaultTupleSerializer
value
stored
in the tuple (ignores the key stored in the tuple).deserialize
in interface ITupleSerializer<ITermDocKey,ITermDocVal>
deserialize
in class DefaultTupleSerializer<ITermDocKey,ITermDocVal>
tuple
- The tuple.protected ITermDocKey deserialize(ITuple tuple, boolean keyOnly)
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
readExternal
in class DefaultTupleSerializer<ITermDocKey,ITermDocVal>
IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
writeExternal
in class DefaultTupleSerializer<ITermDocKey,ITermDocVal>
IOException
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.