Class AtomicMapProxyImpl<K,​V,​MK>

  • Type Parameters:
    K -
    V -
    MK -
    All Implemented Interfaces:
    Map<K,​V>, AtomicMap<K,​V>

    public class AtomicMapProxyImpl<K,​V,​MK>
    extends Object
    implements AtomicMap<K,​V>
    This is the proxy class driving access to the entry in cache using functional API. The value in cache is a map of type defined by dataClass() which is accompanied by dataInstance() and dataCopy(Map). Currently it is implemented by FastCopyHashMap as we need to create a defensive copy of the value in context. The map is expected to be used with transactional caches; upon map creation or read, the whole map is cached in the transactional context and subsequent reads are served from here. When the map is modified, the change is applied to the local copy in the context. Modifications are added in the form of functional commands to the transaction and executed opon commit. In non-transactional mode this map works correctly, but since any read results in retrieving the whole map, its use might not be very efficient. This behaviour may be addressed in the future. Collections returned by keySet(), values() and entrySet() are backed by the map. Iterators work on a snapshot obtained at the moment when this iterator is created, and support the Iterator.remove() operation. This implementation does not support fine-grained locking nor fine-grained write-skew check.