public boolean isAssignedReplica(TopicPartition topicPartition, Integer replicaId)
            throws ExecutionException, InterruptedException {
        String topic = topicPartition.topic();
        int partition = topicPartition.partition();
        TopicDescription description = admin.describeTopics(Collections.singletonList(topicPartition.topic()))
                .allTopicNames().get().get(topic);
        TopicPartitionInfo partitionInfo = description.partitions().get(partition);
        return partitionInfo.replicas().stream().anyMatch(node -> node.id() == replicaId);
    }
Send the given records trying to honor the batch size. This is attempted
with a large producer linger and the use of an explicit flush every time
the number of a "group" of records reaches the batch size.
@param recordsToProduce the records to produce
@param batchSize the batch size
storage/src/test/java/org/apache/kafka/tiered/storage/TieredStorageTestContext.java