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


##########
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:
   it isn't more correct to use the wrong ranges that were provided by load, if 
indeed they were wrong. Usually the logic asking to perform the calculation has 
a better idea of what needs to be calculated. I will make sure there is 
validation.



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