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:
org.infinispan.commands.Visitor,AsyncInterceptor
- Direct Known Subclasses:
NonTxDistributionInterceptor,TriangleDistributionInterceptor,TxDistributionInterceptor
public abstract class BaseDistributionInterceptor extends org.infinispan.interceptors.impl.ClusteringInterceptorBase class for distribution of entries across a cluster.- Author:
- Manik Surtani, Mircea.Markus@jboss.com, Pete Muir, Dan Berindei <dan@infinispan.org>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interfaceBaseDistributionInterceptor.ReadManyCommandHelper<C>protected classBaseDistributionInterceptor.ReadOnlyManyHelper
-
Field Summary
Fields Modifier and Type Field Description protected org.infinispan.expiration.impl.InternalExpirationManager<Object,Object>expirationManagerprotected booleanisL1Enabledprotected booleanisReplicatedprotected KeyPartitionerkeyPartitionerprotected RemoteValueRetrievedListenerrvrlprotected TimeServicetimeService-
Fields inherited from class org.infinispan.interceptors.impl.ClusteringInterceptor
cf, dataContainer, distributionManager, entryFactory, lockManager
-
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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected LocalizedCacheTopologycheckTopologyId(org.infinispan.commands.TopologyAffectedCommand command)voidconfigure()protected org.infinispan.util.logging.LoggetLog()protected <C extends org.infinispan.commands.TopologyAffectedCommand & org.infinispan.commands.FlagAffectedCommand>
ObjecthandleFunctionalReadManyCommand(InvocationContext ctx, C command, BaseDistributionInterceptor.ReadManyCommandHelper<C> helper)protected ObjecthandleNonTxWriteCommand(InvocationContext ctx, org.infinispan.commands.write.AbstractDataWriteCommand command)protected voidhandleRemotelyRetrievedKeys(InvocationContext ctx, org.infinispan.commands.write.WriteCommand appliedCommand, List<?> remoteKeys)protected ObjectinvokeRemotely(InvocationContext ctx, org.infinispan.commands.write.DataWriteCommand command, Address primaryOwner)protected booleanreadNeedsRemoteValue(org.infinispan.commands.FlagAffectedCommand command)protected <C extends org.infinispan.commands.FlagAffectedCommand & org.infinispan.commands.TopologyAffectedCommand>
CompletionStage<Void>remoteGetMany(InvocationContext ctx, C command, Collection<?> keys)protected <C extends org.infinispan.commands.FlagAffectedCommand & org.infinispan.commands.TopologyAffectedCommand>
CompletionStage<Void>remoteGetSingleKey(InvocationContext ctx, C command, Object key, boolean isWrite)Fetch a key from its remote owners and store it in the context.protected org.infinispan.commands.functional.ReadOnlyKeyCommandremoteReadOnlyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyKeyCommand command)protected DistributionInforetrieveDistributionInfo(LocalizedCacheTopology topology, org.infinispan.commands.ReplicableCommand command, Object key)protected Object[]unwrapFunctionalManyResultOnOrigin(InvocationContext ctx, List<Object> keys, Object responseValue)protected ObjectunwrapFunctionalResultOnOrigin(InvocationContext ctx, Object key, Object responseValue)ObjectvisitClearCommand(InvocationContext ctx, org.infinispan.commands.write.ClearCommand command)ObjectvisitGetAllCommand(InvocationContext ctx, org.infinispan.commands.read.GetAllCommand command)ObjectvisitGetCacheEntryCommand(InvocationContext ctx, org.infinispan.commands.read.GetCacheEntryCommand command)ObjectvisitGetKeysInGroupCommand(InvocationContext ctx, org.infinispan.commands.remote.GetKeysInGroupCommand command)ObjectvisitGetKeyValueCommand(InvocationContext ctx, org.infinispan.commands.read.GetKeyValueCommand command)ObjectvisitReadOnlyKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyKeyCommand command)ObjectvisitReadOnlyManyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyManyCommand command)ObjectvisitSizeCommand(InvocationContext ctx, org.infinispan.commands.read.SizeCommand command)protected ObjectwrapFunctionalManyResultOnNonOrigin(InvocationContext rCtx, Collection<?> keys, Object[] values)protected ObjectwrapFunctionalResultOnNonOriginOnReturn(Object rv, CacheEntry entry)protected voidwrapRemoteEntry(InvocationContext ctx, Object key, CacheEntry ice, boolean isWrite)-
Methods inherited from class org.infinispan.interceptors.impl.ClusteringInterceptor
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, asyncInvokeNext, asyncValue, delayedValue, delayedValue, invokeNext, invokeNextAndExceptionally, invokeNextAndFinally, invokeNextAndHandle, invokeNextThenAccept, invokeNextThenApply, isSuccessfullyDone, makeStage, setNextInterceptor, valueOrException
-
-
-
-
Field Detail
-
rvrl
protected RemoteValueRetrievedListener rvrl
-
keyPartitioner
protected KeyPartitioner keyPartitioner
-
timeService
protected TimeService timeService
-
expirationManager
protected org.infinispan.expiration.impl.InternalExpirationManager<Object,Object> expirationManager
-
isL1Enabled
protected boolean isL1Enabled
-
isReplicated
protected boolean isReplicated
-
-
Method Detail
-
getLog
protected org.infinispan.util.logging.Log getLog()
- Specified by:
getLogin classorg.infinispan.interceptors.impl.BaseRpcInterceptor
-
configure
public void configure()
-
visitSizeCommand
public Object visitSizeCommand(InvocationContext ctx, org.infinispan.commands.read.SizeCommand command) throws Throwable
- Specified by:
visitSizeCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitSizeCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitGetKeysInGroupCommand
public final Object visitGetKeysInGroupCommand(InvocationContext ctx, org.infinispan.commands.remote.GetKeysInGroupCommand command) throws Throwable
- Specified by:
visitGetKeysInGroupCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitGetKeysInGroupCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitClearCommand
public final Object visitClearCommand(InvocationContext ctx, org.infinispan.commands.write.ClearCommand command) throws Throwable
- Specified by:
visitClearCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitClearCommandin classDDAsyncInterceptor- Throws:
Throwable
-
retrieveDistributionInfo
protected DistributionInfo retrieveDistributionInfo(LocalizedCacheTopology topology, org.infinispan.commands.ReplicableCommand command, Object key)
-
remoteGetSingleKey
protected <C extends org.infinispan.commands.FlagAffectedCommand & org.infinispan.commands.TopologyAffectedCommand> CompletionStage<Void> remoteGetSingleKey(InvocationContext ctx, C command, Object key, boolean isWrite)
Fetch a key from its remote owners and store it in the context. Not thread-safe. The invocation context should not be accessed concurrently from multiple threads, so this method should only be used for single-key commands.
-
wrapRemoteEntry
protected void wrapRemoteEntry(InvocationContext ctx, Object key, CacheEntry ice, boolean isWrite)
-
handleNonTxWriteCommand
protected final Object handleNonTxWriteCommand(InvocationContext ctx, org.infinispan.commands.write.AbstractDataWriteCommand command) throws Throwable
- Throws:
Throwable
-
checkTopologyId
protected LocalizedCacheTopology checkTopologyId(org.infinispan.commands.TopologyAffectedCommand command)
-
visitGetAllCommand
public Object visitGetAllCommand(InvocationContext ctx, org.infinispan.commands.read.GetAllCommand command) throws Throwable
- Specified by:
visitGetAllCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitGetAllCommandin classDDAsyncInterceptor- Throws:
Throwable
-
remoteGetMany
protected <C extends org.infinispan.commands.FlagAffectedCommand & org.infinispan.commands.TopologyAffectedCommand> CompletionStage<Void> remoteGetMany(InvocationContext ctx, C command, Collection<?> keys)
-
handleRemotelyRetrievedKeys
protected void handleRemotelyRetrievedKeys(InvocationContext ctx, org.infinispan.commands.write.WriteCommand appliedCommand, List<?> remoteKeys)
-
visitReadOnlyManyCommand
public Object visitReadOnlyManyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyManyCommand command) throws Throwable
- Specified by:
visitReadOnlyManyCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitReadOnlyManyCommandin classDDAsyncInterceptor- Throws:
Throwable
-
handleFunctionalReadManyCommand
protected <C extends org.infinispan.commands.TopologyAffectedCommand & org.infinispan.commands.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, org.infinispan.commands.read.GetKeyValueCommand command) throws Throwable
- Specified by:
visitGetKeyValueCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitGetKeyValueCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitGetCacheEntryCommand
public Object visitGetCacheEntryCommand(InvocationContext ctx, org.infinispan.commands.read.GetCacheEntryCommand command) throws Throwable
- Specified by:
visitGetCacheEntryCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitGetCacheEntryCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitReadOnlyKeyCommand
public Object visitReadOnlyKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyKeyCommand command) throws Throwable
- Specified by:
visitReadOnlyKeyCommandin interfaceorg.infinispan.commands.Visitor- Overrides:
visitReadOnlyKeyCommandin classDDAsyncInterceptor- Throws:
Throwable
-
remoteReadOnlyCommand
protected org.infinispan.commands.functional.ReadOnlyKeyCommand remoteReadOnlyCommand(InvocationContext ctx, org.infinispan.commands.functional.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, org.infinispan.commands.write.DataWriteCommand command, Address primaryOwner)
-
readNeedsRemoteValue
protected boolean readNeedsRemoteValue(org.infinispan.commands.FlagAffectedCommand command)
- Returns:
trueif 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.
-
-