gharris1727 commented on code in PR #14156:
URL: https://github.com/apache/kafka/pull/14156#discussion_r1289079347


##########
connect/mirror/src/main/java/org/apache/kafka/connect/mirror/OffsetSyncStore.java:
##########
@@ -227,7 +227,7 @@ private void clearSyncArray(OffsetSync[] syncs, OffsetSync 
offsetSync) {
         }
     }
 
-    private void updateSyncArray(OffsetSync[] syncs, OffsetSync offsetSync) {
+    private void updateSyncArray(OffsetSync[] syncs, OffsetSync[] original, 
OffsetSync offsetSync) {

Review Comment:
   That is already the signature of the caller, so this would amount to 
inlining this function into `updateExistingSyncs` to combine the two.
   
   I think that this function is already large enough, and doesn't also need to 
be concerned with copying the array or logging the result. I also think it 
makes batching updates simpler: The caller can manage the lifetimes of the 
arrays and their mutability, while the inner function can be concerned with 
just applying the updates.
   
   Also this code was doing that already, here and in the `clearSyncArray` 
function.



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to