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>, 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckTxCommandResponses(Map<Address,Response> responseMap, org.infinispan.commands.tx.TransactionBoundaryCommand command, org.infinispan.context.impl.TxInvocationContext<org.infinispan.transaction.impl.LocalTransaction> context, Collection<Address> recipients)voidconfigure()protected voidhandleRemotelyRetrievedKeys(InvocationContext ctx, org.infinispan.commands.write.WriteCommand appliedCommand, List<?> remoteKeys)<C extends org.infinispan.commands.write.AbstractDataWriteCommand & org.infinispan.commands.functional.FunctionalCommand>
ObjecthandleTxFunctionalCommand(InvocationContext ctx, C command)protected <C extends org.infinispan.commands.VisitableCommand & org.infinispan.commands.FlagAffectedCommand & org.infinispan.commands.TopologyAffectedCommand,K>
ObjecthandleTxWriteManyCommand(InvocationContext ctx, C command, Collection<K> keys, BiFunction<C,List<K>,C> copyCommand)protected <C extends org.infinispan.commands.TopologyAffectedCommand & org.infinispan.commands.FlagAffectedCommand,K,V>
ObjecthandleTxWriteManyEntriesCommand(InvocationContext ctx, C command, Map<K,V> entries, BiFunction<C,Map<K,V>,C> copyCommand)protected CompletionStage<Object>prepareOnAffectedNodes(org.infinispan.context.impl.TxInvocationContext<?> ctx, org.infinispan.commands.tx.PrepareCommand command, Collection<Address> recipients)protected <C extends org.infinispan.commands.FlagAffectedCommand & org.infinispan.commands.TopologyAffectedCommand>
CompletionStage<Void>remoteGetSingleKey(InvocationContext ctx, C command, Object key, boolean isWrite)Fetch a key from its remote owners and store it in the context.protected org.infinispan.commands.functional.ReadOnlyKeyCommandremoteReadOnlyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyKeyCommand command)ObjectvisitCommitCommand(org.infinispan.context.impl.TxInvocationContext ctx, org.infinispan.commands.tx.CommitCommand command)ObjectvisitComputeCommand(InvocationContext ctx, org.infinispan.commands.write.ComputeCommand command)ObjectvisitComputeIfAbsentCommand(InvocationContext ctx, org.infinispan.commands.write.ComputeIfAbsentCommand command)ObjectvisitLockControlCommand(org.infinispan.context.impl.TxInvocationContext ctx, org.infinispan.commands.control.LockControlCommand command)ObjectvisitPrepareCommand(org.infinispan.context.impl.TxInvocationContext ctx, org.infinispan.commands.tx.PrepareCommand command)ObjectvisitPutKeyValueCommand(InvocationContext ctx, org.infinispan.commands.write.PutKeyValueCommand command)ObjectvisitPutMapCommand(InvocationContext ctx, org.infinispan.commands.write.PutMapCommand command)ObjectvisitReadOnlyManyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyManyCommand command)ObjectvisitReadWriteKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteKeyCommand command)ObjectvisitReadWriteKeyValueCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteKeyValueCommand command)ObjectvisitReadWriteManyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteManyCommand command)ObjectvisitReadWriteManyEntriesCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteManyEntriesCommand command)ObjectvisitRemoveCommand(InvocationContext ctx, org.infinispan.commands.write.RemoveCommand command)ObjectvisitReplaceCommand(InvocationContext ctx, org.infinispan.commands.write.ReplaceCommand command)ObjectvisitRollbackCommand(org.infinispan.context.impl.TxInvocationContext ctx, org.infinispan.commands.tx.RollbackCommand command)ObjectvisitWriteOnlyKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyKeyCommand command)ObjectvisitWriteOnlyKeyValueCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyKeyValueCommand command)ObjectvisitWriteOnlyManyCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyManyCommand command)ObjectvisitWriteOnlyManyEntriesCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyManyEntriesCommand command)-
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
-
-
-
-
Method Detail
-
configure
public void configure()
- Overrides:
configurein classBaseDistributionInterceptor
-
visitReplaceCommand
public Object visitReplaceCommand(InvocationContext ctx, org.infinispan.commands.write.ReplaceCommand command) throws Throwable
- Specified by:
visitReplaceCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitReplaceCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitComputeCommand
public Object visitComputeCommand(InvocationContext ctx, org.infinispan.commands.write.ComputeCommand command) throws Throwable
- Specified by:
visitComputeCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitComputeCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitComputeIfAbsentCommand
public Object visitComputeIfAbsentCommand(InvocationContext ctx, org.infinispan.commands.write.ComputeIfAbsentCommand command) throws Throwable
- Specified by:
visitComputeIfAbsentCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitComputeIfAbsentCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitRemoveCommand
public Object visitRemoveCommand(InvocationContext ctx, org.infinispan.commands.write.RemoveCommand command) throws Throwable
- Specified by:
visitRemoveCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitRemoveCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitPutKeyValueCommand
public Object visitPutKeyValueCommand(InvocationContext ctx, org.infinispan.commands.write.PutKeyValueCommand command) throws Throwable
- Specified by:
visitPutKeyValueCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitPutKeyValueCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitPutMapCommand
public Object visitPutMapCommand(InvocationContext ctx, org.infinispan.commands.write.PutMapCommand command) throws Throwable
- Specified by:
visitPutMapCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitPutMapCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitLockControlCommand
public Object visitLockControlCommand(org.infinispan.context.impl.TxInvocationContext ctx, org.infinispan.commands.control.LockControlCommand command) throws Throwable
- Specified by:
visitLockControlCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitLockControlCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitWriteOnlyKeyCommand
public Object visitWriteOnlyKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyKeyCommand command) throws Throwable
- Specified by:
visitWriteOnlyKeyCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitWriteOnlyKeyCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitReadWriteKeyValueCommand
public Object visitReadWriteKeyValueCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteKeyValueCommand command) throws Throwable
- Specified by:
visitReadWriteKeyValueCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitReadWriteKeyValueCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitReadWriteKeyCommand
public Object visitReadWriteKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteKeyCommand command) throws Throwable
- Specified by:
visitReadWriteKeyCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitReadWriteKeyCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitWriteOnlyManyEntriesCommand
public Object visitWriteOnlyManyEntriesCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyManyEntriesCommand command) throws Throwable
- Specified by:
visitWriteOnlyManyEntriesCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitWriteOnlyManyEntriesCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitWriteOnlyKeyValueCommand
public Object visitWriteOnlyKeyValueCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyKeyValueCommand command) throws Throwable
- Specified by:
visitWriteOnlyKeyValueCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitWriteOnlyKeyValueCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitWriteOnlyManyCommand
public Object visitWriteOnlyManyCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyManyCommand command) throws Throwable
- Specified by:
visitWriteOnlyManyCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitWriteOnlyManyCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitReadWriteManyCommand
public Object visitReadWriteManyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteManyCommand command) throws Throwable
- Specified by:
visitReadWriteManyCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitReadWriteManyCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitReadWriteManyEntriesCommand
public Object visitReadWriteManyEntriesCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteManyEntriesCommand command) throws Throwable
- Specified by:
visitReadWriteManyEntriesCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitReadWriteManyEntriesCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitCommitCommand
public Object visitCommitCommand(org.infinispan.context.impl.TxInvocationContext ctx, org.infinispan.commands.tx.CommitCommand command) throws Throwable
- Specified by:
visitCommitCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitCommitCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitPrepareCommand
public Object visitPrepareCommand(org.infinispan.context.impl.TxInvocationContext ctx, org.infinispan.commands.tx.PrepareCommand command) throws Throwable
- Specified by:
visitPrepareCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitPrepareCommandin classDDAsyncInterceptor- Throws:
Throwable
-
prepareOnAffectedNodes
protected CompletionStage<Object> prepareOnAffectedNodes(org.infinispan.context.impl.TxInvocationContext<?> ctx, org.infinispan.commands.tx.PrepareCommand command, Collection<Address> recipients)
-
visitRollbackCommand
public Object visitRollbackCommand(org.infinispan.context.impl.TxInvocationContext ctx, org.infinispan.commands.tx.RollbackCommand command) throws Throwable
- Specified by:
visitRollbackCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitRollbackCommandin classDDAsyncInterceptor- Throws:
Throwable
-
checkTxCommandResponses
protected void checkTxCommandResponses(Map<Address,Response> responseMap, org.infinispan.commands.tx.TransactionBoundaryCommand command, org.infinispan.context.impl.TxInvocationContext<org.infinispan.transaction.impl.LocalTransaction> context, Collection<Address> recipients)
-
handleTxWriteManyEntriesCommand
protected <C extends org.infinispan.commands.TopologyAffectedCommand & org.infinispan.commands.FlagAffectedCommand,K,V> Object handleTxWriteManyEntriesCommand(InvocationContext ctx, C command, Map<K,V> entries, BiFunction<C,Map<K,V>,C> copyCommand)
-
handleTxWriteManyCommand
protected <C extends org.infinispan.commands.VisitableCommand & org.infinispan.commands.FlagAffectedCommand & org.infinispan.commands.TopologyAffectedCommand,K> Object handleTxWriteManyCommand(InvocationContext ctx, C command, Collection<K> keys, BiFunction<C,List<K>,C> copyCommand)
-
handleTxFunctionalCommand
public <C extends org.infinispan.commands.write.AbstractDataWriteCommand & org.infinispan.commands.functional.FunctionalCommand> Object handleTxFunctionalCommand(InvocationContext ctx, C command)
-
visitReadOnlyManyCommand
public Object visitReadOnlyManyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyManyCommand command) throws Throwable
- Specified by:
visitReadOnlyManyCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitReadOnlyManyCommandin classBaseDistributionInterceptor- Throws:
Throwable
-
remoteReadOnlyCommand
protected org.infinispan.commands.functional.ReadOnlyKeyCommand remoteReadOnlyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyKeyCommand command)
- Overrides:
remoteReadOnlyCommandin classBaseDistributionInterceptor
-
remoteGetSingleKey
protected <C extends org.infinispan.commands.FlagAffectedCommand & org.infinispan.commands.TopologyAffectedCommand> CompletionStage<Void> remoteGetSingleKey(InvocationContext ctx, C command, Object key, boolean isWrite)
Description copied from class:BaseDistributionInterceptorFetch 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:
remoteGetSingleKeyin classBaseDistributionInterceptor
-
handleRemotelyRetrievedKeys
protected void handleRemotelyRetrievedKeys(InvocationContext ctx, org.infinispan.commands.write.WriteCommand appliedCommand, List<?> remoteKeys)
- Overrides:
handleRemotelyRetrievedKeysin classBaseDistributionInterceptor
-
-