com.bigdata.counters.store
Class CounterSetBTree.CounterSetBTreeTupleSerializer

java.lang.Object
  extended by com.bigdata.btree.DefaultTupleSerializer<Object,CounterSetBTree.Entry>
      extended by com.bigdata.counters.store.CounterSetBTree.CounterSetBTreeTupleSerializer
All Implemented Interfaces:
ITupleSerializer<Object,CounterSetBTree.Entry>, IKeyBuilderFactory, Externalizable, Serializable
Enclosing class:
CounterSetBTree

protected static class CounterSetBTree.CounterSetBTreeTupleSerializer
extends DefaultTupleSerializer<Object,CounterSetBTree.Entry>

Encapsulates key and value formation. The key is formed from the minutes, the path, and the timestamp. The value is the performance counter value for a specific timestamp.

Version:
$Id: CounterSetBTree.java 4882 2011-07-10 17:47:23Z thompsonbry $
Author:
Bryan Thompson
See Also:
Serialized Form

Constructor Summary
CounterSetBTree.CounterSetBTreeTupleSerializer()
          De-serialization ctor.
CounterSetBTree.CounterSetBTreeTupleSerializer(IKeyBuilderFactory keyBuilderFactory)
          Ctor when creating a new instance.
 
Method Summary
 CounterSetBTree.Entry deserialize(ITuple tuple)
          De-serializes an object from the value stored in the tuple (ignores the key stored in the tuple).
 byte[] serializeKey(CounterSetBTree.Entry e)
           
 byte[] serializeKey(ICounter c)
           
 byte[] serializeKey(Object obj)
          Return the unsigned byte[] key.
 byte[] serializeVal(CounterSetBTree.Entry value)
          Overridden to serialize just CounterSetBTree.Entry.value as the value component of the B+Tree tuple.
 
Methods inherited from class com.bigdata.btree.DefaultTupleSerializer
deserializeKey, getDefaultKeyBuilderFactory, getDefaultLeafKeysCoder, getDefaultValuesCoder, getKeyBuilder, getLeafKeysCoder, getLeafValuesCoder, newInstance, readExternal, setLeafKeysCoder, setLeafValuesCoder, toString, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CounterSetBTree.CounterSetBTreeTupleSerializer

public CounterSetBTree.CounterSetBTreeTupleSerializer()
De-serialization ctor.


CounterSetBTree.CounterSetBTreeTupleSerializer

public CounterSetBTree.CounterSetBTreeTupleSerializer(IKeyBuilderFactory keyBuilderFactory)
Ctor when creating a new instance.

Parameters:
keyBuilderFactory -
Method Detail

serializeKey

public byte[] serializeKey(Object obj)
Return the unsigned byte[] key.

Specified by:
serializeKey in interface ITupleSerializer<Object,CounterSetBTree.Entry>
Overrides:
serializeKey in class DefaultTupleSerializer<Object,CounterSetBTree.Entry>
Parameters:
obj - An ICounter or CounterSetBTree.Entry.
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).

serializeKey

public byte[] serializeKey(ICounter c)

serializeKey

public byte[] serializeKey(CounterSetBTree.Entry e)

serializeVal

public byte[] serializeVal(CounterSetBTree.Entry value)
Overridden to serialize just CounterSetBTree.Entry.value as the value component of the B+Tree tuple.

Specified by:
serializeVal in interface ITupleSerializer<Object,CounterSetBTree.Entry>
Overrides:
serializeVal in class DefaultTupleSerializer<Object,CounterSetBTree.Entry>
Parameters:
value - The object to be serialized (MAY be null).
Returns:
The serialized representation of the object as a byte[] -or- null if the reference is null.

deserialize

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


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