Class TxDistributionInterceptor
- java.lang.Object
-
- org.infinispan.interceptors.BaseAsyncInterceptor
-
- org.infinispan.interceptors.DDAsyncInterceptor
-
- org.infinispan.interceptors.impl.BaseRpcInterceptor
-
- org.infinispan.interceptors.impl.ClusteringInterceptor
-
- org.infinispan.interceptors.distribution.BaseDistributionInterceptor
-
- org.infinispan.interceptors.distribution.TxDistributionInterceptor
-
- All Implemented Interfaces:
Visitor
,AsyncInterceptor
- Direct Known Subclasses:
TotalOrderDistributionInterceptor
,VersionedDistributionInterceptor
public class TxDistributionInterceptor extends BaseDistributionInterceptor
Handles the distribution of the transactional caches.- Author:
- Mircea Markus, Dan Berindei
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.infinispan.interceptors.distribution.BaseDistributionInterceptor
BaseDistributionInterceptor.ReadManyCommandHelper<C>, BaseDistributionInterceptor.ReadOnlyManyHelper
-
-
Field Summary
-
Fields inherited from class org.infinispan.interceptors.distribution.BaseDistributionInterceptor
expirationManager, isL1Enabled, isReplicated, keyPartitioner, rvrl, timeService
-
Fields inherited from class org.infinispan.interceptors.impl.ClusteringInterceptor
cf, dataContainer, distributionManager, entryFactory, lockManager
-
Fields inherited from class org.infinispan.interceptors.impl.BaseRpcInterceptor
defaultSynchronous, rpcManager
-
Fields inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
cacheConfiguration
-
-
Constructor Summary
Constructors Constructor Description TxDistributionInterceptor()
-
Method Summary
-
Methods inherited from class org.infinispan.interceptors.distribution.BaseDistributionInterceptor
checkTopologyId, getLog, handleFunctionalReadManyCommand, handleNonTxWriteCommand, invokeRemotely, readNeedsRemoteValue, remoteGetMany, retrieveDistributionInfo, unwrapFunctionalManyResultOnOrigin, unwrapFunctionalResultOnOrigin, visitClearCommand, visitGetAllCommand, visitGetCacheEntryCommand, visitGetKeysInGroupCommand, visitGetKeyValueCommand, visitReadOnlyKeyCommand, visitSizeCommand, wrapFunctionalManyResultOnNonOrigin, wrapFunctionalResultOnNonOriginOnReturn, wrapRemoteEntry
-
Methods inherited from class org.infinispan.interceptors.impl.ClusteringInterceptor
getSuccessfulResponseOrFail, unexpected
-
Methods inherited from class org.infinispan.interceptors.impl.BaseRpcInterceptor
init, isLocalModeForced, isSynchronous, shouldInvokeRemoteTxCommand, shouldTotalOrderRollbackBeInvokedRemotely, totalOrderPrepare, totalOrderTxCommit, totalOrderTxRollback, transactionRemotelyPrepared
-
Methods inherited from class org.infinispan.interceptors.DDAsyncInterceptor
handleDefault, visitCommand, visitDistributedExecuteCommand, visitEntrySetCommand, visitEvictCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitUnknownCommand
-
Methods inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
asyncInvokeNext, asyncInvokeNext, asyncInvokeNext, asyncValue, delayedValue, delayedValue, invokeNext, invokeNextAndExceptionally, invokeNextAndFinally, invokeNextAndHandle, invokeNextThenAccept, invokeNextThenApply, isSuccessfullyDone, makeStage, setNextInterceptor, valueOrException
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.infinispan.commands.Visitor
visitApplyDeltaCommand, visitRemoveExpiredCommand
-
-
-
-
Method Detail
-
configure
public void configure()
- Overrides:
configure
in classBaseDistributionInterceptor
-
visitReplaceCommand
public Object visitReplaceCommand(InvocationContext ctx, ReplaceCommand command) throws Throwable
- Specified by:
visitReplaceCommand
in interfaceVisitor
- Overrides:
visitReplaceCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitComputeCommand
public Object visitComputeCommand(InvocationContext ctx, ComputeCommand command) throws Throwable
- Specified by:
visitComputeCommand
in interfaceVisitor
- Overrides:
visitComputeCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitComputeIfAbsentCommand
public Object visitComputeIfAbsentCommand(InvocationContext ctx, ComputeIfAbsentCommand command) throws Throwable
- Specified by:
visitComputeIfAbsentCommand
in interfaceVisitor
- Overrides:
visitComputeIfAbsentCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitRemoveCommand
public Object visitRemoveCommand(InvocationContext ctx, RemoveCommand command) throws Throwable
- Specified by:
visitRemoveCommand
in interfaceVisitor
- Overrides:
visitRemoveCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitPutKeyValueCommand
public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable
- Specified by:
visitPutKeyValueCommand
in interfaceVisitor
- Overrides:
visitPutKeyValueCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitPutMapCommand
public Object visitPutMapCommand(InvocationContext ctx, PutMapCommand command) throws Throwable
- Specified by:
visitPutMapCommand
in interfaceVisitor
- Overrides:
visitPutMapCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitLockControlCommand
public Object visitLockControlCommand(org.infinispan.context.impl.TxInvocationContext ctx, LockControlCommand command) throws Throwable
- Specified by:
visitLockControlCommand
in interfaceVisitor
- Overrides:
visitLockControlCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitWriteOnlyKeyCommand
public Object visitWriteOnlyKeyCommand(InvocationContext ctx, WriteOnlyKeyCommand command) throws Throwable
- Specified by:
visitWriteOnlyKeyCommand
in interfaceVisitor
- Overrides:
visitWriteOnlyKeyCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitReadWriteKeyValueCommand
public Object visitReadWriteKeyValueCommand(InvocationContext ctx, ReadWriteKeyValueCommand command) throws Throwable
- Specified by:
visitReadWriteKeyValueCommand
in interfaceVisitor
- Overrides:
visitReadWriteKeyValueCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitReadWriteKeyCommand
public Object visitReadWriteKeyCommand(InvocationContext ctx, ReadWriteKeyCommand command) throws Throwable
- Specified by:
visitReadWriteKeyCommand
in interfaceVisitor
- Overrides:
visitReadWriteKeyCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitWriteOnlyManyEntriesCommand
public Object visitWriteOnlyManyEntriesCommand(InvocationContext ctx, WriteOnlyManyEntriesCommand command) throws Throwable
- Specified by:
visitWriteOnlyManyEntriesCommand
in interfaceVisitor
- Overrides:
visitWriteOnlyManyEntriesCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitWriteOnlyKeyValueCommand
public Object visitWriteOnlyKeyValueCommand(InvocationContext ctx, WriteOnlyKeyValueCommand command) throws Throwable
- Specified by:
visitWriteOnlyKeyValueCommand
in interfaceVisitor
- Overrides:
visitWriteOnlyKeyValueCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitWriteOnlyManyCommand
public Object visitWriteOnlyManyCommand(InvocationContext ctx, WriteOnlyManyCommand command) throws Throwable
- Specified by:
visitWriteOnlyManyCommand
in interfaceVisitor
- Overrides:
visitWriteOnlyManyCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitReadWriteManyCommand
public Object visitReadWriteManyCommand(InvocationContext ctx, ReadWriteManyCommand command) throws Throwable
- Specified by:
visitReadWriteManyCommand
in interfaceVisitor
- Overrides:
visitReadWriteManyCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitReadWriteManyEntriesCommand
public Object visitReadWriteManyEntriesCommand(InvocationContext ctx, ReadWriteManyEntriesCommand command) throws Throwable
- Specified by:
visitReadWriteManyEntriesCommand
in interfaceVisitor
- Overrides:
visitReadWriteManyEntriesCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitCommitCommand
public Object visitCommitCommand(org.infinispan.context.impl.TxInvocationContext ctx, CommitCommand command) throws Throwable
- Specified by:
visitCommitCommand
in interfaceVisitor
- Overrides:
visitCommitCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitPrepareCommand
public Object visitPrepareCommand(org.infinispan.context.impl.TxInvocationContext ctx, PrepareCommand command) throws Throwable
- Specified by:
visitPrepareCommand
in interfaceVisitor
- Overrides:
visitPrepareCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
prepareOnAffectedNodes
protected CompletionStage<Object> prepareOnAffectedNodes(org.infinispan.context.impl.TxInvocationContext<?> ctx, PrepareCommand command, Collection<Address> recipients)
-
visitRollbackCommand
public Object visitRollbackCommand(org.infinispan.context.impl.TxInvocationContext ctx, RollbackCommand command) throws Throwable
- Specified by:
visitRollbackCommand
in interfaceVisitor
- Overrides:
visitRollbackCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
checkTxCommandResponses
protected void checkTxCommandResponses(Map<Address,Response> responseMap, TransactionBoundaryCommand command, org.infinispan.context.impl.TxInvocationContext<org.infinispan.transaction.impl.LocalTransaction> context, Collection<Address> recipients)
-
handleTxWriteManyEntriesCommand
protected <C extends TopologyAffectedCommand & FlagAffectedCommand,K,V> Object handleTxWriteManyEntriesCommand(InvocationContext ctx, C command, Map<K,V> entries, BiFunction<C,Map<K,V>,C> copyCommand)
-
handleTxWriteManyCommand
protected <C extends VisitableCommand & FlagAffectedCommand & TopologyAffectedCommand,K> Object handleTxWriteManyCommand(InvocationContext ctx, C command, Collection<K> keys, BiFunction<C,List<K>,C> copyCommand)
-
handleTxFunctionalCommand
public <C extends AbstractDataWriteCommand & FunctionalCommand> Object handleTxFunctionalCommand(InvocationContext ctx, C command)
-
visitReadOnlyManyCommand
public Object visitReadOnlyManyCommand(InvocationContext ctx, ReadOnlyManyCommand command) throws Throwable
- Specified by:
visitReadOnlyManyCommand
in interfaceVisitor
- Overrides:
visitReadOnlyManyCommand
in classBaseDistributionInterceptor
- Throws:
Throwable
-
remoteReadOnlyCommand
protected ReadOnlyKeyCommand remoteReadOnlyCommand(InvocationContext ctx, ReadOnlyKeyCommand command)
- Overrides:
remoteReadOnlyCommand
in classBaseDistributionInterceptor
-
remoteGetSingleKey
protected <C extends FlagAffectedCommand & TopologyAffectedCommand> CompletionStage<Void> remoteGetSingleKey(InvocationContext ctx, C command, Object key, boolean isWrite)
Description copied from class:BaseDistributionInterceptor
Fetch a key from its remote owners and store it in the context. Not thread-safe. The invocation context should not be accessed concurrently from multiple threads, so this method should only be used for single-key commands.- Overrides:
remoteGetSingleKey
in classBaseDistributionInterceptor
-
handleRemotelyRetrievedKeys
protected void handleRemotelyRetrievedKeys(InvocationContext ctx, WriteCommand appliedCommand, List<?> remoteKeys)
- Overrides:
handleRemotelyRetrievedKeys
in classBaseDistributionInterceptor
-
-