Package org.infinispan.atomic.impl
Class AtomicKeySetImpl<K>
- java.lang.Object
-
- org.infinispan.atomic.impl.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 themerge(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 throughGetKeysInGroupCommand
. 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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AtomicKeySetImpl.Externalizer
static class
AtomicKeySetImpl.FunctionExternalizer
-
-
-
Method Detail
-
merge
public Object merge(Object other)
- Specified by:
merge
in interfaceMergeOnStore
- Parameters:
other
- Actual value stored in the cache, ornull
if the entry does not exist.- Returns:
- Value that will be stored in the cache, or null if it should be removed.
-
-