use of org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_UNLOCKED in project ignite by apache.
the class CacheEventSecurityContextTest method checkEvents.
/**
* Executes specified cache operation on each server node and checks events.
*/
private void checkEvents(ConsumerX<Integer> op, boolean withInitVal, Integer... expEvtTypes) throws Exception {
IgniteEx crd = grid("crd");
Set<Integer> evts = Arrays.stream(expEvtTypes).collect(Collectors.toSet());
// TODO Remove the following workaround after resolving IGNITE-13490.
if (ATOMIC_CACHE.equals(cacheName) && evts.size() > 1)
evts.remove(EVT_CACHE_OBJECT_READ);
if (TRANSACTIONAL_CACHE.equals(cacheName) && !(evts.size() == 1 && evts.contains(EVT_CACHE_OBJECT_READ))) {
evts.add(EVT_CACHE_OBJECT_LOCKED);
evts.add(EVT_CACHE_OBJECT_UNLOCKED);
}
List<Integer> keys = testNodes().stream().map(node -> keyForNode(crd.affinity(cacheName), KEY_COUNTER, node)).collect(Collectors.toList());
if (withInitVal)
keys.forEach(key -> crd.cache(cacheName).put(key, "val"));
checkEvents(() -> keys.forEach(op), evts);
}
Aggregations