use of org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_PUT in project ignite by apache.
the class EventsRemoteSecurityContextCheckTest method checkRemoteListenWithNullFilter.
/**
*/
private void checkRemoteListenWithNullFilter(boolean async) throws Exception {
for (IgniteEx initiator : initiators()) {
IgniteCache<Object, Object> cache = initiator.createCache(new CacheConfiguration<>("test_cache_" + INDEX.incrementAndGet()).setCacheMode(REPLICATED));
CountDownLatch srvNodesListenedLatch = new CountDownLatch(initiator.cluster().forServers().nodes().size());
IgniteBiPredicate<UUID, ? extends Event> locLsnr = (uuid, e) -> {
srvNodesListenedLatch.countDown();
return true;
};
UUID lsnrId = async ? initiator.events().remoteListenAsync(locLsnr, null, EVT_CACHE_OBJECT_PUT).get() : initiator.events().remoteListen(locLsnr, null, EVT_CACHE_OBJECT_PUT);
try {
cache.put("key", "val");
assertTrue(srvNodesListenedLatch.await(getTestTimeout(), MILLISECONDS));
} finally {
initiator.events().stopRemoteListen(lsnrId);
}
}
}
Aggregations