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


##########
accord-core/src/main/java/accord/local/KeyHistory.java:
##########
@@ -48,7 +49,33 @@ public enum KeyHistory
     /**
      * Load recovery information for all keys into memory before processing 
the command.
      */
-    RECOVER,
+    RECOVER;
+    
+    public boolean satisfiesIfPresent(KeyHistory that)
+    {
+        return satisfies(that, ASYNC);
+    }
+
+    public boolean satisfies(KeyHistory that)
+    {
+        return satisfies(that, SYNC);
+    }
+
+    private boolean satisfies(KeyHistory that, KeyHistory ifSyncRequireAtLeast)
+    {
+        switch (that)
+        {
+            default: throw new AssertionError("Unhandled KeyHistory: " + that);
+            case NONE:
+                return true;
+            case RECOVER:
+            case TIMESTAMPS:
+                return this == that;
+            case ASYNC:
+            case INCR:
+            case SYNC:
+                return this.compareTo(ifSyncRequireAtLeast) >= 0;

Review Comment:
   yes, ASYNC and INCR basically don't guarantee they have fetched what was 
requested. They'll accept partial information. That said, this isn't 
implemented on the load side yet so today it's only declarative of 
intent/requirements on the task side.



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