ibessonov commented on code in PR #1807:
URL: https://github.com/apache/ignite-3/pull/1807#discussion_r1144425530


##########
modules/core/src/main/java/org/apache/ignite/internal/causality/BaseVersionedValue.java:
##########
@@ -40,20 +40,16 @@
 import org.jetbrains.annotations.Nullable;
 
 /**
- * Parametrized type to store several versions of a value.
- *
- * <p>The value can be available through the causality token, which is 
represented by a {@code long}.
- *
- * @param <T> Type of real value.
+ * Base implementation of a {@code VersionedValue} intended to be used by 
other implementations.
  */
-public class AbstractVersionedValue<T> {
-    private final IgniteLogger log = 
Loggers.forClass(AbstractVersionedValue.class);
+class BaseVersionedValue<T> implements VersionedValue<T> {
+    private final IgniteLogger log = 
Loggers.forClass(BaseVersionedValue.class);

Review Comment:
   Why is the log not static?



##########
modules/core/src/test/java/org/apache/ignite/internal/causality/IncrementalVersionedValueTest.java:
##########
@@ -308,33 +298,20 @@ void testConcurrentGetAndCompleteWithHistoryTrimming() 
throws Exception {
         // Set history size to 2.
         versionedValue.complete(3);
 
-        var barrier = new CyclicBarrier(2);
+        runRace(
+                () -> {
+                    versionedValue.update(4, (i, t) -> completedFuture(i + 1));
+                    // Trigger history trimming
+                    versionedValue.complete(4);
+                },
+                () -> {
+                    CompletableFuture<Integer> readerFuture = 
versionedValue.get(2);
 
-        CompletableFuture<Void> writerFuture = CompletableFuture.runAsync(() 
-> {
-            try {
-                barrier.await(1, TimeUnit.SECONDS);
-
-                versionedValue.update(4, (i, t) -> completedFuture(i + 1));
-                // Trigger history trimming
-                versionedValue.complete(4);
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
-        });
-
-        barrier.await(1, TimeUnit.SECONDS);
-
-        try {
-            CompletableFuture<Integer> readerFuture = versionedValue.get(2);
-
-            assertThat(readerFuture, willBe(1));
-        } catch (OutdatedTokenException ignored) {
-            // This is considered as a valid outcome.
-        }
+                    assertThat(readerFuture, willBe(1));

Review Comment:
   It seems that you didn't include `OutdatedTokenException` handling this 
time. Why?



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