ascherbakoff commented on code in PR #4821:
URL: https://github.com/apache/ignite-3/pull/4821#discussion_r1890137650


##########
modules/core/src/main/java/org/apache/ignite/internal/util/PendingComparableValuesTracker.java:
##########
@@ -110,6 +110,35 @@ public void update(T newValue, @Nullable R futureResult) {
         }
     }
 
+    /**
+     * Strict update with reordering check. Always called from the same 
updater thread.
+     *
+     * @param newValue New value.
+     * @param futureResult A result that will be used to complete a future 
returned by the
+     *         {@link PendingComparableValuesTracker#waitFor(Comparable)}.
+     */
+    public void updateStrict(T newValue, @Nullable R futureResult) {
+        if (!busyLock.readLock().tryLock()) {
+            throw new TrackerClosedException();
+        }
+
+        try {
+            Map.Entry<T, @Nullable R> current = this.current;
+
+            IgniteBiTuple<T, @Nullable R> newEntry = new 
IgniteBiTuple<>(newValue, futureResult);
+
+            // Entries from the same batch receive equal safe timestamps.

Review Comment:
   I've refactored this logic to a separate class: SafeTimeValuesTracker



-- 
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: notifications-unsubscr...@ignite.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to