com.caucho.server.distcache
Class CacheDataBackingImpl

java.lang.Object
  extended by com.caucho.server.distcache.CacheDataBackingImpl
All Implemented Interfaces:
CacheDataBacking

public class CacheDataBackingImpl
extends java.lang.Object
implements CacheDataBacking

Manages the distributed cache


Constructor Summary
CacheDataBackingImpl(CacheStoreManager storeManager)
           
 
Method Summary
 void close()
          Close the backing.
 DataStore getDataStore()
          Returns the underlying DataStore, used for serialization.
 MnodeStore getMnodeStore()
           
 long getStartupLastUpdateTime()
          Returns the last update time on server startup.
 long getStartupLastUpdateTime(HashKey cacheKey)
          Returns the last update time on server startup.
 java.util.ArrayList<CacheData> getUpdates(HashKey cacheKey, long accessTime, int offset)
          Returns a set of entries since an access time.
 java.util.ArrayList<CacheData> getUpdates(long accessTime, int offset)
          Returns a set of entries since an access time.
 MnodeEntry insertLocalValue(HashKey key, HashKey cacheKey, MnodeEntry mnodeUpdate, MnodeEntry oldEntryValue)
          Sets a cache entry
 boolean isDataAvailable(long valueIndex)
           
 java.sql.Blob loadBlob(long valueDataId)
           
 boolean loadData(long valueDataId, WriteStream os)
           
 MnodeEntry loadLocalEntryValue(HashKey key)
          Returns the local value from the database
 boolean putLocalValue(MnodeEntry mnodeEntry, HashKey key, HashKey cacheKey, MnodeEntry oldEntryEntry, MnodeUpdate mnodeUpdate)
          Sets a cache entry
 boolean removeData(long dataId)
           
 long saveData(java.io.InputStream is, int length)
           
 long saveData(StreamSource source, int length)
           
 MnodeEntry saveLocalUpdateTime(HashKey keyHash, MnodeEntry mnodeValue, MnodeEntry oldMnodeValue)
           
 void setDataStore(DataStore dataStore)
           
 void setMnodeStore(MnodeStore mnodeStore)
           
 void start()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheDataBackingImpl

public CacheDataBackingImpl(CacheStoreManager storeManager)
Method Detail

setDataStore

public void setDataStore(DataStore dataStore)

setMnodeStore

public void setMnodeStore(MnodeStore mnodeStore)

getDataStore

public DataStore getDataStore()
Description copied from interface: CacheDataBacking
Returns the underlying DataStore, used for serialization.

Specified by:
getDataStore in interface CacheDataBacking

getMnodeStore

public MnodeStore getMnodeStore()
Specified by:
getMnodeStore in interface CacheDataBacking

loadLocalEntryValue

public MnodeEntry loadLocalEntryValue(HashKey key)
Returns the local value from the database

Specified by:
loadLocalEntryValue in interface CacheDataBacking

insertLocalValue

public MnodeEntry insertLocalValue(HashKey key,
                                   HashKey cacheKey,
                                   MnodeEntry mnodeUpdate,
                                   MnodeEntry oldEntryValue)
Sets a cache entry

Specified by:
insertLocalValue in interface CacheDataBacking

putLocalValue

public boolean putLocalValue(MnodeEntry mnodeEntry,
                             HashKey key,
                             HashKey cacheKey,
                             MnodeEntry oldEntryEntry,
                             MnodeUpdate mnodeUpdate)
Description copied from interface: CacheDataBacking
Sets a cache entry

Specified by:
putLocalValue in interface CacheDataBacking

saveLocalUpdateTime

public MnodeEntry saveLocalUpdateTime(HashKey keyHash,
                                      MnodeEntry mnodeValue,
                                      MnodeEntry oldMnodeValue)
Specified by:
saveLocalUpdateTime in interface CacheDataBacking

loadData

public boolean loadData(long valueDataId,
                        WriteStream os)
                 throws java.io.IOException
Specified by:
loadData in interface CacheDataBacking
Throws:
java.io.IOException

loadBlob

public java.sql.Blob loadBlob(long valueDataId)
Specified by:
loadBlob in interface CacheDataBacking

saveData

public long saveData(StreamSource source,
                     int length)
Specified by:
saveData in interface CacheDataBacking

saveData

public long saveData(java.io.InputStream is,
                     int length)
              throws java.io.IOException
Specified by:
saveData in interface CacheDataBacking
Throws:
java.io.IOException

removeData

public boolean removeData(long dataId)
Specified by:
removeData in interface CacheDataBacking

isDataAvailable

public boolean isDataAvailable(long valueIndex)
Specified by:
isDataAvailable in interface CacheDataBacking

getStartupLastUpdateTime

public long getStartupLastUpdateTime()
Returns the last update time on server startup.

Specified by:
getStartupLastUpdateTime in interface CacheDataBacking

getStartupLastUpdateTime

public long getStartupLastUpdateTime(HashKey cacheKey)
Returns the last update time on server startup.

Specified by:
getStartupLastUpdateTime in interface CacheDataBacking

getUpdates

public java.util.ArrayList<CacheData> getUpdates(long accessTime,
                                                 int offset)
Returns a set of entries since an access time.

Specified by:
getUpdates in interface CacheDataBacking

getUpdates

public java.util.ArrayList<CacheData> getUpdates(HashKey cacheKey,
                                                 long accessTime,
                                                 int offset)
Returns a set of entries since an access time.

Specified by:
getUpdates in interface CacheDataBacking

start

public void start()
Specified by:
start in interface CacheDataBacking

close

public void close()
Description copied from interface: CacheDataBacking
Close the backing.

Specified by:
close in interface CacheDataBacking