public class DistCacheWriterInterceptor extends CacheWriterInterceptor
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.
CacheWriterInterceptor.Updater
enabled, persistenceManager
cacheConfiguration
Constructor and Description |
---|
DistCacheWriterInterceptor() |
Modifier and Type | Method and Description |
---|---|
protected Log |
getLog() |
void |
inject(DistributionManager dm,
Transport transport,
ClusteringDependentLogic cdl) |
protected boolean |
isProperWriter(InvocationContext ctx,
FlagAffectedCommand command,
Object key) |
protected boolean |
skipSharedStores(InvocationContext ctx,
Object key,
FlagAffectedCommand command) |
Object |
visitPutKeyValueCommand(InvocationContext ctx,
PutKeyValueCommand command) |
Object |
visitPutMapCommand(InvocationContext ctx,
PutMapCommand command) |
Object |
visitRemoveCommand(InvocationContext ctx,
RemoveCommand command) |
Object |
visitReplaceCommand(InvocationContext ctx,
ReplaceCommand command) |
commitCommand, disableInterceptor, getWritesToTheStores, init, isStoreEnabled, isStoreEnabled, resetStatistics, start, store, visitClearCommand, visitCommitCommand, visitPrepareCommand
checkStatisticsUsed, getStatisticsEnabled, setStatisticsEnabled
getLockAcquisitionTimeout, getNext, handleDefault, hasNext, hasSkipLocking, injectConfiguration, invokeNextInterceptor, setNext
visitApplyDeltaCommand, visitCollection, visitDistributedExecuteCommand, visitEntrySetCommand, visitEvictCommand, visitGetKeyValueCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitLockControlCommand, visitRollbackCommand, visitSizeCommand, visitUnknownCommand, visitValuesCommand
protected Log getLog()
getLog
in class CacheWriterInterceptor
public void inject(DistributionManager dm, Transport transport, ClusteringDependentLogic cdl)
public Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command) throws Throwable
visitPutKeyValueCommand
in interface Visitor
visitPutKeyValueCommand
in class CacheWriterInterceptor
Throwable
public Object visitPutMapCommand(InvocationContext ctx, PutMapCommand command) throws Throwable
visitPutMapCommand
in interface Visitor
visitPutMapCommand
in class CacheWriterInterceptor
Throwable
public Object visitRemoveCommand(InvocationContext ctx, RemoveCommand command) throws Throwable
visitRemoveCommand
in interface Visitor
visitRemoveCommand
in class CacheWriterInterceptor
Throwable
public Object visitReplaceCommand(InvocationContext ctx, ReplaceCommand command) throws Throwable
visitReplaceCommand
in interface Visitor
visitReplaceCommand
in class CacheWriterInterceptor
Throwable
protected boolean skipSharedStores(InvocationContext ctx, Object key, FlagAffectedCommand command)
skipSharedStores
in class CacheWriterInterceptor
protected boolean isProperWriter(InvocationContext ctx, FlagAffectedCommand command, Object key)
isProperWriter
in class CacheWriterInterceptor
Copyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.