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


##########
accord-core/src/main/java/accord/api/ProgressLog.java:
##########
@@ -64,38 +64,69 @@
         ProgressLog create(CommandStore store);
     }
 
+    enum ProgressShard
+    {
+        /* We do not have enough information to say whether the shard is a 
progress shard or not */
+        Unsure,
+
+        /**
+         * This shard is not a progress shard
+         */
+        No,
+
+        /* Adhoc Local Progress Shard, i.e. where the local node is not a 
replica for the coordination epoch */
+        Adhoc,
+
+        /* Designated Local Progress Shard (selected from keys replicated 
locally at coordination epoch) */
+        Local,
+
+        /* Designated Home (Global Progress) Shard (if local node is a replica 
of home key on coordination epoch) */
+        Home;
+
+        public boolean isHome() { return this == Home; }
+        public boolean isProgress() { return this.compareTo(Local) >= 0; }
+    }
+
+    /**
+     * Has not been pre-accepted, but has been witnessed by ourselves (only 
partially) or another node that has informed us
+     *
+     * A home shard should monitor this transaction for global progress.
+     * A non-home shard should not receive this message.
+     */
+    void unwitnessed(TxnId txnId, RoutingKey homeKey, ProgressShard shard);
+
     /**
      * Has been pre-accepted.
      *
      * A home shard should monitor this transaction for global progress.
      * A non-home shard should begin monitoring this transaction only to 
ensure it reaches the Accept phase, or is
      * witnessed by a majority of the home shard.
      */
-    void preaccept(Command command, boolean isProgressShard, boolean 
isHomeShard);
+    void preaccept(Command command, ProgressShard shard);
 
     /**
      * Has been accepted
      *
      * A home shard should monitor this transaction for global progress.
      * A non-home shard can safely ignore this transaction, as it has been 
witnessed by a majority of the home shard.
      */
-    void accept(Command command, boolean isProgressShard, boolean isHomeShard);
+    void accept(Command command, ProgressShard shard);
 
     /**
      * Has committed
      *
      * A home shard should monitor this transaction for global progress.
      * A non-home shard can safely ignore this transaction, as it has been 
witnessed by a majority of the home shard.
      */
-    void commit(Command command, boolean isProgressShard, boolean isHomeShard);
+    void commit(Command command, ProgressShard shard);
 
     /**
      * The transaction is waiting to make progress, as all local dependencies 
have applied.
      *
      * A home shard should monitor this transaction for global progress.
      * A non-home shard can safely ignore this transaction, as it has been 
witnessed by a majority of the home shard.
      */
-    void readyToExecute(Command command, boolean isProgressShard, boolean 
isHomeShard);
+    void readyToExecute(Command command, ProgressShard shard);

Review Comment:
   Nope. Ready to perform the coordinated `Execute` step, that computes the 
outcome that is disseminated by `Apply`. It can only `PreApply` when the 
`Apply` message arrives.



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