Package org.infinispan.interceptors.impl
Class CacheWriterInterceptor
java.lang.Object
org.infinispan.interceptors.BaseAsyncInterceptor
org.infinispan.interceptors.DDAsyncInterceptor
org.infinispan.interceptors.impl.JmxStatsCommandInterceptor
org.infinispan.interceptors.impl.CacheWriterInterceptor
- All Implemented Interfaces:
Visitor,AsyncInterceptor,JmxStatisticsExposer
- Direct Known Subclasses:
DistCacheWriterInterceptor,PassivationWriterInterceptor
@MBean(objectName="CacheStore",
description="Component that handles storing of entries to a CacheStore from memory.")
public class CacheWriterInterceptor
extends JmxStatsCommandInterceptor
Writes modifications back to the store on the way out: stores modifications back through the CacheLoader, either
after each method call (no TXs), or at TX commit.
Only used for LOCAL and INVALIDATION caches.
- Since:
- 9.0
- Author:
- Bela Ban, Dan Berindei, Mircea Markus
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final InvocationSuccessFunction<PutMapCommand> protected PersistenceManagerFields inherited from class org.infinispan.interceptors.BaseAsyncInterceptor
cacheConfiguration -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected InvocationStageprotected LoggetLog()intlongprotected ObjecthandlePutMapCommandReturn(InvocationContext rCtx, PutMapCommand putMapCommand, Object rv) protected booleanisProperWriter(InvocationContext ctx, FlagAffectedCommand command, Object key) protected booleanisStoreEnabled(FlagAffectedCommand command) voidResets statistics gathered.protected booleanskipSharedStores(InvocationContext ctx, Object key, FlagAffectedCommand command) protected voidstart()protected InvocationStagevisitClearCommand(InvocationContext ctx, ClearCommand command) visitCommitCommand(TxInvocationContext ctx, CommitCommand command) visitComputeCommand(InvocationContext ctx, ComputeCommand command) visitPrepareCommand(TxInvocationContext ctx, PrepareCommand command) visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) visitPutMapCommand(InvocationContext ctx, PutMapCommand 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.JmxStatsCommandInterceptor
getStatisticsEnabled, onStart, setStatisticsEnabledMethods inherited from class org.infinispan.interceptors.DDAsyncInterceptor
handleDefault, visitCommand, visitEntrySetCommand, visitEvictCommand, visitGetAllCommand, visitGetCacheEntryCommand, visitGetKeyValueCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitLockControlCommand, visitReadOnlyKeyCommand, visitReadOnlyManyCommand, visitRollbackCommand, visitSizeCommand, visitTouchCommand, 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
-
persistenceManager
-
handlePutMapCommandReturn
-
-
Constructor Details
-
CacheWriterInterceptor
public CacheWriterInterceptor()
-
-
Method Details
-
getLog
-
start
protected void start() -
visitCommitCommand
- Specified by:
visitCommitCommandin interfaceVisitor- Overrides:
visitCommitCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitPrepareCommand
- Specified by:
visitPrepareCommandin interfaceVisitor- Overrides:
visitPrepareCommandin classDDAsyncInterceptor- Throws:
Throwable
-
commitModifications
protected InvocationStage commitModifications(TxInvocationContext<AbstractCacheTransaction> ctx) throws Throwable - Throws:
Throwable
-
visitRemoveCommand
- Specified by:
visitRemoveCommandin interfaceVisitor- Overrides:
visitRemoveCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitClearCommand
- Specified by:
visitClearCommandin interfaceVisitor- Overrides:
visitClearCommandin classDDAsyncInterceptor
-
visitPutKeyValueCommand
public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable - Specified by:
visitPutKeyValueCommandin interfaceVisitor- Overrides:
visitPutKeyValueCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitReplaceCommand
- Specified by:
visitReplaceCommandin interfaceVisitor- Overrides:
visitReplaceCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitIracPutKeyValueCommand
- Specified by:
visitIracPutKeyValueCommandin interfaceVisitor- Overrides:
visitIracPutKeyValueCommandin classDDAsyncInterceptor
-
visitComputeCommand
- Specified by:
visitComputeCommandin interfaceVisitor- Overrides:
visitComputeCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitComputeIfAbsentCommand
public Object visitComputeIfAbsentCommand(InvocationContext ctx, ComputeIfAbsentCommand command) throws Throwable - Specified by:
visitComputeIfAbsentCommandin interfaceVisitor- Overrides:
visitComputeIfAbsentCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitPutMapCommand
- Specified by:
visitPutMapCommandin interfaceVisitor- Overrides:
visitPutMapCommandin classDDAsyncInterceptor- Throws:
Throwable
-
handlePutMapCommandReturn
protected Object handlePutMapCommandReturn(InvocationContext rCtx, PutMapCommand putMapCommand, Object rv) -
visitReadWriteKeyCommand
public Object visitReadWriteKeyCommand(InvocationContext ctx, ReadWriteKeyCommand command) throws Throwable - Specified by:
visitReadWriteKeyCommandin interfaceVisitor- Overrides:
visitReadWriteKeyCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitReadWriteKeyValueCommand
public Object visitReadWriteKeyValueCommand(InvocationContext ctx, ReadWriteKeyValueCommand command) throws Throwable - Specified by:
visitReadWriteKeyValueCommandin interfaceVisitor- Overrides:
visitReadWriteKeyValueCommandin classDDAsyncInterceptor- Throws:
Throwable
-
visitWriteOnlyKeyCommand
public Object visitWriteOnlyKeyCommand(InvocationContext ctx, WriteOnlyKeyCommand command) throws Throwable - Specified by:
visitWriteOnlyKeyCommandin interfaceVisitor- Overrides:
visitWriteOnlyKeyCommandin 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
-
visitWriteOnlyManyEntriesCommand
public Object visitWriteOnlyManyEntriesCommand(InvocationContext ctx, WriteOnlyManyEntriesCommand command) throws Throwable - Specified by:
visitWriteOnlyManyEntriesCommandin interfaceVisitor- Overrides:
visitWriteOnlyManyEntriesCommandin 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
-
store
- Throws:
Throwable
-
isStoreEnabled
-
isProperWriter
-
resetStatistics
public void resetStatistics()Description copied from class:JmxStatsCommandInterceptorResets statistics gathered. Is a no-op, and should be overridden if it is to be meaningful.- Specified by:
resetStatisticsin interfaceJmxStatisticsExposer- Overrides:
resetStatisticsin classJmxStatsCommandInterceptor
-
getWritesToTheStores
@ManagedAttribute(description="Number of writes to the store", displayName="Number of writes to the store", measurementType=TRENDSUP) public long getWritesToTheStores() -
getNumberOfPersistedEntries
@ManagedAttribute(description="Number of entries currently persisted excluding expired entries", displayName="Number of persisted entries") public int getNumberOfPersistedEntries()
-