AndrewJSchofield commented on code in PR #23532:
URL: https://github.com/apache/kafka/pull/23532#discussion_r4069868271
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareFetch.java:
##########
@@ -67,14 +67,15 @@ private ShareFetch(Map<TopicIdPartition,
List<ShareInFlightBatch<K, V>>> batches
*/
public void add(TopicIdPartition partition, ShareInFlightBatch<K, V>
batch) {
Objects.requireNonNull(batch);
- batches.computeIfAbsent(partition, k -> new LinkedList<>()).add(batch);
+ batches.computeIfAbsent(partition, k -> new ArrayList<>()).add(batch);
if (batch.getAcquisitionLockTimeoutMs().isPresent()) {
acquisitionLockTimeoutMs = batch.getAcquisitionLockTimeoutMs();
}
}
/**
- * @return all the non-control messages for this fetch, grouped by
partition
+ * @return all the non-control messages for this fetch, grouped by
partition. Partitions with no
+ * in-flight records (such as those whose acquired offsets were all
control records) are omitted.
*/
public Map<TopicPartition, List<ConsumerRecord<K, V>>> records() {
final LinkedHashMap<TopicPartition, List<ConsumerRecord<K, V>>> result
= new LinkedHashMap<>();
Review Comment:
Yes, but I would write SHOULD not. Given that I was expecting to do a
minimal PR to sneak into the 4.4.0 RC, and now this is likely on a longer
timeframe, I can spend a little more time ensuring that changing this doesn't
cause flakiness. I do agree that it's a sensible change overall.
--
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]