Class 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.

    Galder ZamarreƱo, Dan Berindei