Package org.infinispan.interceptors.impl
Class RetryingEntryWrappingInterceptor
- java.lang.Object
-
- org.infinispan.interceptors.BaseAsyncInterceptor
-
- org.infinispan.interceptors.DDAsyncInterceptor
-
- org.infinispan.interceptors.impl.EntryWrappingInterceptor
-
- org.infinispan.interceptors.impl.RetryingEntryWrappingInterceptor
-
- All Implemented Interfaces:
Visitor
,AsyncInterceptor
- Direct Known Subclasses:
BiasedEntryWrappingInterceptor
public class RetryingEntryWrappingInterceptor extends EntryWrappingInterceptor
Used in @{link org.infinispan.configuration.cache.CacheMode#SCATTERED_SYNC scattered cache} The commit is executed inScatteredDistributionInterceptor
before replicating the change from primary owner. When theScatteredDistributionInterceptor
throws aConcurrentChangeException
during single-key command processing, we know that the entry has not been committed and can safely remove the whole entry from context and retry. When the command processes multiple keys, some of the entries might be already committed. Therefore we have to keep the original value in aRepeatableReadEntry
and for committed entries we only reset the value before retry (we assume that the outcome of an operation is deterministic). The non-committed entries are removed and re-wrapped as in the single-key case.- Author:
- Radim Vansa <rvansa@redhat.com>
-
-
Field Summary
-
Fields inherited from class org.infinispan.interceptors.impl.EntryWrappingInterceptor
cdl, distributionManager
-
Fields inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
cacheConfiguration
-
-
Constructor Summary
Constructors Constructor Description RetryingEntryWrappingInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object
setSkipRemoteGetsAndInvokeNextForDataCommand(InvocationContext ctx, org.infinispan.commands.write.DataWriteCommand command, CompletionStage<Void> delay)
Locks the value for the keys accessed by the command to avoid being override from a remote get.protected Object
setSkipRemoteGetsAndInvokeNextForManyEntriesCommand(InvocationContext ctx, org.infinispan.commands.write.WriteCommand command, CompletionStage<Void> delay)
Locks the value for the keys accessed by the command to avoid being override from a remote get.-
Methods inherited from class org.infinispan.interceptors.impl.EntryWrappingInterceptor
canRead, canReadKey, commitContextEntries, commitContextEntry, shouldCommitDuringPrepare, start, visitClearCommand, visitCommitCommand, visitComputeCommand, visitComputeIfAbsentCommand, visitEvictCommand, visitGetAllCommand, visitGetCacheEntryCommand, visitGetKeysInGroupCommand, visitGetKeyValueCommand, visitInvalidateCommand, visitInvalidateL1Command, visitPrepareCommand, visitPutKeyValueCommand, visitPutMapCommand, visitReadOnlyKeyCommand, visitReadOnlyManyCommand, visitReadWriteKeyCommand, visitReadWriteKeyValueCommand, visitReadWriteManyCommand, visitReadWriteManyEntriesCommand, visitRemoveCommand, visitRemoveExpiredCommand, visitReplaceCommand, visitWriteOnlyKeyCommand, visitWriteOnlyKeyValueCommand, visitWriteOnlyManyCommand, visitWriteOnlyManyEntriesCommand, wrapEntriesForPrepareAndApply
-
Methods inherited from class org.infinispan.interceptors.DDAsyncInterceptor
handleDefault, visitCommand, visitDistributedExecuteCommand, visitEntrySetCommand, visitKeySetCommand, visitLockControlCommand, visitRollbackCommand, visitSizeCommand, 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
-
-
-
-
Method Detail
-
setSkipRemoteGetsAndInvokeNextForDataCommand
protected Object setSkipRemoteGetsAndInvokeNextForDataCommand(InvocationContext ctx, org.infinispan.commands.write.DataWriteCommand command, CompletionStage<Void> delay)
Description copied from class:EntryWrappingInterceptor
Locks the value for the keys accessed by the command to avoid being override from a remote get.- Overrides:
setSkipRemoteGetsAndInvokeNextForDataCommand
in classEntryWrappingInterceptor
-
setSkipRemoteGetsAndInvokeNextForManyEntriesCommand
protected Object setSkipRemoteGetsAndInvokeNextForManyEntriesCommand(InvocationContext ctx, org.infinispan.commands.write.WriteCommand command, CompletionStage<Void> delay)
Description copied from class:EntryWrappingInterceptor
Locks the value for the keys accessed by the command to avoid being override from a remote get.- Overrides:
setSkipRemoteGetsAndInvokeNextForManyEntriesCommand
in classEntryWrappingInterceptor
-
-