com.caucho.distcache.cluster
Class ClusterCacheEngine

java.lang.Object
  extended by com.caucho.distcache.cluster.ClusterCacheEngine
All Implemented Interfaces:
CacheEngine

public final class ClusterCacheEngine
extends java.lang.Object
implements CacheEngine

Manages the distributed cache


Constructor Summary
ClusterCacheEngine(CacheStoreManager cacheService)
           
 
Method Summary
 HashKey compareAndPut(DistCacheEntry entry, HashKey testValue, MnodeUpdate mnodeUpdate, java.lang.Object value, CacheConfig config)
           
protected  StreamSource createDataSource(HashKey valueKey)
           
 MnodeEntry get(DistCacheEntry entry, CacheConfig config)
           
 HashKey getAndPut(DistCacheEntry entry, MnodeUpdate mnodeUpdate, java.lang.Object value, long leaseTimeout, int leaseOwner)
          Sets a cache entry
 int getSelfIndex()
          Returns the self index
 void initCache(CacheImpl cache)
           
protected  boolean isDataAvailable(HashKey valueKey)
           
 boolean isLocalExpired(CacheConfig config, HashKey key, MnodeEntry mnodeEntry, long now)
           
protected  void loadClusterDataBackground(HashKey valueKey, int flags)
           
 boolean loadData(HashKey valueKey, int flags)
           
 void put(HashKey key, MnodeUpdate mnodeUpdate, MnodeEntry mnodeValue)
           
protected  void putData(HashKey valueKey, StreamSource dataSource)
           
protected  void putReplication(CachePut put)
           
 void remove(HashKey key, MnodeUpdate mnodeUpdate, MnodeEntry mnodeEntry)
           
 void start()
          Starts the service
 void updateTime(HashKey key, MnodeEntry mnodeValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClusterCacheEngine

public ClusterCacheEngine(CacheStoreManager cacheService)
Method Detail

start

public void start()
Description copied from interface: CacheEngine
Starts the service

Specified by:
start in interface CacheEngine

getSelfIndex

public int getSelfIndex()
Returns the self index


initCache

public void initCache(CacheImpl cache)
Specified by:
initCache in interface CacheEngine

isLocalExpired

public boolean isLocalExpired(CacheConfig config,
                              HashKey key,
                              MnodeEntry mnodeEntry,
                              long now)
Specified by:
isLocalExpired in interface CacheEngine

isDataAvailable

protected boolean isDataAvailable(HashKey valueKey)

loadData

public boolean loadData(HashKey valueKey,
                        int flags)
Specified by:
loadData in interface CacheEngine

loadClusterDataBackground

protected void loadClusterDataBackground(HashKey valueKey,
                                         int flags)

get

public MnodeEntry get(DistCacheEntry entry,
                      CacheConfig config)
Specified by:
get in interface CacheEngine

putData

protected void putData(HashKey valueKey,
                       StreamSource dataSource)

updateTime

public void updateTime(HashKey key,
                       MnodeEntry mnodeValue)
Specified by:
updateTime in interface CacheEngine

put

public void put(HashKey key,
                MnodeUpdate mnodeUpdate,
                MnodeEntry mnodeValue)
Specified by:
put in interface CacheEngine

remove

public void remove(HashKey key,
                   MnodeUpdate mnodeUpdate,
                   MnodeEntry mnodeEntry)
Specified by:
remove in interface CacheEngine

getAndPut

public HashKey getAndPut(DistCacheEntry entry,
                         MnodeUpdate mnodeUpdate,
                         java.lang.Object value,
                         long leaseTimeout,
                         int leaseOwner)
Sets a cache entry

Specified by:
getAndPut in interface CacheEngine

compareAndPut

public HashKey compareAndPut(DistCacheEntry entry,
                             HashKey testValue,
                             MnodeUpdate mnodeUpdate,
                             java.lang.Object value,
                             CacheConfig config)
Specified by:
compareAndPut in interface CacheEngine

createDataSource

protected StreamSource createDataSource(HashKey valueKey)

putReplication

protected void putReplication(CachePut put)