Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-12846

why need this logic in Consumer‘s Fetch logic it should remove?

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Open
    • Trivial
    • Resolution: Unresolved
    • None
    • 2.3.0
    • 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!

      Attachments

        Activity

          People

            Unassigned Unassigned
            ws yws
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: