nizhikov commented on code in PR #291:
URL: https://github.com/apache/ignite-extensions/pull/291#discussion_r1806378850


##########
modules/cdc-ext/src/main/java/org/apache/ignite/cdc/AbstractCdcEventsApplier.java:
##########
@@ -36,10 +36,10 @@ public abstract class AbstractCdcEventsApplier<K, V> {
     private final int maxBatchSize;
 
     /** Update batch. */
-    private final Map<K, V> updBatch = new HashMap<>();
+    private final Map<K, V> updBatch = new TreeMap<>(this::compareKey);

Review Comment:
   Let's use `SortedMap` instead of just `Map`.



##########
modules/cdc-ext/src/main/java/org/apache/ignite/cdc/AbstractCdcEventsApplier.java:
##########
@@ -36,10 +36,10 @@ public abstract class AbstractCdcEventsApplier<K, V> {
     private final int maxBatchSize;
 
     /** Update batch. */
-    private final Map<K, V> updBatch = new HashMap<>();
+    private final Map<K, V> updBatch = new TreeMap<>(this::compareKey);
 
     /** Remove batch. */
-    private final Map<K, GridCacheVersion> rmvBatch = new HashMap<>();
+    private final Map<K, GridCacheVersion> rmvBatch = new 
TreeMap<>(this::compareKey);

Review Comment:
   Let's use `SortedMap` instead of just `Map`.



-- 
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