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:
org.infinispan.commands.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 extends org.infinispan.commands.VisitableCommand>, 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
componentRegistry, defaultSynchronous, rpcManager
-
Fields inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
cacheConfiguration
-
-
Constructor Summary
Constructors Constructor Description TxDistributionInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkTxCommandResponses(java.util.Map<Address,Response> responseMap, org.infinispan.commands.tx.TransactionBoundaryCommand command, org.infinispan.context.impl.TxInvocationContext<org.infinispan.transaction.impl.LocalTransaction> context, java.util.Collection<Address> recipients)
void
configure()
protected void
handleRemotelyRetrievedKeys(InvocationContext ctx, org.infinispan.commands.write.WriteCommand appliedCommand, java.util.List<?> remoteKeys)
<C extends org.infinispan.commands.write.AbstractDataWriteCommand & org.infinispan.commands.functional.FunctionalCommand>
java.lang.ObjecthandleTxFunctionalCommand(InvocationContext ctx, C command)
protected <C extends org.infinispan.commands.VisitableCommand & org.infinispan.commands.FlagAffectedCommand & org.infinispan.commands.TopologyAffectedCommand,K>
java.lang.ObjecthandleTxWriteManyCommand(InvocationContext ctx, C command, java.util.Collection<K> keys, java.util.function.BiFunction<C,java.util.List<K>,C> copyCommand)
protected <C extends org.infinispan.commands.TopologyAffectedCommand & org.infinispan.commands.FlagAffectedCommand,K,V>
java.lang.ObjecthandleTxWriteManyEntriesCommand(InvocationContext ctx, C command, java.util.Map<K,V> entries, java.util.function.BiFunction<C,java.util.Map<K,V>,C> copyCommand)
protected java.util.concurrent.CompletionStage<java.lang.Object>
prepareOnAffectedNodes(org.infinispan.context.impl.TxInvocationContext<?> ctx, org.infinispan.commands.tx.PrepareCommand command, java.util.Collection<Address> recipients)
protected <C extends org.infinispan.commands.FlagAffectedCommand & org.infinispan.commands.TopologyAffectedCommand>
java.util.concurrent.CompletionStage<java.lang.Void>remoteGetSingleKey(InvocationContext ctx, C command, java.lang.Object key, boolean isWrite)
Fetch a key from its remote owners and store it in the context.protected org.infinispan.commands.functional.ReadOnlyKeyCommand
remoteReadOnlyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyKeyCommand command)
java.lang.Object
visitCommitCommand(org.infinispan.context.impl.TxInvocationContext ctx, org.infinispan.commands.tx.CommitCommand command)
java.lang.Object
visitComputeCommand(InvocationContext ctx, org.infinispan.commands.write.ComputeCommand command)
java.lang.Object
visitComputeIfAbsentCommand(InvocationContext ctx, org.infinispan.commands.write.ComputeIfAbsentCommand command)
java.lang.Object
visitLockControlCommand(org.infinispan.context.impl.TxInvocationContext ctx, org.infinispan.commands.control.LockControlCommand command)
java.lang.Object
visitPrepareCommand(org.infinispan.context.impl.TxInvocationContext ctx, org.infinispan.commands.tx.PrepareCommand command)
java.lang.Object
visitPutKeyValueCommand(InvocationContext ctx, org.infinispan.commands.write.PutKeyValueCommand command)
java.lang.Object
visitPutMapCommand(InvocationContext ctx, org.infinispan.commands.write.PutMapCommand command)
java.lang.Object
visitReadOnlyManyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyManyCommand command)
java.lang.Object
visitReadWriteKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteKeyCommand command)
java.lang.Object
visitReadWriteKeyValueCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteKeyValueCommand command)
java.lang.Object
visitReadWriteManyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteManyCommand command)
java.lang.Object
visitReadWriteManyEntriesCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteManyEntriesCommand command)
java.lang.Object
visitRemoveCommand(InvocationContext ctx, org.infinispan.commands.write.RemoveCommand command)
java.lang.Object
visitRemoveExpiredCommand(InvocationContext ctx, org.infinispan.commands.write.RemoveExpiredCommand command)
java.lang.Object
visitReplaceCommand(InvocationContext ctx, org.infinispan.commands.write.ReplaceCommand command)
java.lang.Object
visitRollbackCommand(org.infinispan.context.impl.TxInvocationContext ctx, org.infinispan.commands.tx.RollbackCommand command)
java.lang.Object
visitWriteOnlyKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyKeyCommand command)
java.lang.Object
visitWriteOnlyKeyValueCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyKeyValueCommand command)
java.lang.Object
visitWriteOnlyManyCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyManyCommand command)
java.lang.Object
visitWriteOnlyManyEntriesCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyManyEntriesCommand command)
-
Methods inherited from class org.infinispan.interceptors.distribution.BaseDistributionInterceptor
checkTopologyId, getLog, handleFunctionalReadManyCommand, handleNonTxWriteCommand, invokeRemotely, invokeRemoveExpiredCommand, readNeedsRemoteValue, remoteGetMany, retrieveDistributionInfo, unwrapFunctionalManyResultOnOrigin, unwrapFunctionalResultOnOrigin, visitClearCommand, visitGetAllCommand, visitGetCacheEntryCommand, visitGetKeysInGroupCommand, visitGetKeyValueCommand, visitReadOnlyKeyCommand, 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, visitEntrySetCommand, visitEvictCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitSizeCommand, visitUnknownCommand
-
Methods inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
asyncInvokeNext, asyncInvokeNext, asyncInvokeNext, asyncValue, delayedNull, delayedValue, delayedValue, invokeNext, invokeNextAndExceptionally, invokeNextAndFinally, invokeNextAndHandle, invokeNextThenAccept, invokeNextThenApply, isSuccessfullyDone, makeStage, setNextInterceptor, valueOrException
-
-
-
-
Method Detail
-
configure
public void configure()
- Overrides:
configure
in classBaseDistributionInterceptor
-
visitReplaceCommand
public java.lang.Object visitReplaceCommand(InvocationContext ctx, org.infinispan.commands.write.ReplaceCommand command) throws java.lang.Throwable
- Specified by:
visitReplaceCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitReplaceCommand
in classDDAsyncInterceptor
- Throws:
java.lang.Throwable
-
visitComputeCommand
public java.lang.Object visitComputeCommand(InvocationContext ctx, org.infinispan.commands.write.ComputeCommand command) throws java.lang.Throwable
- Specified by:
visitComputeCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitComputeCommand
in classDDAsyncInterceptor
- Throws:
java.lang.Throwable
-
visitComputeIfAbsentCommand
public java.lang.Object visitComputeIfAbsentCommand(InvocationContext ctx, org.infinispan.commands.write.ComputeIfAbsentCommand command) throws java.lang.Throwable
- Specified by:
visitComputeIfAbsentCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitComputeIfAbsentCommand
in classDDAsyncInterceptor
- Throws:
java.lang.Throwable
-
visitRemoveCommand
public java.lang.Object visitRemoveCommand(InvocationContext ctx, org.infinispan.commands.write.RemoveCommand command) throws java.lang.Throwable
- Specified by:
visitRemoveCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitRemoveCommand
in classDDAsyncInterceptor
- Throws:
java.lang.Throwable
-
visitRemoveExpiredCommand
public java.lang.Object visitRemoveExpiredCommand(InvocationContext ctx, org.infinispan.commands.write.RemoveExpiredCommand command) throws java.lang.Throwable
- Specified by:
visitRemoveExpiredCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitRemoveExpiredCommand
in classBaseDistributionInterceptor
- Throws:
java.lang.Throwable
-
visitPutKeyValueCommand
public java.lang.Object visitPutKeyValueCommand(InvocationContext ctx, org.infinispan.commands.write.PutKeyValueCommand command) throws java.lang.Throwable
- Specified by:
visitPutKeyValueCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitPutKeyValueCommand
in classDDAsyncInterceptor
- Throws:
java.lang.Throwable
-
visitPutMapCommand
public java.lang.Object visitPutMapCommand(InvocationContext ctx, org.infinispan.commands.write.PutMapCommand command) throws java.lang.Throwable
- Specified by:
visitPutMapCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitPutMapCommand
in classDDAsyncInterceptor
- Throws:
java.lang.Throwable
-
visitLockControlCommand
public java.lang.Object visitLockControlCommand(org.infinispan.context.impl.TxInvocationContext ctx, org.infinispan.commands.control.LockControlCommand command) throws java.lang.Throwable
- Specified by:
visitLockControlCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitLockControlCommand
in classDDAsyncInterceptor
- Throws:
java.lang.Throwable
-
visitWriteOnlyKeyCommand
public java.lang.Object visitWriteOnlyKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyKeyCommand command) throws java.lang.Throwable
- Specified by:
visitWriteOnlyKeyCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitWriteOnlyKeyCommand
in classDDAsyncInterceptor
- Throws:
java.lang.Throwable
-
visitReadWriteKeyValueCommand
public java.lang.Object visitReadWriteKeyValueCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteKeyValueCommand command) throws java.lang.Throwable
- Specified by:
visitReadWriteKeyValueCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitReadWriteKeyValueCommand
in classDDAsyncInterceptor
- Throws:
java.lang.Throwable
-
visitReadWriteKeyCommand
public java.lang.Object visitReadWriteKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteKeyCommand command) throws java.lang.Throwable
- Specified by:
visitReadWriteKeyCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitReadWriteKeyCommand
in classDDAsyncInterceptor
- Throws:
java.lang.Throwable
-
visitWriteOnlyManyEntriesCommand
public java.lang.Object visitWriteOnlyManyEntriesCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyManyEntriesCommand command) throws java.lang.Throwable
- Specified by:
visitWriteOnlyManyEntriesCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitWriteOnlyManyEntriesCommand
in classDDAsyncInterceptor
- Throws:
java.lang.Throwable
-
visitWriteOnlyKeyValueCommand
public java.lang.Object visitWriteOnlyKeyValueCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyKeyValueCommand command) throws java.lang.Throwable
- Specified by:
visitWriteOnlyKeyValueCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitWriteOnlyKeyValueCommand
in classDDAsyncInterceptor
- Throws:
java.lang.Throwable
-
visitWriteOnlyManyCommand
public java.lang.Object visitWriteOnlyManyCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyManyCommand command) throws java.lang.Throwable
- Specified by:
visitWriteOnlyManyCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitWriteOnlyManyCommand
in classDDAsyncInterceptor
- Throws:
java.lang.Throwable
-
visitReadWriteManyCommand
public java.lang.Object visitReadWriteManyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteManyCommand command) throws java.lang.Throwable
- Specified by:
visitReadWriteManyCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitReadWriteManyCommand
in classDDAsyncInterceptor
- Throws:
java.lang.Throwable
-
visitReadWriteManyEntriesCommand
public java.lang.Object visitReadWriteManyEntriesCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteManyEntriesCommand command) throws java.lang.Throwable
- Specified by:
visitReadWriteManyEntriesCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitReadWriteManyEntriesCommand
in classDDAsyncInterceptor
- Throws:
java.lang.Throwable
-
visitCommitCommand
public java.lang.Object visitCommitCommand(org.infinispan.context.impl.TxInvocationContext ctx, org.infinispan.commands.tx.CommitCommand command) throws java.lang.Throwable
- Specified by:
visitCommitCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitCommitCommand
in classDDAsyncInterceptor
- Throws:
java.lang.Throwable
-
visitPrepareCommand
public java.lang.Object visitPrepareCommand(org.infinispan.context.impl.TxInvocationContext ctx, org.infinispan.commands.tx.PrepareCommand command) throws java.lang.Throwable
- Specified by:
visitPrepareCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitPrepareCommand
in classDDAsyncInterceptor
- Throws:
java.lang.Throwable
-
prepareOnAffectedNodes
protected java.util.concurrent.CompletionStage<java.lang.Object> prepareOnAffectedNodes(org.infinispan.context.impl.TxInvocationContext<?> ctx, org.infinispan.commands.tx.PrepareCommand command, java.util.Collection<Address> recipients)
-
visitRollbackCommand
public java.lang.Object visitRollbackCommand(org.infinispan.context.impl.TxInvocationContext ctx, org.infinispan.commands.tx.RollbackCommand command) throws java.lang.Throwable
- Specified by:
visitRollbackCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitRollbackCommand
in classDDAsyncInterceptor
- Throws:
java.lang.Throwable
-
checkTxCommandResponses
protected void checkTxCommandResponses(java.util.Map<Address,Response> responseMap, org.infinispan.commands.tx.TransactionBoundaryCommand command, org.infinispan.context.impl.TxInvocationContext<org.infinispan.transaction.impl.LocalTransaction> context, java.util.Collection<Address> recipients)
-
handleTxWriteManyEntriesCommand
protected <C extends org.infinispan.commands.TopologyAffectedCommand & org.infinispan.commands.FlagAffectedCommand,K,V> java.lang.Object handleTxWriteManyEntriesCommand(InvocationContext ctx, C command, java.util.Map<K,V> entries, java.util.function.BiFunction<C,java.util.Map<K,V>,C> copyCommand)
-
handleTxWriteManyCommand
protected <C extends org.infinispan.commands.VisitableCommand & org.infinispan.commands.FlagAffectedCommand & org.infinispan.commands.TopologyAffectedCommand,K> java.lang.Object handleTxWriteManyCommand(InvocationContext ctx, C command, java.util.Collection<K> keys, java.util.function.BiFunction<C,java.util.List<K>,C> copyCommand)
-
handleTxFunctionalCommand
public <C extends org.infinispan.commands.write.AbstractDataWriteCommand & org.infinispan.commands.functional.FunctionalCommand> java.lang.Object handleTxFunctionalCommand(InvocationContext ctx, C command)
-
visitReadOnlyManyCommand
public java.lang.Object visitReadOnlyManyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyManyCommand command) throws java.lang.Throwable
- Specified by:
visitReadOnlyManyCommand
in interfaceorg.infinispan.commands.Visitor
- Overrides:
visitReadOnlyManyCommand
in classBaseDistributionInterceptor
- Throws:
java.lang.Throwable
-
remoteReadOnlyCommand
protected org.infinispan.commands.functional.ReadOnlyKeyCommand remoteReadOnlyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyKeyCommand command)
- Overrides:
remoteReadOnlyCommand
in classBaseDistributionInterceptor
-
remoteGetSingleKey
protected <C extends org.infinispan.commands.FlagAffectedCommand & org.infinispan.commands.TopologyAffectedCommand> java.util.concurrent.CompletionStage<java.lang.Void> remoteGetSingleKey(InvocationContext ctx, C command, java.lang.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, org.infinispan.commands.write.WriteCommand appliedCommand, java.util.List<?> remoteKeys)
- Overrides:
handleRemotelyRetrievedKeys
in classBaseDistributionInterceptor
-
-