belliottsmith commented on code in PR #251:
URL: https://github.com/apache/cassandra-accord/pull/251#discussion_r2361172367


##########
accord-core/src/main/java/accord/local/CommandStore.java:
##########
@@ -673,15 +808,45 @@ protected void updatedRedundantBefore(SafeCommandStore 
safeStore, RedundantBefor
         listeners.clearBefore(this, clearWaitingBefore);
     }
 
-    protected final Ranges isWaitingOnSync(TxnId syncId, Ranges ranges)
+    public AsyncResult<Void> awaitVisibility(long epoch, Ranges ranges)
+    {
+        synchronized (waitingOnVisibility)
+        {
+            if (waitingOnVisibility.isEmpty())
+                return AsyncResults.success(null);
+
+            List<AsyncResult<Void>> awaiting = new ArrayList<>();
+            Ranges waitingOn = Ranges.EMPTY;
+            for (Map.Entry<Long, WaitingOnVisibility> e : 
waitingOnVisibility.entrySet())
+            {
+                if (e.getKey() > epoch)
+                    break;
+
+                Ranges remaining = e.getValue().waitingOn;
+                Ranges intersecting = remaining.slice(ranges, Minimal);
+                if (!intersecting.isEmpty())
+                {
+                    awaiting.add(e.getValue().whenDone);
+                    ranges = ranges.without(intersecting);
+                    waitingOn = waitingOn.with(intersecting);

Review Comment:
   nope!



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to