Package org.infinispan.interceptors.impl
Class BaseStateTransferInterceptor
- java.lang.Object
-
- org.infinispan.interceptors.BaseAsyncInterceptor
-
- org.infinispan.interceptors.DDAsyncInterceptor
-
- org.infinispan.interceptors.impl.BaseStateTransferInterceptor
-
- All Implemented Interfaces:
Visitor
,AsyncInterceptor
- Direct Known Subclasses:
StateTransferInterceptor
,TotalOrderStateTransferInterceptor
public abstract class BaseStateTransferInterceptor extends DDAsyncInterceptor
A base class for a state transfer interceptor. It contains the base code to avoid duplicating in the two current different implementations. Also, it has some utilities methods with the most common logic.- Since:
- 9.0
- Author:
- Pedro Ruivo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
BaseStateTransferInterceptor.LostDataVisitor
-
Field Summary
Fields Modifier and Type Field Description protected StateTransferLock
stateTransferLock
-
Fields inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
cacheConfiguration
-
-
Constructor Summary
Constructors Constructor Description BaseStateTransferInterceptor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected int
currentTopologyId()
protected abstract Log
getLog()
protected int
getNewTopologyId(Throwable ce, int currentTopologyId, TopologyAffectedCommand command)
protected <C extends VisitableCommand & TopologyAffectedCommand & FlagAffectedCommand>
ObjecthandleReadCommand(InvocationContext ctx, C command)
protected void
logRetry(int currentTopologyId, TopologyAffectedCommand cmd)
protected <T extends VisitableCommand>
ObjectretryWhenDone(CompletableFuture<Void> future, int topologyId, InvocationContext ctx, T command, InvocationFinallyFunction callback)
void
start()
protected void
updateTopologyId(TopologyAffectedCommand command)
Object
visitGetAllCommand(InvocationContext ctx, org.infinispan.commands.read.GetAllCommand command)
Object
visitGetCacheEntryCommand(InvocationContext ctx, org.infinispan.commands.read.GetCacheEntryCommand command)
Object
visitGetKeysInGroupCommand(InvocationContext ctx, org.infinispan.commands.remote.GetKeysInGroupCommand command)
Object
visitGetKeyValueCommand(InvocationContext ctx, org.infinispan.commands.read.GetKeyValueCommand command)
Object
visitReadOnlyKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyKeyCommand command)
Object
visitReadOnlyManyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyManyCommand command)
-
Methods inherited from class org.infinispan.interceptors.DDAsyncInterceptor
handleDefault, visitClearCommand, visitCommand, visitCommitCommand, visitComputeCommand, visitComputeIfAbsentCommand, visitDistributedExecuteCommand, visitEntrySetCommand, visitEvictCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitLockControlCommand, visitPrepareCommand, visitPutKeyValueCommand, visitPutMapCommand, visitReadWriteKeyCommand, visitReadWriteKeyValueCommand, visitReadWriteManyCommand, visitReadWriteManyEntriesCommand, visitRemoveCommand, visitReplaceCommand, visitRollbackCommand, visitSizeCommand, visitUnknownCommand, visitWriteOnlyKeyCommand, visitWriteOnlyKeyValueCommand, visitWriteOnlyManyCommand, visitWriteOnlyManyEntriesCommand
-
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
-
-
-
-
Field Detail
-
stateTransferLock
protected StateTransferLock stateTransferLock
-
-
Method Detail
-
start
public void start()
-
visitGetKeysInGroupCommand
public Object visitGetKeysInGroupCommand(InvocationContext ctx, org.infinispan.commands.remote.GetKeysInGroupCommand command) throws Throwable
- Specified by:
visitGetKeysInGroupCommand
in interfaceVisitor
- Overrides:
visitGetKeysInGroupCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
logRetry
protected final void logRetry(int currentTopologyId, TopologyAffectedCommand cmd)
-
currentTopologyId
protected final int currentTopologyId()
-
updateTopologyId
protected final void updateTopologyId(TopologyAffectedCommand command)
-
retryWhenDone
protected <T extends VisitableCommand> Object retryWhenDone(CompletableFuture<Void> future, int topologyId, InvocationContext ctx, T command, InvocationFinallyFunction callback)
-
visitGetKeyValueCommand
public Object visitGetKeyValueCommand(InvocationContext ctx, org.infinispan.commands.read.GetKeyValueCommand command) throws Throwable
- Specified by:
visitGetKeyValueCommand
in interfaceVisitor
- Overrides:
visitGetKeyValueCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitGetCacheEntryCommand
public Object visitGetCacheEntryCommand(InvocationContext ctx, org.infinispan.commands.read.GetCacheEntryCommand command) throws Throwable
- Specified by:
visitGetCacheEntryCommand
in interfaceVisitor
- Overrides:
visitGetCacheEntryCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitGetAllCommand
public Object visitGetAllCommand(InvocationContext ctx, org.infinispan.commands.read.GetAllCommand command) throws Throwable
- Specified by:
visitGetAllCommand
in interfaceVisitor
- Overrides:
visitGetAllCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
handleReadCommand
protected <C extends VisitableCommand & TopologyAffectedCommand & FlagAffectedCommand> Object handleReadCommand(InvocationContext ctx, C command)
-
getNewTopologyId
protected int getNewTopologyId(Throwable ce, int currentTopologyId, TopologyAffectedCommand command)
-
visitReadOnlyKeyCommand
public Object visitReadOnlyKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyKeyCommand command) throws Throwable
- Specified by:
visitReadOnlyKeyCommand
in interfaceVisitor
- Overrides:
visitReadOnlyKeyCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitReadOnlyManyCommand
public Object visitReadOnlyManyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyManyCommand command) throws Throwable
- Specified by:
visitReadOnlyManyCommand
in interfaceVisitor
- Overrides:
visitReadOnlyManyCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
getLog
protected abstract Log getLog()
-
-