Class BaseDistributionInterceptor
- 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
-
- All Implemented Interfaces:
Visitor
,AsyncInterceptor
- Direct Known Subclasses:
NonTxDistributionInterceptor
,TriangleDistributionInterceptor
,TxDistributionInterceptor
public abstract class BaseDistributionInterceptor extends ClusteringInterceptor
Base class for distribution of entries across a cluster.- Author:
- Manik Surtani, Mircea.Markus@jboss.com, Pete Muir, Dan Berindei
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interface
BaseDistributionInterceptor.ReadManyCommandHelper<C>
protected class
BaseDistributionInterceptor.ReadOnlyManyHelper
protected static interface
BaseDistributionInterceptor.RemoteGetAllHandler
-
Nested classes/interfaces inherited from class org.infinispan.interceptors.impl.ClusteringInterceptor
ClusteringInterceptor.ClusteredGetAllFuture
-
-
Field Summary
Fields Modifier and Type Field Description protected InternalExpirationManager<Object,Object>
expirationManager
protected boolean
isL1Enabled
protected boolean
isReplicated
protected KeyPartitioner
keyPartitioner
protected RemoteValueRetrievedListener
rvrl
protected TimeService
timeService
-
Fields inherited from class org.infinispan.interceptors.impl.ClusteringInterceptor
cf, dataContainer, distributionManager, entryFactory, lockManager, stateTransferManager
-
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 BaseDistributionInterceptor()
-
Method Summary
-
Methods inherited from class org.infinispan.interceptors.impl.ClusteringInterceptor
getSingleResponse, 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, visitComputeCommand, visitComputeIfAbsentCommand, visitDistributedExecuteCommand, visitEntrySetCommand, visitEvictCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitLockControlCommand, visitPrepareCommand, visitPutKeyValueCommand, visitPutMapCommand, visitReadWriteKeyCommand, visitReadWriteKeyValueCommand, visitReadWriteManyCommand, visitReadWriteManyEntriesCommand, visitRemoveCommand, visitReplaceCommand, visitRollbackCommand, visitUnknownCommand, visitWriteOnlyKeyCommand, visitWriteOnlyKeyValueCommand, visitWriteOnlyManyCommand, visitWriteOnlyManyEntriesCommand
-
Methods inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
asyncInvokeNext, asyncInvokeNext, asyncValue, 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
-
-
-
-
Field Detail
-
rvrl
protected RemoteValueRetrievedListener rvrl
-
keyPartitioner
protected KeyPartitioner keyPartitioner
-
timeService
protected TimeService timeService
-
expirationManager
protected InternalExpirationManager<Object,Object> expirationManager
-
isL1Enabled
protected boolean isL1Enabled
-
isReplicated
protected boolean isReplicated
-
-
Method Detail
-
getLog
protected Log getLog()
- Specified by:
getLog
in classBaseRpcInterceptor
-
configure
public void configure()
-
visitSizeCommand
public Object visitSizeCommand(InvocationContext ctx, SizeCommand command) throws Throwable
- Specified by:
visitSizeCommand
in interfaceVisitor
- Overrides:
visitSizeCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitGetKeysInGroupCommand
public final Object visitGetKeysInGroupCommand(InvocationContext ctx, GetKeysInGroupCommand command) throws Throwable
- Specified by:
visitGetKeysInGroupCommand
in interfaceVisitor
- Overrides:
visitGetKeysInGroupCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitClearCommand
public final Object visitClearCommand(InvocationContext ctx, ClearCommand command) throws Throwable
- Specified by:
visitClearCommand
in interfaceVisitor
- Overrides:
visitClearCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
retrieveDistributionInfo
protected DistributionInfo retrieveDistributionInfo(LocalizedCacheTopology topology, ReplicableCommand command, Object key)
-
remoteGet
protected <C extends FlagAffectedCommand & TopologyAffectedCommand> CompletionStage<Void> remoteGet(InvocationContext ctx, C command, Object key, boolean isWrite)
-
handleMissingSuccessfulResponse
protected static org.infinispan.commons.CacheException handleMissingSuccessfulResponse(Response response)
-
wrapRemoteEntry
protected void wrapRemoteEntry(InvocationContext ctx, Object key, CacheEntry ice, boolean isWrite)
-
handleNonTxWriteCommand
protected final Object handleNonTxWriteCommand(InvocationContext ctx, AbstractDataWriteCommand command) throws Throwable
- Throws:
Throwable
-
checkTopologyId
protected LocalizedCacheTopology checkTopologyId(TopologyAffectedCommand command)
-
visitGetAllCommand
public Object visitGetAllCommand(InvocationContext ctx, GetAllCommand command) throws Throwable
- Specified by:
visitGetAllCommand
in interfaceVisitor
- Overrides:
visitGetAllCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
remoteGetAll
protected <C extends FlagAffectedCommand & TopologyAffectedCommand> CompletableFuture<Void> remoteGetAll(InvocationContext ctx, C command, Collection<?> keys, BaseDistributionInterceptor.RemoteGetAllHandler remoteGetAllHandler)
-
handleRemotelyRetrievedKeys
protected void handleRemotelyRetrievedKeys(InvocationContext ctx, List<?> remoteKeys)
-
visitReadOnlyManyCommand
public Object visitReadOnlyManyCommand(InvocationContext ctx, ReadOnlyManyCommand command) throws Throwable
- Specified by:
visitReadOnlyManyCommand
in interfaceVisitor
- Overrides:
visitReadOnlyManyCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
handleFunctionalReadManyCommand
protected <C extends TopologyAffectedCommand & FlagAffectedCommand> Object handleFunctionalReadManyCommand(InvocationContext ctx, C command, BaseDistributionInterceptor.ReadManyCommandHelper<C> helper)
-
wrapFunctionalManyResultOnNonOrigin
protected Object wrapFunctionalManyResultOnNonOrigin(InvocationContext rCtx, Collection<?> keys, Object[] values)
-
unwrapFunctionalManyResultOnOrigin
protected Object[] unwrapFunctionalManyResultOnOrigin(InvocationContext ctx, List<Object> keys, Object responseValue)
-
visitGetKeyValueCommand
public Object visitGetKeyValueCommand(InvocationContext ctx, GetKeyValueCommand command) throws Throwable
- Specified by:
visitGetKeyValueCommand
in interfaceVisitor
- Overrides:
visitGetKeyValueCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitGetCacheEntryCommand
public Object visitGetCacheEntryCommand(InvocationContext ctx, GetCacheEntryCommand command) throws Throwable
- Specified by:
visitGetCacheEntryCommand
in interfaceVisitor
- Overrides:
visitGetCacheEntryCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
visitReadOnlyKeyCommand
public Object visitReadOnlyKeyCommand(InvocationContext ctx, ReadOnlyKeyCommand command) throws Throwable
- Specified by:
visitReadOnlyKeyCommand
in interfaceVisitor
- Overrides:
visitReadOnlyKeyCommand
in classDDAsyncInterceptor
- Throws:
Throwable
-
remoteReadOnlyCommand
protected ReadOnlyKeyCommand remoteReadOnlyCommand(InvocationContext ctx, ReadOnlyKeyCommand command)
-
wrapFunctionalResultOnNonOriginOnReturn
protected Object wrapFunctionalResultOnNonOriginOnReturn(Object rv, CacheEntry entry)
-
unwrapFunctionalResultOnOrigin
protected Object unwrapFunctionalResultOnOrigin(InvocationContext ctx, Object key, Object responseValue)
-
invokeRemotely
protected Object invokeRemotely(InvocationContext ctx, DataWriteCommand command, Address primaryOwner)
-
readNeedsRemoteValue
protected boolean readNeedsRemoteValue(AbstractDataCommand command)
- Returns:
true
if the value is not available on the local node and a read command is allowed to fetch it from a remote node. Does not check if the value is already in the context.
-
visitRemoveExpiredCommand
public Object visitRemoveExpiredCommand(InvocationContext ctx, RemoveExpiredCommand command) throws Throwable
- Throws:
Throwable
-
invokeRemoveExpiredCommand
protected Object invokeRemoveExpiredCommand(InvocationContext ctx, RemoveExpiredCommand command, DistributionInfo distributionInfo) throws Throwable
- Throws:
Throwable
-
-