dcapwell commented on code in PR #106:
URL: https://github.com/apache/cassandra-accord/pull/106#discussion_r1697577844


##########
accord-core/src/main/java/accord/local/CommandStore.java:
##########
@@ -594,8 +593,68 @@ public final boolean isRejectedIfNotPreAccepted(TxnId 
txnId, Unseekables<?> part
         return null != rejectBefore.foldl(participants, (rejectIfBefore, test) 
-> rejectIfBefore.compareTo(test) > 0 ? null : test, txnId, Objects::isNull);
     }
 
-    public final void removeRedundantDependencies(Unseekables<?> participants, 
Deps deps, WaitingOn.Update builder)
+    public final void removeRedundantDependencies(Unseekables<?> participants, 
WaitingOn.Update builder)
     {
+        // Note: we do not need to track the bootstraps we implicitly depend 
upon, because we will not serve any read requests until this has completed
+        //  and since we are a timestamp store, and we write only this will 
sort itself out naturally
+        // TODO (required): make sure we have no races on HLC around SyncPoint 
else this resolution may not work (we need to know the micros equivalent 
timestamp of the snapshot)
+        class KeyState
+        {
+            Map<Integer, Keys> partiallyBootstrapping;
+
+            /**
+             * Are the participating ranges for the txn fully covered by 
bootstrapping ranges for this command store
+             */
+            boolean isFullyBootstrapping(WaitingOn.Update builder, Range 
range, int txnIdx)
+            {
+                if (builder.directKeyDeps.foldEachKey(txnIdx, range, true, 
(r0, k, p) -> p && r0.contains(k)))
+                    return true;
+
+                if (partiallyBootstrapping == null)
+                    partiallyBootstrapping = new HashMap<>();

Review Comment:
   `org.agrona.collections.Int2ObjectHashMap`?



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