org.infinispan.interceptors
Class DistCacheStoreInterceptor

java.lang.Object
  extended by org.infinispan.commands.AbstractVisitor
      extended by org.infinispan.interceptors.base.CommandInterceptor
          extended by org.infinispan.interceptors.base.JmxStatsCommandInterceptor
              extended by org.infinispan.interceptors.CacheStoreInterceptor
                  extended by org.infinispan.interceptors.DistCacheStoreInterceptor
All Implemented Interfaces:
Visitor, JmxStatisticsExposer

public class DistCacheStoreInterceptor
extends CacheStoreInterceptor

Cache store interceptor specific for the distribution cache mode. Put operations has been modified in such way that if they put operation is the result of an L1 put, storing in the cache store is ignore. This is done so that inmortal entries that get converted into mortal ones when putting into L1 don't get propagated to the cache store.

Secondly, in a replicated environment where a shared cache store is used, the node in which the cache operation is executed is the one responsible for interacting with the cache. This doesn't work with distributed mode and instead, in a shared cache store situation, the first owner of the key is the one responsible for storing it.

In the particular case of putAll(), individual keys are checked and if a shared cache store environment has been configured, only the first owner of that key will actually store it to the cache store. In a unshared environment though, only those nodes that are owners of the key would store it to their local cache stores.

Since:
4.0
Author:
Galder ZamarreƱo

Nested Class Summary
 
Nested classes/interfaces inherited from class org.infinispan.interceptors.CacheStoreInterceptor
CacheStoreInterceptor.StoreModificationsBuilder
 
Field Summary
 
Fields inherited from class org.infinispan.interceptors.base.CommandInterceptor
configuration, log, trace
 
Constructor Summary
DistCacheStoreInterceptor()
           
 
Method Summary
 void inject(DistributionManager dm, Transport transport)
           
 Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command)
           
 Object visitPutMapCommand(InvocationContext ctx, PutMapCommand command)
           
 Object visitRemoveCommand(InvocationContext ctx, RemoveCommand command)
           
 Object visitReplaceCommand(InvocationContext ctx, ReplaceCommand command)
           
 
Methods inherited from class org.infinispan.interceptors.CacheStoreInterceptor
getCacheLoaderStores, init, resetStatistics, skip, start, visitClearCommand, visitCommitCommand, visitPrepareCommand, visitRollbackCommand
 
Methods inherited from class org.infinispan.interceptors.base.JmxStatsCommandInterceptor
checkStatisticsUsed, getStatisticsEnabled, setStatisticsEnabled
 
Methods inherited from class org.infinispan.interceptors.base.CommandInterceptor
getNext, handleDefault, hasNext, invokeNextInterceptor, setNext
 
Methods inherited from class org.infinispan.commands.AbstractVisitor
visitCollection, visitEntrySetCommand, visitEvictCommand, visitGetKeyValueCommand, visitInvalidateCommand, visitKeySetCommand, visitLockControlCommand, visitSizeCommand, visitValuesCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistCacheStoreInterceptor

public DistCacheStoreInterceptor()
Method Detail

inject

public void inject(DistributionManager dm,
                   Transport transport)

visitPutKeyValueCommand

public Object visitPutKeyValueCommand(InvocationContext ctx,
                                      PutKeyValueCommand command)
                               throws Throwable
Specified by:
visitPutKeyValueCommand in interface Visitor
Overrides:
visitPutKeyValueCommand in class CacheStoreInterceptor
Throws:
Throwable

visitPutMapCommand

public Object visitPutMapCommand(InvocationContext ctx,
                                 PutMapCommand command)
                          throws Throwable
Specified by:
visitPutMapCommand in interface Visitor
Overrides:
visitPutMapCommand in class CacheStoreInterceptor
Throws:
Throwable

visitRemoveCommand

public Object visitRemoveCommand(InvocationContext ctx,
                                 RemoveCommand command)
                          throws Throwable
Specified by:
visitRemoveCommand in interface Visitor
Overrides:
visitRemoveCommand in class CacheStoreInterceptor
Throws:
Throwable

visitReplaceCommand

public Object visitReplaceCommand(InvocationContext ctx,
                                  ReplaceCommand command)
                           throws Throwable
Specified by:
visitReplaceCommand in interface Visitor
Overrides:
visitReplaceCommand in class CacheStoreInterceptor
Throws:
Throwable

Google Analytics

Copyright © 2010 JBoss, a division of Red Hat. All Rights Reserved.