com.bigdata.sparse
Class TPSTupleSerializer

java.lang.Object
  extended by com.bigdata.btree.DefaultTupleSerializer<Void,TPS>
      extended by com.bigdata.sparse.TPSTupleSerializer
All Implemented Interfaces:
ITupleSerializer<Void,TPS>, IKeyBuilderFactory, Externalizable, Serializable

public class TPSTupleSerializer
extends DefaultTupleSerializer<Void,TPS>

Helper class for (de-)serializing logical rows for AtomicRowFilter.

Version:
$Id: TPSTupleSerializer.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson
See Also:
Serialized Form

Constructor Summary
TPSTupleSerializer()
          De-serializator ctor.
TPSTupleSerializer(IKeyBuilderFactory keyBuilderFactory)
           
 
Method Summary
 TPS deserialize(ITuple tuple)
          De-serializes an object from the value stored in the tuple (ignores the key stored in the tuple).
 Void deserializeKey(ITuple tuple)
          You can get the Schema and the primary key from deserialize(ITuple).
static ITupleSerializer<Void,TPS> newInstance()
           
 byte[] serializeKey(Object obj)
          This method is not used since we do not store TPS objects directly in a BTree.
 byte[] serializeVal(TPS obj)
          Serialize the persistent state of the object (the value stored in the index under the key for that object).
 
Methods inherited from class com.bigdata.btree.DefaultTupleSerializer
getDefaultKeyBuilderFactory, getDefaultLeafKeysCoder, getDefaultValuesCoder, getKeyBuilder, getLeafKeysCoder, getLeafValuesCoder, readExternal, serializeVal, setLeafKeysCoder, setLeafValuesCoder, toString, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TPSTupleSerializer

public TPSTupleSerializer()
De-serializator ctor.


TPSTupleSerializer

public TPSTupleSerializer(IKeyBuilderFactory keyBuilderFactory)
Method Detail

newInstance

public static ITupleSerializer<Void,TPS> newInstance()

serializeKey

public byte[] serializeKey(Object obj)
This method is not used since we do not store TPS objects directly in a BTree.

Specified by:
serializeKey in interface ITupleSerializer<Void,TPS>
Overrides:
serializeKey in class DefaultTupleSerializer<Void,TPS>
Parameters:
obj - A object (MAY NOT be null).
Returns:
An unsigned byte[] which places the object into the total sort order for the index and never null ( null keys are not allowed into an index).
Throws:
UnsupportedOperationException - always.

serializeVal

public byte[] serializeVal(TPS obj)
Description copied from interface: ITupleSerializer
Serialize the persistent state of the object (the value stored in the index under the key for that object). This method is automatically applied by IAutoboxBTree.insert(Object, Object) and friends to convert the value object into an byte[].

Parameters:
obj - An object (MAY NOT be null).
Returns:
A byte[] containing the serialized state of the object -or- null if no value will be stored under the serialized key.

deserialize

public TPS deserialize(ITuple tuple)
Description copied from class: DefaultTupleSerializer
De-serializes an object from the value stored in the tuple (ignores the key stored in the tuple).

Specified by:
deserialize in interface ITupleSerializer<Void,TPS>
Overrides:
deserialize in class DefaultTupleSerializer<Void,TPS>
Parameters:
tuple - The tuple.
Returns:
The de-serialized object.

deserializeKey

public Void deserializeKey(ITuple tuple)
You can get the Schema and the primary key from deserialize(ITuple).

Specified by:
deserializeKey in interface ITupleSerializer<Void,TPS>
Overrides:
deserializeKey in class DefaultTupleSerializer<Void,TPS>
Throws:
UnsupportedOperationException - always.


Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.