|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.bigdata.btree.DefaultTupleSerializer<Justification,Justification>
com.bigdata.rdf.spo.JustificationTupleSerializer
public class JustificationTupleSerializer
(De-)serializes Justifications.
Note: the encoded key for a Justification is formed from the 64-bit
long term identifier for the head of the rule (the entailment)
followed by the term identifier bindings for the tail(s) of the rule. The
bindings are represented as a long[] and indexing into the bindings is by
position. Bindings in the tail of a rule MAY be ZERO (0L) in which case they
are interpreted as wildcards.
Note: No values are stored for this index - all the information is in the keys.
Note: While the static methods used to decode an existing key are safe for
concurrent readers, concurrent readers also form keys using
Justification.getKey(IKeyBuilder, Justification) and therefore
require a thread-local IKeyBuilder.
| Constructor Summary | |
|---|---|
JustificationTupleSerializer()
De-serialization constructor. |
|
JustificationTupleSerializer(int N)
|
|
| Method Summary | |
|---|---|
Justification |
deserialize(ITuple tuple)
De-serializes an object from the value stored
in the tuple (ignores the key stored in the tuple). |
Justification |
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(Justification jst)
There is no value for the justifications index. |
void |
writeExternal(ObjectOutput out)
|
| Methods inherited from class com.bigdata.btree.DefaultTupleSerializer |
|---|
getDefaultKeyBuilderFactory, getDefaultLeafKeysCoder, getDefaultValuesCoder, getKeyBuilder, getLeafKeysCoder, getLeafValuesCoder, newInstance, serializeVal, setLeafKeysCoder, setLeafValuesCoder, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JustificationTupleSerializer()
public JustificationTupleSerializer(int N)
N - The #of slots in a statement (3 or 4).| Method Detail |
|---|
public Justification deserialize(ITuple tuple)
DefaultTupleSerializervalue stored
in the tuple (ignores the key stored in the tuple).
deserialize in interface ITupleSerializer<Justification,Justification>deserialize in class DefaultTupleSerializer<Justification,Justification>tuple - The tuple.
public Justification deserializeKey(ITuple tuple)
DefaultTupleSerializerITupleSerializer 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<Justification,Justification>deserializeKey in class DefaultTupleSerializer<Justification,Justification>public byte[] serializeKey(Object obj)
ITupleSerializerIAutoboxBTree.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<Justification,Justification>serializeKey in class DefaultTupleSerializer<Justification,Justification>obj - A object (MAY NOT be null).
null (
null keys are not allowed into an index).public byte[] serializeVal(Justification jst)
jst - An object (MAY NOT be null).
null if no value will be stored under the
serialized key.
UnsupportedOperationException - always
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface ExternalizablereadExternal in class DefaultTupleSerializer<Justification,Justification>IOException
ClassNotFoundException
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface ExternalizablewriteExternal in class DefaultTupleSerializer<Justification,Justification>IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||