Class PartitionLookupUtils


  • public final class PartitionLookupUtils
    extends Object
    Utilities for looking up information on partitions.
    • Method Detail

      • numPartitions

        public static int numPartitions​(TopicPath topic)
                                 throws com.google.api.gax.rpc.ApiException
        Look up the number of partitions in a topic.
        Throws:
        com.google.api.gax.rpc.ApiException
      • numPartitions

        public static int numPartitions​(TopicPath topic,
                                        AdminClient client)
                                 throws com.google.api.gax.rpc.ApiException
        Look up the number of partitions in a topic using the provided AdminClient.
        Throws:
        com.google.api.gax.rpc.ApiException
      • numPartitions

        public static int numPartitions​(SubscriptionPath subscription)
                                 throws com.google.api.gax.rpc.ApiException
        Look up the number of partitions in the topic associated with a subscription.
        Throws:
        com.google.api.gax.rpc.ApiException
      • numPartitions

        public static int numPartitions​(SubscriptionPath subscription,
                                        AdminClient client)
                                 throws com.google.api.gax.rpc.ApiException
        Look up the number of partitions in the topic associated with a subscription using the provided AdminClient.
        Throws:
        com.google.api.gax.rpc.ApiException