Package org.infinispan.interceptors.impl
Class DistCacheWriterInterceptor
- java.lang.Object
-
- org.infinispan.interceptors.BaseAsyncInterceptor
-
- org.infinispan.interceptors.DDAsyncInterceptor
-
- org.infinispan.interceptors.impl.JmxStatsCommandInterceptor
-
- org.infinispan.interceptors.impl.CacheWriterInterceptor
-
- org.infinispan.interceptors.impl.DistCacheWriterInterceptor
-
- All Implemented Interfaces:
Visitor,AsyncInterceptor,JmxStatisticsExposer
public class DistCacheWriterInterceptor extends CacheWriterInterceptor
Cache store interceptor specific for the distribution and replication cache modes.If the cache store is shared, only the primary owner of the key writes to the cache store.
If the cache store is not shared, every owner of a key writes to the cache store.
In non-tx caches, if the originator is an owner, the command is executed there twice. The first time, (
isOriginLocal() == true) we don't write anything to the cache store; the second time, the normal rules apply.For clear operations, either only the originator of the command clears the cache store (if it is shared), or every node clears its cache store (if it is not shared). Note that in non-tx caches, this happens without holding a lock on the primary owner of all the keys.
- Since:
- 9.0
- Author:
- Galder ZamarreƱo, Dan Berindei
-
-
Field Summary
-
Fields inherited from class org.infinispan.interceptors.impl.CacheWriterInterceptor
handlePutMapCommandReturn, persistenceManager
-
Fields inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
cacheConfiguration
-
-
Constructor Summary
Constructors Constructor Description DistCacheWriterInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected LoggetLog()protected ObjecthandlePutMapCommandReturn(InvocationContext rCtx, PutMapCommand putMapCommand, Object rv)protected booleanisProperWriter(InvocationContext ctx, FlagAffectedCommand command, Object key)protected booleanskipSharedStores(InvocationContext ctx, Object key, FlagAffectedCommand command)protected voidstart()ObjectvisitComputeCommand(InvocationContext ctx, ComputeCommand command)ObjectvisitComputeIfAbsentCommand(InvocationContext ctx, ComputeIfAbsentCommand command)ObjectvisitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command)ObjectvisitPutMapCommand(InvocationContext ctx, PutMapCommand command)ObjectvisitRemoveCommand(InvocationContext ctx, RemoveCommand command)ObjectvisitReplaceCommand(InvocationContext ctx, ReplaceCommand command)-
Methods inherited from class org.infinispan.interceptors.impl.CacheWriterInterceptor
commitCommand, getNumberOfPersistedEntries, getWritesToTheStores, isStoreEnabled, resetStatistics, store, visitClearCommand, visitCommitCommand, visitPrepareCommand, visitReadWriteKeyCommand, visitReadWriteKeyValueCommand, visitReadWriteManyCommand, visitReadWriteManyEntriesCommand, visitWriteOnlyKeyCommand, visitWriteOnlyKeyValueCommand, visitWriteOnlyManyCommand, visitWriteOnlyManyEntriesCommand
-
Methods inherited from class org.infinispan.interceptors.impl.JmxStatsCommandInterceptor
getStatisticsEnabled, onStart, setStatisticsEnabled
-
Methods inherited from class org.infinispan.interceptors.DDAsyncInterceptor
handleDefault, visitCommand, visitEntrySetCommand, visitEvictCommand, visitGetAllCommand, visitGetCacheEntryCommand, visitGetKeysInGroupCommand, visitGetKeyValueCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitLockControlCommand, visitReadOnlyKeyCommand, visitReadOnlyManyCommand, visitRollbackCommand, visitSizeCommand, visitUnknownCommand
-
Methods inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
asyncInvokeNext, asyncInvokeNext, asyncInvokeNext, asyncValue, delayedNull, 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
visitRemoveExpiredCommand
-
-
-
-
Method Detail
-
getLog
protected Log getLog()
- Overrides:
getLogin classCacheWriterInterceptor
-
start
protected void start()
- Overrides:
startin classCacheWriterInterceptor
-
visitPutKeyValueCommand
public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable
- Specified by:
visitPutKeyValueCommandin interfaceVisitor- Overrides:
visitPutKeyValueCommandin classCacheWriterInterceptor- Throws:
Throwable
-
visitPutMapCommand
public Object visitPutMapCommand(InvocationContext ctx, PutMapCommand command) throws Throwable
- Specified by:
visitPutMapCommandin interfaceVisitor- Overrides:
visitPutMapCommandin classCacheWriterInterceptor- Throws:
Throwable
-
handlePutMapCommandReturn
protected Object handlePutMapCommandReturn(InvocationContext rCtx, PutMapCommand putMapCommand, Object rv)
- Overrides:
handlePutMapCommandReturnin classCacheWriterInterceptor
-
visitRemoveCommand
public Object visitRemoveCommand(InvocationContext ctx, RemoveCommand command) throws Throwable
- Specified by:
visitRemoveCommandin interfaceVisitor- Overrides:
visitRemoveCommandin classCacheWriterInterceptor- Throws:
Throwable
-
visitReplaceCommand
public Object visitReplaceCommand(InvocationContext ctx, ReplaceCommand command) throws Throwable
- Specified by:
visitReplaceCommandin interfaceVisitor- Overrides:
visitReplaceCommandin classCacheWriterInterceptor- Throws:
Throwable
-
visitComputeCommand
public Object visitComputeCommand(InvocationContext ctx, ComputeCommand command) throws Throwable
- Specified by:
visitComputeCommandin interfaceVisitor- Overrides:
visitComputeCommandin classCacheWriterInterceptor- Throws:
Throwable
-
visitComputeIfAbsentCommand
public Object visitComputeIfAbsentCommand(InvocationContext ctx, ComputeIfAbsentCommand command) throws Throwable
- Specified by:
visitComputeIfAbsentCommandin interfaceVisitor- Overrides:
visitComputeIfAbsentCommandin classCacheWriterInterceptor- Throws:
Throwable
-
skipSharedStores
protected boolean skipSharedStores(InvocationContext ctx, Object key, FlagAffectedCommand command)
- Overrides:
skipSharedStoresin classCacheWriterInterceptor
-
isProperWriter
protected boolean isProperWriter(InvocationContext ctx, FlagAffectedCommand command, Object key)
- Overrides:
isProperWriterin classCacheWriterInterceptor
-
-