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


##########
accord-core/src/main/java/accord/impl/CommandChange.java:
##########
@@ -109,33 +110,44 @@ public enum Field
      * which we can use in order to mark the corresponding fields as changed
      * and setting them to null when they are erased.
      */
-    protected static final int[] saveStatusMasks;
+    protected static final int[] eraseKnownFieldsMask;
+
+    public static int flagsForPurge(SaveStatus status)
+    {
+        int flags = 0;
+        int mask = eraseKnownFieldsMask[status.ordinal()];
+        mask &= 0xffff | (mask << 16);
+        flags |= mask;
+        flags = setChanged(SAVE_STATUS, flags);
+        return flags;
+    }
 
     static
     {
-        saveStatusMasks = new int[SaveStatus.values().length];
-        for (int i = 0; i < saveStatusMasks.length; i++)
+        eraseKnownFieldsMask = new int[SaveStatus.values().length];
+        for (int i = 0; i < eraseKnownFieldsMask.length; i++)
         {
             SaveStatus saveStatus = SaveStatus.forOrdinal(i);
+
             int mask = 0;
             if (forceFieldChangedToNullFlag(saveStatus, saveStatus.known::is, 
DepsErased))
-                mask |= setFieldIsNullAndChanged(PARTIAL_DEPS, mask)
-                     |  setFieldIsNullAndChanged(WAITING_ON, mask)
-                     |  setFieldIsNullAndChanged(MIN_UNIQUE_HLC, mask);
+                mask |= setIsNullAndChanged(PARTIAL_DEPS, mask)
+                        | setIsNullAndChanged(WAITING_ON, mask)

Review Comment:
   nit: alignment



-- 
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: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to