Class AtomicKeySetImpl<K>

  • All Implemented Interfaces:
    MergeOnStore

    public final class AtomicKeySetImpl<K>
    extends Object
    implements MergeOnStore
    This class is expected to be modified without locking, and results merged using the merge(Object) method when committing to DC. Also, the keys are not persisted, we record only existence of this map and then upon load we retrieve the keys through GetKeysInGroupCommand. On transactional cache it is safe to execute concurrent adds/removes to this class even without the lock because we'll never prepare-commit another transaction that would modify the same key concurrently - the transaction will be synchronized on the modified key (which acquires locks properly). This is kind of piggybacking on other key's locking scheme. The only exception to that rule is when we attempt to remove this map completely - this is not safe to proceed concurrently to any other modification.
    • Method Detail

      • merge

        public Object merge​(Object other)
        Specified by:
        merge in interface MergeOnStore
        Parameters:
        other - Actual value stored in the cache, or null if the entry does not exist.
        Returns:
        Value that will be stored in the cache, or null if it should be removed.