synchronized void addInFlightBatch(ProducerBatch batch) {
        if (!batch.hasSequence())
            throw new IllegalStateException("Can't track batch for partition " + batch.topicPartition + " when sequence is not set.");
        txnPartitionMap.get(batch.topicPartition).addInflightBatch(batch);
    }
Returns the current producer id/epoch of the given TopicPartition.
clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java