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:
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>, BaseDistributionInterceptor.ReadOnlyManyHelper
-
Nested classes/interfaces inherited from class org.infinispan.interceptors.impl.ClusteringInterceptor
ClusteringInterceptor.ClusteredGetAllFuture
-
-
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 Object
visitComputeCommand(InvocationContext ctx, org.infinispan.commands.write.ComputeCommand command)
Object
visitComputeIfAbsentCommand(InvocationContext ctx, org.infinispan.commands.write.ComputeIfAbsentCommand command)
Object
visitPutKeyValueCommand(InvocationContext ctx, org.infinispan.commands.write.PutKeyValueCommand command)
Object
visitPutMapCommand(InvocationContext ctx, org.infinispan.commands.write.PutMapCommand command)
Object
visitReadWriteKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteKeyCommand command)
Object
visitReadWriteKeyValueCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteKeyValueCommand command)
Object
visitReadWriteManyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteManyCommand command)
Object
visitReadWriteManyEntriesCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteManyEntriesCommand command)
Object
visitRemoveCommand(InvocationContext ctx, org.infinispan.commands.write.RemoveCommand command)
Object
visitReplaceCommand(InvocationContext ctx, org.infinispan.commands.write.ReplaceCommand command)
Object
visitWriteOnlyKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyKeyCommand command)
Object
visitWriteOnlyKeyValueCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyKeyValueCommand command)
Object
visitWriteOnlyManyCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyManyCommand command)
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, readNeedsRemoteValue, remoteGetMany, remoteGetSingleKey, remoteReadOnlyCommand, retrieveDistributionInfo, unwrapFunctionalManyResultOnOrigin, unwrapFunctionalResultOnOrigin, visitClearCommand, visitGetAllCommand, visitGetCacheEntryCommand, visitGetKeysInGroupCommand, visitGetKeyValueCommand, visitReadOnlyKeyCommand, visitReadOnlyManyCommand, 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, visitCommitCommand, visitDistributedExecuteCommand, visitEntrySetCommand, visitEvictCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitLockControlCommand, visitPrepareCommand, visitRollbackCommand, 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
-
visitPutKeyValueCommand
public Object visitPutKeyValueCommand(InvocationContext ctx, org.infinispan.commands.write.PutKeyValueCommand command) throws Throwable
- Specified by:
visitPutKeyValueCommand
in interfaceVisitor
- Overrides:
visitPutKeyValueCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitRemoveCommand
public Object visitRemoveCommand(InvocationContext ctx, org.infinispan.commands.write.RemoveCommand command) throws Throwable
- Specified by:
visitRemoveCommand
in interfaceVisitor
- Overrides:
visitRemoveCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitReplaceCommand
public Object visitReplaceCommand(InvocationContext ctx, org.infinispan.commands.write.ReplaceCommand command) throws Throwable
- Specified by:
visitReplaceCommand
in interfaceVisitor
- Overrides:
visitReplaceCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitComputeCommand
public Object visitComputeCommand(InvocationContext ctx, org.infinispan.commands.write.ComputeCommand command) throws Throwable
- Specified by:
visitComputeCommand
in interfaceVisitor
- Overrides:
visitComputeCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitComputeIfAbsentCommand
public Object visitComputeIfAbsentCommand(InvocationContext ctx, org.infinispan.commands.write.ComputeIfAbsentCommand command) throws Throwable
- Specified by:
visitComputeIfAbsentCommand
in interfaceVisitor
- Overrides:
visitComputeIfAbsentCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitReadWriteKeyValueCommand
public Object visitReadWriteKeyValueCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteKeyValueCommand command) throws Throwable
- Specified by:
visitReadWriteKeyValueCommand
in interfaceVisitor
- Overrides:
visitReadWriteKeyValueCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitReadWriteKeyCommand
public Object visitReadWriteKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteKeyCommand command) throws Throwable
- Specified by:
visitReadWriteKeyCommand
in interfaceVisitor
- Overrides:
visitReadWriteKeyCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitPutMapCommand
public Object visitPutMapCommand(InvocationContext ctx, org.infinispan.commands.write.PutMapCommand command) throws Throwable
- Specified by:
visitPutMapCommand
in interfaceVisitor
- Overrides:
visitPutMapCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitWriteOnlyManyEntriesCommand
public Object visitWriteOnlyManyEntriesCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyManyEntriesCommand command) throws Throwable
- Specified by:
visitWriteOnlyManyEntriesCommand
in interfaceVisitor
- Overrides:
visitWriteOnlyManyEntriesCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitWriteOnlyManyCommand
public Object visitWriteOnlyManyCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyManyCommand command) throws Throwable
- Specified by:
visitWriteOnlyManyCommand
in interfaceVisitor
- Overrides:
visitWriteOnlyManyCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitReadWriteManyCommand
public Object visitReadWriteManyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteManyCommand command) throws Throwable
- Specified by:
visitReadWriteManyCommand
in interfaceVisitor
- Overrides:
visitReadWriteManyCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitReadWriteManyEntriesCommand
public Object visitReadWriteManyEntriesCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteManyEntriesCommand command) throws Throwable
- Specified by:
visitReadWriteManyEntriesCommand
in interfaceVisitor
- Overrides:
visitReadWriteManyEntriesCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitWriteOnlyKeyValueCommand
public Object visitWriteOnlyKeyValueCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyKeyValueCommand command) throws Throwable
- Specified by:
visitWriteOnlyKeyValueCommand
in interfaceVisitor
- Overrides:
visitWriteOnlyKeyValueCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitWriteOnlyKeyCommand
public Object visitWriteOnlyKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyKeyCommand command) throws Throwable
- Specified by:
visitWriteOnlyKeyCommand
in interfaceVisitor
- Overrides:
visitWriteOnlyKeyCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
-