CalvinConfluent commented on code in PR #14312:
URL: https://github.com/apache/kafka/pull/14312#discussion_r1349612504
##########
metadata/src/main/java/org/apache/kafka/controller/PartitionChangeBuilder.java:
##########
@@ -362,6 +408,38 @@ private void setAssignmentChanges(PartitionChangeRecord
record) {
}
}
+ private void populateTargetElr() {
+ // If the ISR is larger or equal to the min ISR, clear the ELR and
lastKnownELR.
+ if (targetIsr.size() >= minISR) {
+ targetElr = Collections.emptyList();
+ targetLastKnownElr = Collections.emptyList();
+ return;
+ }
+
+ Set<Integer> currentIsrSet =
Arrays.stream(partition.isr).boxed().collect(Collectors.toSet());
+ Set<Integer> targetIsrSet =
targetIsr.stream().collect(Collectors.toSet());
+ Set<Integer> currentElrSet =
Arrays.stream(partition.elr).boxed().collect(Collectors.toSet());
+ Set<Integer> currentLastKnownElrSet =
Arrays.stream(partition.lastKnownElr).boxed().collect(Collectors.toSet());
Review Comment:
Adjust the code with less intermediate variables.
--
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]