chia7712 commented on code in PR #23532:
URL: https://github.com/apache/kafka/pull/23532#discussion_r4067199520
##########
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:
> I do not think so, but I don't think it matters. It's very easy to make a
flaky test by changing something like this.
If the order is not guaranteed, the tests should NOT count on that, right?
--
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]