belliottsmith commented on code in PR #154:
URL: https://github.com/apache/cassandra-accord/pull/154#discussion_r1914963479
##########
accord-core/src/main/java/accord/local/CommandStore.java:
##########
@@ -311,8 +326,34 @@ protected void updateMaxConflicts(Command prev, Command
updated)
if (executeAt == null) return;
if (prev != null && prev.executeAt() != null &&
prev.executeAt().compareTo(executeAt) >= 0) return;
-
MaxConflicts updatedMaxConflicts =
maxConflicts.update(updated.participants().hasTouched(), executeAt);
+ updateMaxConflicts(executeAt, updatedMaxConflicts);
+ }
+
+ protected void updateMaxConflicts(Ranges ranges, Timestamp executeAt)
+ {
+ updateMaxConflicts(executeAt, maxConflicts.update(ranges, executeAt));
+ }
+
+ protected void updateMaxConflicts(NavigableMap<? extends Timestamp,
Ranges> map)
+ {
+ Timestamp max = Timestamp.NONE;
+ MaxConflicts updated = maxConflicts;
+ for (Map.Entry<? extends Timestamp, Ranges> e : map.entrySet())
+ {
+ Timestamp at = e.getKey();
+ if (at.compareTo(Timestamp.NONE) > 0)
+ {
+ updated = updated.update(e.getValue(), at);
+ max = Timestamp.max(max, at);
Review Comment:
I don't follow. The goal here is to ensure all of the timestamps in the map
are represented in `MaxConflicts`
--
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]