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


##########
accord-core/src/main/java/accord/coordinate/CollectDeps.java:
##########
@@ -0,0 +1,87 @@
+package accord.coordinate;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.function.BiConsumer;
+
+import accord.coordinate.tracking.QuorumTracker;
+import accord.local.Node;
+import accord.local.Node.Id;
+import accord.messages.Callback;
+import accord.messages.GetDeps;
+import accord.messages.GetDeps.GetDepsOk;
+import accord.primitives.Deps;
+import accord.primitives.Route;
+import accord.primitives.Timestamp;
+import accord.primitives.Txn;
+import accord.primitives.TxnId;
+import accord.topology.Topologies;
+
+class CollectDeps implements Callback<GetDepsOk>
+{
+    final Node node;
+    final TxnId txnId;
+    final Route route;
+    final Txn txn;
+
+    final Timestamp executeAt;
+
+    private final List<GetDepsOk> oks;
+    private final QuorumTracker tracker;
+    private final BiConsumer<Deps, Throwable> callback;
+    private boolean isDone;
+
+    CollectDeps(Node node, Topologies topologies, TxnId txnId, Route route, 
Txn txn, Timestamp executeAt, BiConsumer<Deps, Throwable> callback)
+    {
+        this.node = node;
+        this.txnId = txnId;
+        this.route = route;
+        this.txn = txn;
+        this.executeAt = executeAt;
+        this.callback = callback;
+        this.oks = new ArrayList<>();
+        this.tracker = new QuorumTracker(topologies);
+    }
+
+    public static void withDeps(Node node, TxnId txnId, Route route, Txn txn, 
Timestamp executeAt, BiConsumer<Deps, Throwable> callback)

Review Comment:
   I think `withDeps` here is more useful, as that represents the context when 
the callback is invoked. i.e. the callback is invoked "with deps"



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