org.infinispan.distribution
Interface DistributionManager

All Known Implementing Classes:
DistributionManagerImpl

public interface DistributionManager

A component that manages the distribution of elements across a cache cluster

Since:
4.0
Author:
Manik Surtani

Method Summary
 void applyReceivedState(Map<Object,InternalCacheValue> state)
           
 CacheStore getCacheStoreForRehashing()
          Retrieves a cache store if one is available and set up for use in rehashing.
 ConsistentHash getConsistentHash()
           
 TransactionLogger getTransactionLogger()
           
 void informRehashOnJoin(Address joiner, boolean starting)
          This will cause all nodes to add the joiner to their UnionCH
 boolean isAffectedByRehash(Object key)
          Tests whether a given key is affected by a rehash that may be in progress.
 boolean isLocal(Object key)
           
 boolean isRehashInProgress()
           
 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 notifyJoinComplete(Address joiner)
          Notifies a coordinator when a join completes
 List<Address> requestPermissionToJoin(Address joiner)
          "Asks" a coordinator if a joiner may join.
 InternalCacheEntry retrieveFromRemoteSource(Object key)
          Retrieves a cache entry from a remote source
 void setConsistentHash(ConsistentHash consistentHash)
           
 void transformForL1(CacheEntry entry)
          Transforms a cache entry so it is marked for L1 rather than the primary cache data structure.
 

Method Detail

isLocal

boolean isLocal(Object key)

locate

List<Address> locate(Object key)
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.

Parameters:
key - key to test
Returns:
a list of addresses where the key may reside

locateAll

Map<Object,List<Address>> locateAll(Collection<Object> keys)
Locates a list of keys in a cluster. Like 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.

Parameters:
keys - list of keys to test
Returns:
a list of addresses where the key may reside

transformForL1

void transformForL1(CacheEntry entry)
Transforms a cache entry so it is marked for L1 rather than the primary cache data structure.

Parameters:
entry - entry to transform

retrieveFromRemoteSource

InternalCacheEntry retrieveFromRemoteSource(Object key)
                                            throws Exception
Retrieves a cache entry from a remote source

Parameters:
key - key to look up
Returns:
an internal cache entry, or null if it cannot be located
Throws:
Exception

getConsistentHash

ConsistentHash getConsistentHash()

setConsistentHash

void setConsistentHash(ConsistentHash consistentHash)

isAffectedByRehash

boolean isAffectedByRehash(Object key)
Tests whether a given key is affected by a rehash that may be in progress.

Parameters:
key - key to test
Returns:
whether a key is affected by a rehash

getTransactionLogger

TransactionLogger getTransactionLogger()

requestPermissionToJoin

List<Address> requestPermissionToJoin(Address joiner)
"Asks" a coordinator if a joiner may join. Used to serialize joins such that only a single joiner comes in at any given time.

Parameters:
joiner - joiner who wants to join
Returns:
a consistent hash prior to the joiner joining (if the joiner is allowed to join), otherwise null.

notifyJoinComplete

void notifyJoinComplete(Address joiner)
Notifies a coordinator when a join completes

Parameters:
joiner - joiner who has completed.

informRehashOnJoin

void informRehashOnJoin(Address joiner,
                        boolean starting)
This will cause all nodes to add the joiner to their UnionCH

Parameters:
joiner -
starting -

getCacheStoreForRehashing

CacheStore getCacheStoreForRehashing()
Retrieves a cache store if one is available and set up for use in rehashing. May return null!

Returns:
a cache store is one is available and configured for use in rehashing, or null otherwise.

isRehashInProgress

boolean isRehashInProgress()

applyReceivedState

void applyReceivedState(Map<Object,InternalCacheValue> state)

Google Analytics

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