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

// TODO: Manik: Document this

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)
           
 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)
           
 void start()
           
 void stop()
           
 
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)

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


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