nizhikov commented on code in PR #9948:
URL: https://github.com/apache/ignite/pull/9948#discussion_r914963767


##########
modules/core/src/test/java/org/apache/ignite/cdc/AbstractCdcTest.java:
##########
@@ -392,6 +412,50 @@ public static class UserCdcConsumer extends 
TestCdcConsumer<Integer> {
         }
     }
 
+    /** */
+    public static class TrackCacheEventsConsumer implements CdcConsumer {
+        /** Cache events. */
+        public Map<Integer, CdcCacheEvent> evts = new ConcurrentHashMap<>();
+
+        /** {@inheritDoc} */
+        @Override public void onCacheChange(Iterator<CdcCacheEvent> 
cacheEvents) {
+            cacheEvents.forEachRemaining(e -> evts.put(e.cacheId(), e));
+        }
+
+        /** {@inheritDoc} */
+        @Override public void onCacheDestroy(Iterator<Integer> caches) {
+            caches.forEachRemaining(evts::remove);

Review Comment:
   This can't be done - because cache events received by consumer on each node. 
So, multiple cache events will be received for single cache operation.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to