dcapwell commented on code in PR #2339:
URL: https://github.com/apache/cassandra/pull/2339#discussion_r1203135926


##########
src/java/org/apache/cassandra/service/accord/async/AsyncOperation.java:
##########
@@ -57,7 +57,7 @@
     static class Context
     {
         final HashMap<TxnId, AccordSafeCommand> commands = new HashMap<>();
-        final HashMap<RoutableKey, AccordSafeCommandsForKey> commandsForKeys = 
new HashMap<>();
+        final TreeMap<RoutableKey, AccordSafeCommandsForKey> commandsForKeys = 
new TreeMap<>();

Review Comment:
   its for 
`org.apache.cassandra.service.accord.AccordSafeCommandStore#mapReduceForKey`
   
   ```
   for (RoutableKey key : commandsForKeys.keySet())
                   {
                       //TODO (duplicate code): this is a repeat of Key... only 
change is checking contains in range
                       if (!keysOrRanges.contains(key)) continue;
                       SafeCommandsForKey forKey = commandsForKey(key);
   ...
   ```
   
   I thought it looked like callers of `mapReduce` expect ordering, but `map` 
logically shouldn't... so I might be able to remove; would just need to double 
check this ordering expectations.



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