|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.infinispan.distribution.DistributionManagerImpl
public class DistributionManagerImpl
The default distribution manager implementation
| Nested Class Summary | |
|---|---|
class |
DistributionManagerImpl.ViewChangeListener
|
| Constructor Summary | |
|---|---|
DistributionManagerImpl()
Default constructor |
|
| Method Summary | |
|---|---|
void |
applyRemoteTxLog(List<WriteCommand> commands)
Applies an ordered list of modifications to the current node. |
void |
applyState(ConsistentHash consistentHash,
Map<Object,InternalCacheValue> state,
Address sender,
int viewId)
|
Collection<Address> |
getAffectedNodes(Collection<Object> affectedKeys)
A helper method that retrieves a list of nodes affected by operations on a set of keys. |
CacheStore |
getCacheStoreForRehashing()
Retrieves a cache store if one is available and set up for use in rehashing. |
ConsistentHash |
getConsistentHash()
Retrieves the consistent hash instance currently in use, an instance of the configured ConsistentHash class (which defaults to DefaultConsistentHash. |
DataLocality |
getLocality(Object key)
Returns the data locality characteristics of a given key. |
RpcManager |
getRpcManager()
|
Address |
getSelf()
|
TransactionLogger |
getTransactionLogger()
Retrieves the transaction logger instance associated with this DistributionManager |
void |
init(Configuration configuration,
RpcManager rpcManager,
CacheManagerNotifier notifier,
CommandsFactory cf,
DataContainer dataContainer,
InterceptorChain interceptorChain,
InvocationContextContainer icc,
CacheLoaderManager cacheLoaderManager,
InboundInvocationHandler inboundInvocationHandler,
CacheNotifier cacheNotifier)
|
boolean |
isAffectedByRehash(Object key)
Tests whether a given key is affected by a rehash that may be in progress. |
boolean |
isJoinComplete()
Tests whether the current instance has completed joining the cluster |
boolean |
isLocal(Object key)
Deprecated. |
boolean |
isLocatedLocally(String key)
|
boolean |
isRehashInProgress()
Tests whether a rehash is in progress |
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. |
Map<Object,List<Address>> |
locateAll(Collection<Object> keys,
int numOwners)
Same as DistributionManager.locateAll(java.util.Collection), but the list of addresses only contains numOwners owners. |
List<String> |
locateKey(String key)
|
void |
markNodePushCompleted(int viewId,
Address node)
|
void |
markRehashCompleted(int viewId)
|
void |
markRehashTaskCompleted()
|
void |
notifyCoordinatorPushCompleted(int viewId)
|
InternalCacheEntry |
retrieveFromRemoteSource(Object key,
InvocationContext ctx)
Retrieves a cache entry from a remote source. |
void |
setConfiguration(Configuration configuration)
|
ConsistentHash |
setConsistentHash(ConsistentHash consistentHash)
Sets the consistent hash implementation in use. |
void |
stop()
|
String |
toString()
|
void |
transformForL1(CacheEntry entry)
Transforms a cache entry so it is marked for L1 rather than the primary cache data structure. |
void |
waitForJoinToComplete()
|
boolean |
waitForRehashToComplete(int viewId)
Wait until the cluster-wide rehash for view viewId has finished. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DistributionManagerImpl()
| Method Detail |
|---|
public void init(Configuration configuration,
RpcManager rpcManager,
CacheManagerNotifier notifier,
CommandsFactory cf,
DataContainer dataContainer,
InterceptorChain interceptorChain,
InvocationContextContainer icc,
CacheLoaderManager cacheLoaderManager,
InboundInvocationHandler inboundInvocationHandler,
CacheNotifier cacheNotifier)
public RpcManager getRpcManager()
public void waitForJoinToComplete()
throws InterruptedException
waitForJoinToComplete in interface DistributionManagerInterruptedExceptionpublic void stop()
@Deprecated public boolean isLocal(Object key)
DistributionManagerDistributionManager.getLocality(Object) instead.
isLocal in interface DistributionManagerkey - key to test
public DataLocality getLocality(Object key)
DistributionManager
getLocality in interface DistributionManagerkey - key to test
public List<Address> locate(Object key)
DistributionManager
locate in interface DistributionManagerkey - key to test
public boolean waitForRehashToComplete(int viewId)
throws InterruptedException,
TimeoutException
DistributionManagerviewId has finished.
waitForRehashToComplete in interface DistributionManagerInterruptedException
TimeoutExceptionpublic Map<Object,List<Address>> locateAll(Collection<Object> keys)
DistributionManagerDistributionManager.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.
locateAll in interface DistributionManagerkeys - list of keys to test
public Map<Object,List<Address>> locateAll(Collection<Object> keys,
int numOwners)
DistributionManagerDistributionManager.locateAll(java.util.Collection), but the list of addresses only contains numOwners owners.
locateAll in interface DistributionManagerpublic void transformForL1(CacheEntry entry)
DistributionManager
transformForL1 in interface DistributionManagerentry - entry to transform
public InternalCacheEntry retrieveFromRemoteSource(Object key,
InvocationContext ctx)
throws Exception
DistributionManagerClusteredGetCommand
and some form of quorum of responses if the responses returned are inconsistent - often the case if there is a
rehash in progress, involving nodes that the key maps to.
retrieveFromRemoteSource in interface DistributionManagerkey - key to look up
Exception - if something bad happenspublic Address getSelf()
public ConsistentHash getConsistentHash()
DistributionManagerDefaultConsistentHash.
getConsistentHash in interface DistributionManagerpublic ConsistentHash setConsistentHash(ConsistentHash consistentHash)
DistributionManager
setConsistentHash in interface DistributionManagerconsistentHash - consistent hash to set to
public boolean isAffectedByRehash(Object key)
DistributionManager
isAffectedByRehash in interface DistributionManagerkey - key to test
public TransactionLogger getTransactionLogger()
DistributionManager
getTransactionLogger in interface DistributionManager
public void applyState(ConsistentHash consistentHash,
Map<Object,InternalCacheValue> state,
Address sender,
int viewId)
throws InterruptedException
applyState in interface DistributionManagerInterruptedException
public void markRehashCompleted(int viewId)
throws InterruptedException
markRehashCompleted in interface DistributionManagerInterruptedException
public void markNodePushCompleted(int viewId,
Address node)
throws InterruptedException
markNodePushCompleted in interface DistributionManagerInterruptedException
public void notifyCoordinatorPushCompleted(int viewId)
throws Exception
notifyCoordinatorPushCompleted in interface DistributionManagerExceptionpublic CacheStore getCacheStoreForRehashing()
DistributionManager
getCacheStoreForRehashing in interface DistributionManagerpublic boolean isRehashInProgress()
DistributionManager
isRehashInProgress in interface DistributionManagerpublic void markRehashTaskCompleted()
markRehashTaskCompleted in interface DistributionManagerpublic boolean isJoinComplete()
DistributionManager
isJoinComplete in interface DistributionManagerpublic Collection<Address> getAffectedNodes(Collection<Object> affectedKeys)
DistributionManagerDistributionManager.locateAll(java.util.Collection) and then combine the result addresses.
getAffectedNodes in interface DistributionManageraffectedKeys - keys to locate
public void applyRemoteTxLog(List<WriteCommand> commands)
DistributionManager
applyRemoteTxLog in interface DistributionManagercommands - ordered list of modspublic boolean isLocatedLocally(String key)
public List<String> locateKey(String key)
public String toString()
toString in class Objectpublic void setConfiguration(Configuration configuration)
|
--> | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||