com.bigdata.journal
Class CommitRecordIndex.CommitRecordIndexTupleSerializer

java.lang.Object
  extended by com.bigdata.btree.DefaultTupleSerializer<Long,CommitRecordIndex.Entry>
      extended by com.bigdata.journal.CommitRecordIndex.CommitRecordIndexTupleSerializer
All Implemented Interfaces:
ITupleSerializer<Long,CommitRecordIndex.Entry>, IKeyBuilderFactory, Externalizable, Serializable
Enclosing class:
CommitRecordIndex

public static class CommitRecordIndex.CommitRecordIndexTupleSerializer
extends DefaultTupleSerializer<Long,CommitRecordIndex.Entry>

Encapsulates key and value formation for the CommitRecordIndex.

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

Constructor Summary
CommitRecordIndex.CommitRecordIndexTupleSerializer()
          De-serialization ctor.
CommitRecordIndex.CommitRecordIndexTupleSerializer(IKeyBuilderFactory keyBuilderFactory)
          Ctor when creating a new instance.
 
Method Summary
 CommitRecordIndex.Entry deserialize(ITuple tuple)
          De-serializes an object from the value stored in the tuple (ignores the key stored in the tuple).
 Long deserializeKey(ITuple tuple)
          Decodes the key as a commit time.
 byte[] serializeKey(Object obj)
          Return the unsigned byte[] key for a commit time.
 byte[] serializeVal(CommitRecordIndex.Entry entry)
          Return the byte[] value an CommitRecordIndex.Entry.
 
Methods inherited from class com.bigdata.btree.DefaultTupleSerializer
getDefaultKeyBuilderFactory, getDefaultLeafKeysCoder, getDefaultValuesCoder, getKeyBuilder, getLeafKeysCoder, getLeafValuesCoder, newInstance, 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

CommitRecordIndex.CommitRecordIndexTupleSerializer

public CommitRecordIndex.CommitRecordIndexTupleSerializer()
De-serialization ctor.


CommitRecordIndex.CommitRecordIndexTupleSerializer

public CommitRecordIndex.CommitRecordIndexTupleSerializer(IKeyBuilderFactory keyBuilderFactory)
Ctor when creating a new instance.

Parameters:
keyBuilderFactory -
Method Detail

deserializeKey

public Long deserializeKey(ITuple tuple)
Decodes the key as a commit time.

Specified by:
deserializeKey in interface ITupleSerializer<Long,CommitRecordIndex.Entry>
Overrides:
deserializeKey in class DefaultTupleSerializer<Long,CommitRecordIndex.Entry>

serializeKey

public byte[] serializeKey(Object obj)
Return the unsigned byte[] key for a commit time.

Specified by:
serializeKey in interface ITupleSerializer<Long,CommitRecordIndex.Entry>
Overrides:
serializeKey in class DefaultTupleSerializer<Long,CommitRecordIndex.Entry>
Parameters:
obj - A commit time.
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).

serializeVal

public byte[] serializeVal(CommitRecordIndex.Entry entry)
Return the byte[] value an CommitRecordIndex.Entry.

Parameters:
entry - An Entry.
Returns:
A byte[] containing the serialized state of the object -or- null if no value will be stored under the serialized key.

deserialize

public CommitRecordIndex.Entry 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<Long,CommitRecordIndex.Entry>
Overrides:
deserialize in class DefaultTupleSerializer<Long,CommitRecordIndex.Entry>
Parameters:
tuple - The tuple.
Returns:
The de-serialized object.


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