Details
-
Wish
-
Status: Open
-
Trivial
-
Resolution: Unresolved
-
None
-
None
-
None
Description
package: org.apache.kafka.clients.consumer.internals
class: Fetcher
else
{ // this case shouldn't usually happen because we only send one fetch at a time per partition, // but it might conceivably happen in some rare cases (such as partition leader changes). // we have to copy to a new list because the old one may be immutable List<ConsumerRecord<K, V>> newRecords = new ArrayList<>(records.size() + currentRecords.size()); newRecords.addAll(currentRecords); newRecords.addAll(records); fetched.put(partition, newRecords); } recordsRemaining -= records.size();
}
I just cannot think of the case that it will goes to the else logic, who can illustrate it? it's useless logic in my opinion, looking forward to reply!