org.infinispan.distribution
Class DistributionManagerImpl

java.lang.Object
  extended by org.infinispan.distribution.DistributionManagerImpl
All Implemented Interfaces:
DistributionManager

public class DistributionManagerImpl
extends Object
implements DistributionManager

The default distribution manager implementation

Since:
4.0
Author:
Manik Surtani

Nested Class Summary
 class DistributionManagerImpl.ViewChangeListener
           
 
Constructor Summary
DistributionManagerImpl()
           
 
Method Summary
 void init(Configuration configuration, RpcManager rpcManager, CacheManagerNotifier notifier, CommandsFactory cf)
           
 boolean isLocal(Object key)
           
 List<Address> locate(Object key)
          Locates a key in a cluster.
 Map<Object,List<Address>> locateAll(Collection<Object> keys)
          Locates a list of keys in a cluster.
 void rehash(Collection<Address> newList)
           
 InternalCacheEntry retrieveFromRemoteSource(Object key)
          Retrieves a cache entry from a remote source
 void start()
           
 void stop()
           
 void transformForL1(CacheEntry entry)
          Transforms a cache entry so it is marked for L1 rather than the primary cache data structure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistributionManagerImpl

public DistributionManagerImpl()
Method Detail

init

public void init(Configuration configuration,
                 RpcManager rpcManager,
                 CacheManagerNotifier notifier,
                 CommandsFactory cf)

start

public void start()
           throws Exception
Throws:
Exception

stop

public void stop()

rehash

public void rehash(Collection<Address> newList)
Specified by:
rehash in interface DistributionManager

isLocal

public boolean isLocal(Object key)
Specified by:
isLocal in interface DistributionManager

locate

public List<Address> locate(Object key)
Description copied from interface: DistributionManager
Locates a key in a cluster. The returned addresses may not be owners of the keys if a rehash happens to be in progress or is pending, so when querying these servers, invalid responses should be checked for and the next address checked accordingly.

Specified by:
locate in interface DistributionManager
Parameters:
key - key to test
Returns:
a list of addresses where the key may reside

locateAll

public Map<Object,List<Address>> locateAll(Collection<Object> keys)
Description copied from interface: DistributionManager
Locates a list of keys in a cluster. Like DistributionManager.locate(Object) the returned addresses may not be owners of the keys if a rehash happens to be in progress or is pending, so when querying these servers, invalid responses should be checked for and the next address checked accordingly.

Specified by:
locateAll in interface DistributionManager
Parameters:
keys - list of keys to test
Returns:
a list of addresses where the key may reside

transformForL1

public void transformForL1(CacheEntry entry)
Description copied from interface: DistributionManager
Transforms a cache entry so it is marked for L1 rather than the primary cache data structure.

Specified by:
transformForL1 in interface DistributionManager
Parameters:
entry - entry to transform

retrieveFromRemoteSource

public InternalCacheEntry retrieveFromRemoteSource(Object key)
                                            throws Exception
Description copied from interface: DistributionManager
Retrieves a cache entry from a remote source

Specified by:
retrieveFromRemoteSource in interface DistributionManager
Parameters:
key - key to look up
Returns:
an internal cache entry, or null if it cannot be located
Throws:
Exception


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.