Class ScatteredDistributionInterceptor
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.ScatteredDistributionInterceptor
- All Implemented Interfaces:
Visitor,AsyncInterceptor
- Direct Known Subclasses:
BiasedScatteredDistributionInterceptor
This interceptor mixes several functions:
A) replicates changes to other nodes
B) commits the entry
C) schedules invalidation
On primary owner, the commit is executed before the change is replicated to other node. If the command
reads previous value and the version of entry in
DataContainer has changed
during execution ConcurrentChangeException is thrown and the command has to be retried.- Author:
- Radim Vansa <rvansa@redhat.com>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected classNested classes/interfaces inherited from class org.infinispan.interceptors.impl.ClusteringInterceptor
ClusteringInterceptor.ClusteredGetAllFuture -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CacheNotifierprotected FunctionalNotifierprotected GroupManagerprotected KeyPartitionerprotected ScatteredVersionManager<Object>protected org.infinispan.commons.time.TimeServiceFields inherited from class org.infinispan.interceptors.impl.ClusteringInterceptor
cf, dataContainer, distributionManager, entryFactory, lockManagerFields inherited from class org.infinispan.interceptors.impl.BaseRpcInterceptor
componentRegistry, defaultSynchronous, rpcManagerFields inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
cacheConfiguration -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcompleteManyWriteOnPrimaryOriginator(WriteCommand command, Address backup, org.infinispan.interceptors.distribution.CountDownCompletableFuture future) This is a hook for bias-enabled mode where the primary performs additional RPCs but replication to another node.protected CompletionStage<?>completeSingleWriteOnPrimaryOriginator(DataWriteCommand command, Address backup, CompletionStage<?> rpcFuture) This is a hook for bias-enabled mode where the primary performs additional RPCs but replication to another node.protected <C extends WriteCommand>
CommandAckCollector.MultiTargetCollectorcreateMultiTargetCollector(C command, int primaries) protected LoggetLog()protected ObjecthandleClear(InvocationContext ctx, ClearCommand command, Object ignored) protected CompletionStage<ValidResponse>manyWriteOnRemotePrimary(Address target, WriteCommand command, CommandAckCollector.MultiTargetCollector multiTargetCollector) protected ObjectmanyWriteResponse(InvocationContext ctx, WriteCommand cmd, Object returnValue) protected voidscheduleKeyInvalidation(Object key, EntryVersion nextVersion, boolean removed) protected CompletionStage<ValidResponse>singleWriteOnRemotePrimary(Address target, DataWriteCommand command) This method is called by a non-owner sending write request to the primary ownerprotected ObjectsingleWriteResponse(InvocationContext ctx, DataWriteCommand cmd, Object returnValue) This method is called by primary owner responding to the originator after write has been completedvoidstart()visitClearCommand(InvocationContext ctx, ClearCommand command) visitComputeCommand(InvocationContext ctx, ComputeCommand command) visitEvictCommand(InvocationContext ctx, EvictCommand command) visitGetAllCommand(InvocationContext ctx, GetAllCommand command) visitGetCacheEntryCommand(InvocationContext ctx, GetCacheEntryCommand command) visitGetKeyValueCommand(InvocationContext ctx, GetKeyValueCommand command) visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) visitPutMapCommand(InvocationContext ctx, PutMapCommand command) visitReadOnlyKeyCommand(InvocationContext ctx, ReadOnlyKeyCommand command) visitReadOnlyManyCommand(InvocationContext ctx, ReadOnlyManyCommand command) visitReadWriteKeyCommand(InvocationContext ctx, ReadWriteKeyCommand command) visitReadWriteManyCommand(InvocationContext ctx, ReadWriteManyCommand command) visitRemoveCommand(InvocationContext ctx, RemoveCommand command) visitReplaceCommand(InvocationContext ctx, ReplaceCommand command) visitWriteOnlyKeyCommand(InvocationContext ctx, WriteOnlyKeyCommand command) visitWriteOnlyManyCommand(InvocationContext ctx, WriteOnlyManyCommand command) Methods inherited from class org.infinispan.interceptors.impl.ClusteringInterceptor
getCacheTopology, getSuccessfulResponseOrFail, init, unexpected, visitSizeCommand, visitTouchCommandMethods inherited from class org.infinispan.interceptors.impl.BaseRpcInterceptor
isLocalModeForced, isSynchronous, shouldInvokeRemoteTxCommand, shouldLoad, transactionRemotelyPreparedMethods inherited from class org.infinispan.interceptors.DDAsyncInterceptor
handleDefault, visitCommand, visitCommitCommand, visitEntrySetCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitLockControlCommand, visitPrepareCommand, visitRollbackCommand, visitUnknownCommandMethods inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
asyncInvokeNext, asyncInvokeNext, asyncInvokeNext, asyncValue, delayedNull, delayedValue, delayedValue, invokeNext, invokeNextAndExceptionally, invokeNextAndFinally, invokeNextAndHandle, invokeNextThenAccept, invokeNextThenApply, isSuccessfullyDone, makeStage, setNextInterceptor, valueOrExceptionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.infinispan.commands.Visitor
visitRemoveExpiredCommand
-
Field Details
-
svm
-
groupManager
-
timeService
protected org.infinispan.commons.time.TimeService timeService -
cacheNotifier
-
functionalNotifier
-
keyPartitioner
-
-
Constructor Details
-
ScatteredDistributionInterceptor
public ScatteredDistributionInterceptor()
-
-
Method Details
-
start
public void start() -
visitEvictCommand
- Specified by:
visitEvictCommandin interfaceVisitor- Overrides:
visitEvictCommandin classDDAsyncInterceptor
-
singleWriteOnRemotePrimary
protected CompletionStage<ValidResponse> singleWriteOnRemotePrimary(Address target, DataWriteCommand command) This method is called by a non-owner sending write request to the primary owner -
manyWriteOnRemotePrimary
protected CompletionStage<ValidResponse> manyWriteOnRemotePrimary(Address target, WriteCommand command, CommandAckCollector.MultiTargetCollector multiTargetCollector) -
completeSingleWriteOnPrimaryOriginator
protected CompletionStage<?> completeSingleWriteOnPrimaryOriginator(DataWriteCommand command, Address backup, CompletionStage<?> rpcFuture) This is a hook for bias-enabled mode where the primary performs additional RPCs but replication to another node. The returned CF will be complete when both the providedrpcFuturecompletes and all additional RPCs are complete, too. Failure in any of the RPCs will fail this future. -
scheduleKeyInvalidation
-
visitPutKeyValueCommand
public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable - Specified by:
visitPutKeyValueCommandin interfaceVisitor- Overrides:
visitPutKeyValueCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitIracPutKeyValueCommand
public Object visitIracPutKeyValueCommand(InvocationContext ctx, IracPutKeyValueCommand command) throws Throwable - Specified by:
visitIracPutKeyValueCommandin interfaceVisitor- Overrides:
visitIracPutKeyValueCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitRemoveCommand
- Specified by:
visitRemoveCommandin interfaceVisitor- Overrides:
visitRemoveCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitReplaceCommand
- Specified by:
visitReplaceCommandin interfaceVisitor- Overrides:
visitReplaceCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitComputeIfAbsentCommand
public Object visitComputeIfAbsentCommand(InvocationContext ctx, ComputeIfAbsentCommand command) throws Throwable - Specified by:
visitComputeIfAbsentCommandin interfaceVisitor- Overrides:
visitComputeIfAbsentCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitComputeCommand
- Specified by:
visitComputeCommandin interfaceVisitor- Overrides:
visitComputeCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitPutMapCommand
- Specified by:
visitPutMapCommandin interfaceVisitor- Overrides:
visitPutMapCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitGetKeyValueCommand
public Object visitGetKeyValueCommand(InvocationContext ctx, GetKeyValueCommand command) throws Throwable - Specified by:
visitGetKeyValueCommandin interfaceVisitor- Overrides:
visitGetKeyValueCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitGetCacheEntryCommand
public Object visitGetCacheEntryCommand(InvocationContext ctx, GetCacheEntryCommand command) throws Throwable - Specified by:
visitGetCacheEntryCommandin interfaceVisitor- Overrides:
visitGetCacheEntryCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitGetAllCommand
- Specified by:
visitGetAllCommandin interfaceVisitor- Overrides:
visitGetAllCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitClearCommand
- Specified by:
visitClearCommandin interfaceVisitor- Overrides:
visitClearCommandin classDDAsyncInterceptor- Throws:
Throwable
-
handleClear
-
visitReadOnlyKeyCommand
public Object visitReadOnlyKeyCommand(InvocationContext ctx, ReadOnlyKeyCommand command) throws Throwable - Specified by:
visitReadOnlyKeyCommandin interfaceVisitor- Overrides:
visitReadOnlyKeyCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitReadOnlyManyCommand
public Object visitReadOnlyManyCommand(InvocationContext ctx, ReadOnlyManyCommand command) throws Throwable - Specified by:
visitReadOnlyManyCommandin interfaceVisitor- Overrides:
visitReadOnlyManyCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitWriteOnlyKeyCommand
public Object visitWriteOnlyKeyCommand(InvocationContext ctx, WriteOnlyKeyCommand command) throws Throwable - Specified by:
visitWriteOnlyKeyCommandin interfaceVisitor- Overrides:
visitWriteOnlyKeyCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitReadWriteKeyValueCommand
public Object visitReadWriteKeyValueCommand(InvocationContext ctx, ReadWriteKeyValueCommand command) throws Throwable - Specified by:
visitReadWriteKeyValueCommandin interfaceVisitor- Overrides:
visitReadWriteKeyValueCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitReadWriteKeyCommand
public Object visitReadWriteKeyCommand(InvocationContext ctx, ReadWriteKeyCommand command) throws Throwable - Specified by:
visitReadWriteKeyCommandin interfaceVisitor- Overrides:
visitReadWriteKeyCommandin classDDAsyncInterceptor- Throws:
Throwable
-
createMultiTargetCollector
protected <C extends WriteCommand> CommandAckCollector.MultiTargetCollector createMultiTargetCollector(C command, int primaries) -
visitWriteOnlyManyEntriesCommand
public Object visitWriteOnlyManyEntriesCommand(InvocationContext ctx, WriteOnlyManyEntriesCommand command) throws Throwable - Specified by:
visitWriteOnlyManyEntriesCommandin interfaceVisitor- Overrides:
visitWriteOnlyManyEntriesCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitWriteOnlyKeyValueCommand
public Object visitWriteOnlyKeyValueCommand(InvocationContext ctx, WriteOnlyKeyValueCommand command) throws Throwable - Specified by:
visitWriteOnlyKeyValueCommandin interfaceVisitor- Overrides:
visitWriteOnlyKeyValueCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitWriteOnlyManyCommand
public Object visitWriteOnlyManyCommand(InvocationContext ctx, WriteOnlyManyCommand command) throws Throwable - Specified by:
visitWriteOnlyManyCommandin interfaceVisitor- Overrides:
visitWriteOnlyManyCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitReadWriteManyCommand
public Object visitReadWriteManyCommand(InvocationContext ctx, ReadWriteManyCommand command) throws Throwable - Specified by:
visitReadWriteManyCommandin interfaceVisitor- Overrides:
visitReadWriteManyCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitReadWriteManyEntriesCommand
public Object visitReadWriteManyEntriesCommand(InvocationContext ctx, ReadWriteManyEntriesCommand command) throws Throwable - Specified by:
visitReadWriteManyEntriesCommandin interfaceVisitor- Overrides:
visitReadWriteManyEntriesCommandin classDDAsyncInterceptor- Throws:
Throwable
-
getLog
- Specified by:
getLogin classBaseRpcInterceptor
-
singleWriteResponse
protected Object singleWriteResponse(InvocationContext ctx, DataWriteCommand cmd, Object returnValue) This method is called by primary owner responding to the originator after write has been completed -
manyWriteResponse
-
completeManyWriteOnPrimaryOriginator
protected void completeManyWriteOnPrimaryOriginator(WriteCommand command, Address backup, org.infinispan.interceptors.distribution.CountDownCompletableFuture future) This is a hook for bias-enabled mode where the primary performs additional RPCs but replication to another node. Implementation is expected to incrementfutureon each additional RPC and decrement it when the response arrives.
-