org.shoal.ha.cache.impl.store
Class DataStoreEntryUpdater<K,V>

java.lang.Object
  extended by org.shoal.ha.cache.impl.store.DataStoreEntryUpdater<K,V>
Direct Known Subclasses:
SimpleDataStoreEntryUpdater, SimpleStoreableDataStoreEntryUpdater, StoreableDataStoreEntryUpdater

public abstract class DataStoreEntryUpdater<K,V>
extends java.lang.Object

Author:
Mahesh Kannan

Field Summary
protected static java.util.logging.Logger _logger
           
protected  DataStoreContext<K,V> ctx
           
 
Constructor Summary
DataStoreEntryUpdater()
           
 
Method Summary
protected  byte[] captureState(V v)
           
abstract  LoadResponseCommand<K,V> createLoadResponseCommand(DataStoreEntry<K,V> entry, K k, long minVersion)
           
abstract  SaveCommand<K,V> createSaveCommand(DataStoreEntry<K,V> entry, K k, V v)
           
protected  V deserializeV(byte[] rawV)
           
abstract  void executeSave(DataStoreEntry<K,V> entry, SaveCommand<K,V> cmd)
           
abstract  void executeTouch(DataStoreEntry<K,V> entry, TouchCommand<K,V> cmd)
           
abstract  V extractVFrom(LoadResponseCommand<K,V> cmd)
           
abstract  byte[] getState(V v)
           
abstract  V getV(DataStoreEntry<K,V> entry)
           
 void initialize(DataStoreContext<K,V> ctx)
           
protected  void printEntryInfo(java.lang.String msg, DataStoreEntry<K,V> entry, K key)
           
protected  void updateMetaInfoInDataStoreEntry(DataStoreEntry<K,V> entry, AbstractSaveCommand<K,V> cmd)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_logger

protected static final transient java.util.logging.Logger _logger

ctx

protected DataStoreContext<K,V> ctx
Constructor Detail

DataStoreEntryUpdater

public DataStoreEntryUpdater()
Method Detail

initialize

public void initialize(DataStoreContext<K,V> ctx)

captureState

protected byte[] captureState(V v)
                       throws DataStoreException
Throws:
DataStoreException

deserializeV

protected V deserializeV(byte[] rawV)
                  throws DataStoreException
Throws:
DataStoreException

updateMetaInfoInDataStoreEntry

protected void updateMetaInfoInDataStoreEntry(DataStoreEntry<K,V> entry,
                                              AbstractSaveCommand<K,V> cmd)

printEntryInfo

protected void printEntryInfo(java.lang.String msg,
                              DataStoreEntry<K,V> entry,
                              K key)

createSaveCommand

public abstract SaveCommand<K,V> createSaveCommand(DataStoreEntry<K,V> entry,
                                                   K k,
                                                   V v)

createLoadResponseCommand

public abstract LoadResponseCommand<K,V> createLoadResponseCommand(DataStoreEntry<K,V> entry,
                                                                   K k,
                                                                   long minVersion)
                                                            throws DataStoreException
Throws:
DataStoreException

executeSave

public abstract void executeSave(DataStoreEntry<K,V> entry,
                                 SaveCommand<K,V> cmd)
                          throws DataStoreException
Throws:
DataStoreException

executeTouch

public abstract void executeTouch(DataStoreEntry<K,V> entry,
                                  TouchCommand<K,V> cmd)
                           throws DataStoreException
Throws:
DataStoreException

getV

public abstract V getV(DataStoreEntry<K,V> entry)
                throws DataStoreException
Throws:
DataStoreException

extractVFrom

public abstract V extractVFrom(LoadResponseCommand<K,V> cmd)
                        throws DataStoreException
Throws:
DataStoreException

getState

public abstract byte[] getState(V v)
                         throws DataStoreException
Throws:
DataStoreException


Copyright © 2012. All Rights Reserved.