org.infinispan.interceptors
Class ClusteringInterceptor
java.lang.Object
org.infinispan.commands.AbstractVisitor
org.infinispan.interceptors.base.CommandInterceptor
org.infinispan.interceptors.base.BaseRpcInterceptor
org.infinispan.interceptors.ClusteringInterceptor
- All Implemented Interfaces:
- Visitor
- Direct Known Subclasses:
- BaseDistributionInterceptor, ReplicationInterceptor
public abstract class ClusteringInterceptor
- extends BaseRpcInterceptor
Base class for replication and distribution interceptors.
- Since:
- 5.2
- Author:
- anistor@redhat.com
Method Summary |
void |
configure()
|
protected boolean |
ignorePreviousValueOnBackup(WriteCommand command,
InvocationContext ctx)
For conditional operations (replace, remove, put if absent) Used only for optimistic transactional caches, to solve the following situation: |
void |
injectDependencies(CommandsFactory cf,
EntryFactory entryFactory,
LockManager lockManager,
DataContainer dataContainer,
StateTransferManager stateTransferManager)
|
protected boolean |
isNeedReliableReturnValues(FlagAffectedCommand command)
|
protected boolean |
needsRemoteGet(InvocationContext ctx,
AbstractDataCommand command)
|
protected abstract InternalCacheEntry |
retrieveFromRemoteSource(Object key,
InvocationContext ctx,
boolean acquireRemoteLock,
FlagAffectedCommand command)
Retrieves a cache entry from a remote source. |
Methods inherited from class org.infinispan.commands.AbstractVisitor |
visitApplyDeltaCommand, visitClearCommand, visitCollection, visitCommitCommand, visitDistributedExecuteCommand, visitEntrySetCommand, visitEvictCommand, visitGetKeyValueCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitLockControlCommand, visitPrepareCommand, visitPutKeyValueCommand, visitPutMapCommand, visitRemoveCommand, visitReplaceCommand, visitRollbackCommand, visitSizeCommand, visitUnknownCommand, visitValuesCommand |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cf
protected CommandsFactory cf
entryFactory
protected EntryFactory entryFactory
lockManager
protected LockManager lockManager
dataContainer
protected DataContainer dataContainer
stateTransferManager
protected StateTransferManager stateTransferManager
needReliableReturnValues
protected boolean needReliableReturnValues
ClusteringInterceptor
public ClusteringInterceptor()
injectDependencies
public void injectDependencies(CommandsFactory cf,
EntryFactory entryFactory,
LockManager lockManager,
DataContainer dataContainer,
StateTransferManager stateTransferManager)
configure
public void configure()
isNeedReliableReturnValues
protected boolean isNeedReliableReturnValues(FlagAffectedCommand command)
needsRemoteGet
protected boolean needsRemoteGet(InvocationContext ctx,
AbstractDataCommand command)
ignorePreviousValueOnBackup
protected boolean ignorePreviousValueOnBackup(WriteCommand command,
InvocationContext ctx)
- For conditional operations (replace, remove, put if absent) Used only for optimistic transactional caches, to solve the following situation:
- node A (owner, tx originator) does a successful replace
- the actual value changes
- tx commits. The value is applied on A (the check was performed at operation time) but is not applied on
B (check is performed at commit time).
In such situations (optimistic caches) the remote conditional command should not re-check the old value.
retrieveFromRemoteSource
protected abstract InternalCacheEntry retrieveFromRemoteSource(Object key,
InvocationContext ctx,
boolean acquireRemoteLock,
FlagAffectedCommand command)
throws Exception
- 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.
- Parameters:
key
- key to look up
- Returns:
- an internal cache entry, or null if it cannot be located
- Throws:
Exception
Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.