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


##########
accord-core/src/main/java/accord/messages/InformDurable.java:
##########
@@ -0,0 +1,116 @@
+package accord.messages;
+
+import accord.api.Key;
+import accord.api.ProgressLog.ProgressShard;
+import accord.local.Command;
+import accord.local.Node.Id;
+import accord.local.PreLoadContext;
+import accord.local.SafeCommandStore;
+import accord.local.Status.Durability;
+import accord.primitives.*;
+import accord.topology.Topologies;
+
+import java.util.Collections;
+
+import static accord.api.ProgressLog.ProgressShard.Adhoc;
+import static accord.api.ProgressLog.ProgressShard.Home;
+import static accord.api.ProgressLog.ProgressShard.Local;
+import static accord.local.PreLoadContext.contextFor;
+import static accord.messages.SimpleReply.Ok;
+
+public class InformDurable extends TxnRequest<Reply> implements PreLoadContext
+{
+    public static class SerializationSupport
+    {
+        public static InformDurable create(TxnId txnId, PartialRoute scope, 
long waitForEpoch, Timestamp executeAt, Durability durability)
+        {
+            return new InformDurable(txnId, scope, waitForEpoch, executeAt, 
durability);
+        }
+    }
+
+    public final Timestamp executeAt;
+    public final Durability durability;
+    private transient ProgressShard shard;
+
+    public InformDurable(Id to, Topologies topologies, AbstractRoute route, 
TxnId txnId, Timestamp executeAt, Durability durability)
+    {
+        super(to, topologies, route, txnId);
+        this.executeAt = executeAt;
+        this.durability = durability;
+    }
+
+    private InformDurable(TxnId txnId, PartialRoute scope, long waitForEpoch, 
Timestamp executeAt, Durability durability)
+    {
+        super(txnId, scope, waitForEpoch);
+        this.executeAt = executeAt;
+        this.durability = durability;
+    }
+
+    public void process()
+    {
+        Timestamp at = txnId;
+        if (progressKey == null)
+        {
+            // we need to pick a progress log, but this node might not have 
participated in the coordination epoch
+            // in this rare circumstance we simply pick a key to select some 
progress log to coordinate this

Review Comment:
   Oops, ok yes. Should have been obvious.



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