belliottsmith commented on code in PR #3679:
URL: https://github.com/apache/cassandra/pull/3679#discussion_r1844973906


##########
src/java/org/apache/cassandra/service/accord/CommandsForRanges.java:
##########
@@ -48,56 +64,41 @@
 import static accord.primitives.Routables.Slice.Minimal;
 import static accord.primitives.Status.Stable;
 import static accord.primitives.Status.Truncated;
+import static accord.primitives.Txn.Kind.ExclusiveSyncPoint;
 
-public class CommandsForRanges implements CommandsSummary
+public class CommandsForRanges extends TreeMap<Timestamp, 
CommandsForRanges.Summary> implements CommandsSummary
 {
-    public final Ranges ranges;
-    private final NavigableMap<Timestamp, CommandsForRangesLoader.Summary> map;
-
-    private CommandsForRanges(Ranges ranges, NavigableMap<Timestamp, 
CommandsForRangesLoader.Summary> map)
-    {
-        this.ranges = ranges;
-        this.map = map;
-    }
-
-    public static CommandsForRanges create(Ranges ranges, 
NavigableMap<Timestamp, CommandsForRangesLoader.Summary> map)
-    {
-        return new CommandsForRanges(ranges, map);
-    }
-
-    @VisibleForTesting
-    public int size()
+    public CommandsForRanges(Map<? extends Timestamp, ? extends Summary> m)
     {
-        return map.size();
+        super(m);
     }
 
     @Override
-    public <P1, T> T mapReduceFull(TxnId testTxnId, Txn.Kind.Kinds testKind, 
TestStartedAt testStartedAt, TestDep testDep, TestStatus testStatus, 
CommandFunction<P1, T, T> map, P1 p1, T accumulate)
+    public <P1, T> T mapReduceFull(Routables<?> keysOrRanges, TxnId testTxnId, 
Txn.Kind.Kinds testKind, TestStartedAt testStartedAt, TestDep testDep, 
TestStatus testStatus, CommandFunction<P1, T, T> map, P1 p1, T accumulate)

Review Comment:
   I have added validation to `AccordSafeCommandStore.mapReduce`. Also, I think 
this bug is fixed in the investigate mixup test PR, unless there's another 
cause. I forget what the cause was, but I am fairly sure I have addressed one 
cause either in this PR or that one.



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