public List<PartitionInfo> getTopicMetadata(String topic, boolean allowAutoTopicCreation, Timer timer) {
        MetadataRequest.Builder request = new MetadataRequest.Builder(Collections.singletonList(topic), allowAutoTopicCreation);
        Map<String, List<PartitionInfo>> topicMetadata = getTopicMetadata(request, timer);
        return topicMetadata.get(topic);
    }
Fetches the {@link PartitionInfo partition information} for the given topic in the cluster, or {@code null}.

@param timer Timer bounding how long this method can block
@return The {@link List list} of {@link PartitionInfo partition information}, or {@code null} if the topic is
unknown
clients/src/main/java/org/apache/kafka/clients/consumer/internals/TopicMetadataFetcher.java