aweisberg commented on code in PR #3754:
URL: https://github.com/apache/cassandra/pull/3754#discussion_r1984160256


##########
src/java/org/apache/cassandra/db/lifecycle/View.java:
##########
@@ -353,4 +361,40 @@ public boolean apply(T t)
             }
         };
     }
+
+    // Match the SSTableReaders from the existing ones to the new one to be 
added (with same ranges)
+    // Returns the map of toRemove <-> toAdd. Return empty map if such 1-1 
replacement doesn't exist
+    private static Map<SSTableReader, SSTableReader> getReplacementMap(final 
Set<SSTableReader> remove, final Iterable<SSTableReader> add)
+    {
+        List<SSTableReader> toAdds = new ArrayList<>();

Review Comment:
   The copy and sorting of `toAdds` and `toRemove` could be done outside the 
lock/CAS loop since it doesn't depend on the contents of the `View`



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