org.infinispan.interceptors.distribution
Class NonTxConcurrentDistributionInterceptor
java.lang.Object
org.infinispan.commands.AbstractVisitor
org.infinispan.interceptors.base.CommandInterceptor
org.infinispan.interceptors.base.BaseRpcInterceptor
org.infinispan.interceptors.ClusteringInterceptor
org.infinispan.interceptors.distribution.BaseDistributionInterceptor
org.infinispan.interceptors.distribution.NonTxDistributionInterceptor
org.infinispan.interceptors.distribution.NonTxConcurrentDistributionInterceptor
- All Implemented Interfaces:
- Visitor
public class NonTxConcurrentDistributionInterceptor
- extends NonTxDistributionInterceptor
Non-transactional interceptor to be used by caches that want to 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:
- 5.2
- Author:
- Mircea Markus
Methods inherited from class org.infinispan.commands.AbstractVisitor |
visitApplyDeltaCommand, visitCollection, visitCommitCommand, visitDistributedExecuteCommand, visitEntrySetCommand, visitEvictCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitLockControlCommand, visitPrepareCommand, visitRollbackCommand, visitSizeCommand, visitUnknownCommand, visitValuesCommand |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NonTxConcurrentDistributionInterceptor
public NonTxConcurrentDistributionInterceptor()
visitPutMapCommand
public Object visitPutMapCommand(InvocationContext ctx,
PutMapCommand command)
throws Throwable
- Specified by:
visitPutMapCommand
in interface Visitor
- Overrides:
visitPutMapCommand
in class BaseDistributionInterceptor
- Throws:
Throwable
handleLocalWrite
protected Object handleLocalWrite(InvocationContext ctx,
WriteCommand command,
org.infinispan.interceptors.distribution.BaseDistributionInterceptor.RecipientGenerator rg,
boolean skipL1Invalidation,
boolean sync)
throws Throwable
- Overrides:
handleLocalWrite
in class NonTxDistributionInterceptor
- Throws:
Throwable
handleRemoteWrite
protected void handleRemoteWrite(InvocationContext ctx,
WriteCommand command,
org.infinispan.interceptors.distribution.BaseDistributionInterceptor.RecipientGenerator recipientGenerator,
boolean skipL1Invalidation,
boolean sync)
throws Throwable
- Overrides:
handleRemoteWrite
in class NonTxDistributionInterceptor
- Throws:
Throwable
Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.