public void setProducerState(ProducerIdAndEpoch producerIdAndEpoch, int baseSequence, boolean isTransactional) {
        recordsBuilder.setProducerState(producerIdAndEpoch.producerId, producerIdAndEpoch.epoch, baseSequence, isTransactional);
    }
Returns if the batch is been retried for sending to kafka
clients/src/main/java/org/apache/kafka/clients/producer/internals/ProducerBatch.java