public boolean hasIncomplete() {
        return !this.incomplete.isEmpty();
    }
Check whether there are any pending batches (whether sent or unsent).
clients/src/main/java/org/apache/kafka/clients/producer/internals/RecordAccumulator.java