Interface KafkaAdminClient


  • public interface KafkaAdminClient
    Vert.x Kafka Admin client implementation
    • Method Detail

      • create

        static KafkaAdminClient create​(Vertx vertx,
                                       org.apache.kafka.clients.admin.AdminClient adminClient)
        Create a new KafkaAdminClient instance
        Parameters:
        vertx - Vert.x instance to use
        adminClient - Kafka native Admin client instance
        Returns:
        an instance of the KafkaAdminClient
      • create

        static KafkaAdminClient create​(Vertx vertx,
                                       Map<String,​String> config)
        Create a new KafkaAdminClient instance
        Parameters:
        vertx - Vert.x instance to use
        config - Kafka admin client configuration
        Returns:
        an instance of the KafkaAdminClient
      • create

        static KafkaAdminClient create​(Vertx vertx,
                                       Properties config)
        Create a new KafkaAdminClient instance
        Parameters:
        vertx - Vert.x instance to use
        config - Kafka admin client configuration
        Returns:
        an instance of the KafkaAdminClient
      • listTopics

        Future<Set<String>> listTopics()
        List the topics available in the cluster with the default options.
        Returns:
        a future notified with the result
      • describeTopics

        Future<Map<String,​TopicDescription>> describeTopics​(List<String> topicNames)
        Describe some topics in the cluster, with the default options.
        Parameters:
        topicNames - the names of the topics to describe
        Returns:
        a future notified with the result
      • createTopics

        Future<Void> createTopics​(List<NewTopic> topics)
        Creates a batch of new Kafka topics
        Parameters:
        topics - topics to create
        Returns:
        a future notified with the result
      • deleteTopics

        Future<Void> deleteTopics​(List<String> topicNames)
        Deletes a batch of Kafka topics
        Parameters:
        topicNames - the names of the topics to delete
        Returns:
        a future notified with the result
      • createPartitions

        Future<Void> createPartitions​(Map<String,​NewPartitions> partitions)
        Creates a batch of new partitions in the Kafka topic
        Parameters:
        partitions - partitions to create
        Returns:
        a future notified with the result
      • describeConfigs

        Future<Map<ConfigResource,​Config>> describeConfigs​(List<ConfigResource> configResources)
        Get the configuration for the specified resources with the default options
        Parameters:
        configResources - the resources (topic and broker resource types are currently supported)
        Returns:
        a future notified with the result
      • alterConfigs

        Future<Void> alterConfigs​(Map<ConfigResource,​Config> configs)
        Update the configuration for the specified resources with the default options
        Parameters:
        configs - The resources with their configs (topic is the only resource type with configs that can be updated currently)
        Returns:
        a future notified with the result
      • listConsumerGroups

        Future<List<ConsumerGroupListing>> listConsumerGroups()
        Get the the consumer groups available in the cluster with the default options
        Returns:
        a future notified with the result
      • describeConsumerGroups

        Future<Map<String,​ConsumerGroupDescription>> describeConsumerGroups​(List<String> groupIds)
        Describe some group ids in the cluster, with the default options
        Parameters:
        groupIds - the ids of the groups to describe
        Returns:
        a future notified with the result
      • describeCluster

        Future<ClusterDescription> describeCluster()
        Describe the nodes in the cluster with the default options
        Returns:
        a future notified with the result
      • describeLogDirs

        Future<Map<Integer,​Map<String,​org.apache.kafka.clients.admin.LogDirDescription>>> describeLogDirs​(List<Integer> brokers)
        Query the information of all log directories on the given set of brokers
        Parameters:
        brokers - list of broker ids
        Returns:
        a future notified with the result
      • deleteRecords

        Future<Map<TopicPartition,​org.apache.kafka.clients.admin.DeletedRecords>> deleteRecords​(Map<TopicPartition,​org.apache.kafka.clients.admin.RecordsToDelete> recordsToDelete)
        Delete records from a topic partition.
        Parameters:
        recordsToDelete - records to be delted on the given topic partition
        Returns:
        a future notified with the result
      • deleteConsumerGroups

        Future<Void> deleteConsumerGroups​(List<String> groupIds)
        Delete consumer groups from the cluster.
        Parameters:
        groupIds - the ids of the groups to delete
        Returns:
        a future notified with the result
      • listConsumerGroupOffsets

        Future<Map<TopicPartition,​OffsetAndMetadata>> listConsumerGroupOffsets​(String groupId,
                                                                                     ListConsumerGroupOffsetsOptions options)
        List the consumer group offsets available in the cluster.
        Parameters:
        groupId - The group id of the group whose offsets will be listed
        options - The options to use when listing the consumer group offsets.
        Returns:
        a future notified with the result
      • listConsumerGroupOffsets

        default Future<Map<TopicPartition,​OffsetAndMetadata>> listConsumerGroupOffsets​(String groupId)
        List the consumer group offsets available in the cluster.
        Parameters:
        groupId - The group id of the group whose offsets will be listed
        Returns:
        a future notified with the result
      • deleteConsumerGroupOffsets

        Future<Void> deleteConsumerGroupOffsets​(String groupId,
                                                Set<TopicPartition> partitions)
        Delete committed offsets for a set of partitions in a consumer group. This will succeed at the partition level only if the group is not actively subscribed to the corresponding topic.
        Parameters:
        groupId - The group id of the group whose offsets will be deleted
        Returns:
        a future notified with the result
      • alterConsumerGroupOffsets

        Future<Void> alterConsumerGroupOffsets​(String groupId,
                                               Map<TopicPartition,​OffsetAndMetadata> offsets)
        Alter committed offsets for a set of partitions in a consumer group.
        Parameters:
        groupId - The group id of the group whose offsets will be altered
        offsets - The map of offsets in the consumer group which will be altered
        Returns:
        a future notified with the result
      • describeAcls

        Future<List<org.apache.kafka.common.acl.AclBinding>> describeAcls​(org.apache.kafka.common.acl.AclBindingFilter aclBindingFilter)
        Describe the ACL rules.
        Parameters:
        aclBindingFilter - The filter to use.
        Returns:
        a future notified with the result
      • createAcls

        Future<List<org.apache.kafka.common.acl.AclBinding>> createAcls​(List<org.apache.kafka.common.acl.AclBinding> aclBindings)
        Create the ACL rules.
        Parameters:
        aclBindings - The ACL to create.
        Returns:
        a future notified with the result
      • deleteAcls

        Future<List<org.apache.kafka.common.acl.AclBinding>> deleteAcls​(List<org.apache.kafka.common.acl.AclBindingFilter> aclBindings)
        Delete the ACL rules.
        Parameters:
        aclBindings - The filter to delete matching ACLs.
        Returns:
        a future notified with the result
      • close

        Future<Void> close()
        Close the admin client
        Returns:
        a future notified with the result
      • close

        Future<Void> close​(long timeout)
        Close the admin client
        Parameters:
        timeout - timeout to wait for closing
        Returns:
        a future notified with the result