private void addToInflightBatches(List<ProducerBatch> batches) {
        for (ProducerBatch batch : batches) {
            List<ProducerBatch> inflightBatchList = inFlightBatches.computeIfAbsent(batch.topicPartition,
                k -> new ArrayList<>());
            inflightBatchList.add(batch);
        }
    }
Get the in-flight batches that has reached delivery timeout.
clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java