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


##########
accord-core/src/main/java/accord/coordinate/ExecuteTxn.java:
##########
@@ -78,12 +86,63 @@
 import static accord.primitives.SaveStatus.Stable;
 import static accord.primitives.Status.Durability.DurablyStable;
 import static accord.primitives.Status.Phase.Execute;
+import static accord.topology.Topologies.SelectNodeOwnership.SHARE;
 import static java.util.concurrent.TimeUnit.MICROSECONDS;
 
 // TODO (expected): return Waiting from ReadData if not ready to execute, and 
do not submit more than one speculative retry in this case
 // TODO (expected): by default, if we can execute locally, never contact a 
remote replica regardless of local outcome
 public class ExecuteTxn extends ReadCoordinator<ReadReply>
 {
+    class StableTracker extends QuorumIdTracker implements Callback<ReadReply>
+    {
+        private boolean hasInformedDecidedOrSucceeded;
+        private boolean informOnSuccess;
+
+        public StableTracker(Topologies topologies)
+        {
+            super(topologies);
+        }
+
+        @Override
+        public void onSuccess(Id from, ReadReply reply)
+        {
+            if ((reply.isOk() || reply == Waiting) && RequestStatus.Success == 
recordSuccess(from) && informOnSuccess)
+                informStable();
+        }
+
+        @Override
+        public void onFailure(Id from, Throwable failure)
+        {
+        }
+
+        void informStable()
+        {
+            Invariants.require(hasReachedQuorum());
+            hasInformedDecidedOrSucceeded = true;

Review Comment:
   No, that was for the outer class to invoke on its success. But perhaps I 
will simply call this isDone and setDone



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