org.infinispan.interceptors.distribution
Class BaseDistributionInterceptor
java.lang.Object
org.infinispan.commands.AbstractVisitor
org.infinispan.interceptors.base.CommandInterceptor
org.infinispan.interceptors.base.BaseRpcInterceptor
org.infinispan.interceptors.ClusteringInterceptor
org.infinispan.interceptors.distribution.BaseDistributionInterceptor
- All Implemented Interfaces:
- Visitor
- Direct Known Subclasses:
- NonTxDistributionInterceptor, TxDistributionInterceptor
public abstract class BaseDistributionInterceptor
- extends ClusteringInterceptor
Base class for distribution of entries across a cluster.
- Since:
- 4.0
- Author:
- Manik Surtani, Mircea.Markus@jboss.com, Pete Muir, Dan Berindei
Method Summary |
protected Log |
getLog()
|
protected abstract Object |
handleWriteCommand(InvocationContext ctx,
WriteCommand command,
org.infinispan.interceptors.distribution.BaseDistributionInterceptor.RecipientGenerator recipientGenerator,
boolean skipRemoteGet,
boolean skipL1Invalidation)
|
void |
injectDependencies(DistributionManager distributionManager,
ClusteringDependentLogic cdl)
|
protected boolean |
isSingleOwnerAndLocal(org.infinispan.interceptors.distribution.BaseDistributionInterceptor.RecipientGenerator recipientGenerator)
If a single owner has been configured and the target for the key is the local address, it returns true. |
protected InternalCacheEntry |
retrieveFromRemoteSource(Object key,
InvocationContext ctx,
boolean acquireRemoteLock,
FlagAffectedCommand command)
Retrieves a cache entry from a remote source. |
Object |
visitPutMapCommand(InvocationContext ctx,
PutMapCommand command)
|
Object |
visitRemoveCommand(InvocationContext ctx,
RemoveCommand command)
|
Object |
visitReplaceCommand(InvocationContext ctx,
ReplaceCommand command)
|
Methods inherited from class org.infinispan.commands.AbstractVisitor |
visitApplyDeltaCommand, visitClearCommand, visitCollection, visitCommitCommand, visitDistributedExecuteCommand, visitEntrySetCommand, visitEvictCommand, visitGetKeyValueCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitLockControlCommand, visitPrepareCommand, visitPutKeyValueCommand, visitRollbackCommand, visitSizeCommand, visitUnknownCommand, visitValuesCommand |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
dm
protected DistributionManager dm
cdl
protected ClusteringDependentLogic cdl
BaseDistributionInterceptor
public BaseDistributionInterceptor()
getLog
protected Log getLog()
- Overrides:
getLog
in class CommandInterceptor
injectDependencies
public void injectDependencies(DistributionManager distributionManager,
ClusteringDependentLogic cdl)
retrieveFromRemoteSource
protected InternalCacheEntry retrieveFromRemoteSource(Object key,
InvocationContext ctx,
boolean acquireRemoteLock,
FlagAffectedCommand command)
throws Exception
- Description copied from class:
ClusteringInterceptor
- Retrieves a cache entry from a remote source. Would typically involve an RPC call using a
ClusteredGetCommand
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.
- Specified by:
retrieveFromRemoteSource
in class ClusteringInterceptor
- Parameters:
key
- key to look up
- Returns:
- an internal cache entry, or null if it cannot be located
- Throws:
Exception
visitPutMapCommand
public Object visitPutMapCommand(InvocationContext ctx,
PutMapCommand command)
throws Throwable
- Specified by:
visitPutMapCommand
in interface Visitor
- Overrides:
visitPutMapCommand
in class AbstractVisitor
- Throws:
Throwable
visitRemoveCommand
public Object visitRemoveCommand(InvocationContext ctx,
RemoveCommand command)
throws Throwable
- Specified by:
visitRemoveCommand
in interface Visitor
- Overrides:
visitRemoveCommand
in class AbstractVisitor
- Throws:
Throwable
visitReplaceCommand
public Object visitReplaceCommand(InvocationContext ctx,
ReplaceCommand command)
throws Throwable
- Specified by:
visitReplaceCommand
in interface Visitor
- Overrides:
visitReplaceCommand
in class AbstractVisitor
- Throws:
Throwable
handleWriteCommand
protected abstract Object handleWriteCommand(InvocationContext ctx,
WriteCommand command,
org.infinispan.interceptors.distribution.BaseDistributionInterceptor.RecipientGenerator recipientGenerator,
boolean skipRemoteGet,
boolean skipL1Invalidation)
throws Throwable
- Throws:
Throwable
isSingleOwnerAndLocal
protected boolean isSingleOwnerAndLocal(org.infinispan.interceptors.distribution.BaseDistributionInterceptor.RecipientGenerator recipientGenerator)
- If a single owner has been configured and the target for the key is the local address, it returns true.
Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.