private void findNext() {
    if (consumerRecordIterator.hasNext()) {
      nextRecord = consumerRecordIterator.next();
      hasMore = nextRecord.offset() < endOffset;
    } else {
      hasMore = false;
      nextRecord = null;
    }
  }
Find the next element in the current batch OR schedule {@link KafkaRecordIterator#pollRecords()} (hasMore = false).
kafka-handler/src/java/org/apache/hadoop/hive/kafka/KafkaRecordIterator.java