synchronized int sequenceNumber(TopicPartition topicPartition) {
        return txnPartitionMap.getOrCreate(topicPartition).nextSequence();
    }
Returns the next sequence number to be written to the given TopicPartition.
clients/src/main/java/org/apache/kafka/clients/producer/internals/TransactionManager.java