Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KAFKA-18932: Removed usage of partition max bytes from share fetch requests #19148

Merged
merged 11 commits into from
Mar 12, 2025
Prev Previous commit
Addressed Apoorv's review comments round 3
adixitconfluent committed Mar 12, 2025
commit 465c2d22f289e22c62450d907eded062a040b7c2
Original file line number Diff line number Diff line change
@@ -81,10 +81,10 @@ static List<TopicIdPartition> rotateRoundRobin(
return topicIdPartitions;
}

// We don't want to modify the original list, hence created a copy.
// Avoid modifying the original list, create copy.
List<TopicIdPartition> rotatedPartitions = new ArrayList<>(topicIdPartitions);
// We want the elements from the end of the list to move left by the distance provided i.e. if the original list is [1,2,3],
// and we want to rotate it by 1, we want the output as [2,3,1] and not [3,1,2]. Hence, we need negation of distance here.
// Elements from the list should move left by the distance provided i.e. if the original list is [1,2,3],
// and rotation is by 1, then output should be [2,3,1] and not [3,1,2]. Hence, negate the distance here.
Collections.rotate(rotatedPartitions, -1 * rotateAt);
return rotatedPartitions;
}
Original file line number Diff line number Diff line change
@@ -86,9 +86,9 @@ public void testRoundRobinStrategyWithEmptyPartitions() {
}

/**
* Create an ordered set of topic partitions.
* Create a list of topic partitions.
* @param size The number of topic-partitions to create.
* @return The ordered set of topic partitions.
* @return The list of topic partitions.
*/
private List<TopicIdPartition> createPartitions(int size) {
List<TopicIdPartition> partitions = new ArrayList<>();