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


##########
accord-core/src/main/java/accord/local/SafeCommand.java:
##########
@@ -131,14 +143,27 @@ public Command.Executed preapplied(CommonAttributes 
attrs, Timestamp executeAt,
         return update(Command.preapplied(current(), attrs, executeAt, 
waitingOn, writes, result));
     }
 
+    public Command.Executed applying()
+    {
+        return update(Command.applying(current().asExecuted()));
+    }
+
     public Command.Executed applied()
     {
         return update(Command.applied(current().asExecuted()));
     }
 
-    public Command.NotWitnessed notWitnessed()
+    public Command.NotDefined uninitialised()
     {
         Invariants.checkArgument(current() == null);
-        return update(Command.NotWitnessed.notWitnessed(txnId));
+        return update(Command.NotDefined.uninitialised(txnId));
+    }
+
+    public Command initialise()
+    {
+        Command current = current();
+        if (current.saveStatus() != Uninitialised)
+            return current;
+        return update(Command.NotDefined.notDefined(current, 
current.promised()));

Review Comment:
   Uninitialised is a a local state that just means we haven’t initialised the 
transaction state yet. NotDefined is set as soon as we actually record anything 
associated with the transaction. 
   
   We can go back to NotWitnessed, or perhaps there’s a third better descriptor.
   
   Note though that we adopt this state after BeginInvalidation also, if we 
haven’t previously been PreAccepted. So NotWitnessed feels more inaccurate to 
me.
   
   We could always introduce a PreAcceptWithoutDefinitiom status to delineate 
that state though.



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