Class NonTxDistributionInterceptor
- 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.NonTxDistributionInterceptor
-
- All Implemented Interfaces:
org.infinispan.commands.Visitor
,AsyncInterceptor
public class NonTxDistributionInterceptor extends BaseDistributionInterceptor
Non-transactional interceptor used by distributed caches that support concurrent writes. It is implemented based on lock forwarding. E.g. - 'k' is written on node A, owners(k)={B,C} - A forwards the given command to B - B acquires a lock on 'k' then it forwards it to the remaining owners: C - C applies the change and returns to B (no lock acquisition is needed) - B applies the result as well, releases the lock and returns the result of the operation to A.Note that even though this introduces an additional RPC (the forwarding), it behaves very well in conjunction with consistent-hash aware hotrod clients which connect directly to the lock owner.
- Since:
- 8.1
- 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 NonTxDistributionInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
visitPutKeyValueCommand(InvocationContext ctx, org.infinispan.commands.write.PutKeyValueCommand command)
java.lang.Object
visitPutMapCommand(InvocationContext ctx, org.infinispan.commands.write.PutMapCommand 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
visitReplaceCommand(InvocationContext ctx, org.infinispan.commands.write.ReplaceCommand 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, configure, getLog, handleFunctionalReadManyCommand, handleNonTxWriteCommand, handleRemotelyRetrievedKeys, invokeRemotely, invokeRemoveExpiredCommand, readNeedsRemoteValue, remoteGetMany, remoteGetSingleKey, remoteReadOnlyCommand, retrieveDistributionInfo, unwrapFunctionalManyResultOnOrigin, unwrapFunctionalResultOnOrigin, visitClearCommand, visitGetAllCommand, visitGetCacheEntryCommand, visitGetKeysInGroupCommand, visitGetKeyValueCommand, visitReadOnlyKeyCommand, visitReadOnlyManyCommand, visitRemoveExpiredCommand, 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, visitCommitCommand, visitEntrySetCommand, visitEvictCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitLockControlCommand, visitPrepareCommand, visitRollbackCommand, 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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
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
-
-