Skip to content

Latest commit

 

History

History
418 lines (346 loc) · 10.7 KB

kafka-clients-admin-Admin.adoc

File metadata and controls

418 lines (346 loc) · 10.7 KB

Admin Contract — Administrative Clients

Admin is the abstraction of administrative clients for managing and inspecting resources of a Kafka cluster (e.g. topics, brokers, configurations, ACLs).

Note
AdminClient is the only known direct extension of the Admin Contract in Apache Kafka.
Table 1. Admin Contract
Method Description

alterPartitionReassignments

AlterPartitionReassignmentsResult alterPartitionReassignments(
  Map<TopicPartition, Optional<NewPartitionReassignment>> reassignments) // (1)
AlterPartitionReassignmentsResult alterPartitionReassignments(
  Map<TopicPartition, Optional<NewPartitionReassignment>> reassignments,
  AlterPartitionReassignmentsOptions options)
  1. Uses a new AlterPartitionReassignmentsOptions with the defaults

alterReplicaLogDirs

AlterReplicaLogDirsResult alterReplicaLogDirs(
  Map<TopicPartitionReplica, String> replicaAssignment) // (1)
AlterReplicaLogDirsResult alterReplicaLogDirs(
  Map<TopicPartitionReplica, String> replicaAssignment,
  AlterReplicaLogDirsOptions options)
  1. Uses a new AlterReplicaLogDirsOptions with the defaults

close

void close()  // (1)
void close(
  Duration timeout)
  1. Uses an infinite timeout

create

Admin create(
  Map<String, Object> conf)
Admin create(
  Properties props)

createAcls

CreateAclsResult createAcls(
  Collection<AclBinding> acls) // (1)
CreateAclsResult createAcls(
  Collection<AclBinding> acls,
  CreateAclsOptions options)
  1. Uses a new CreateAclsOptions with the defaults

createDelegationToken

CreateDelegationTokenResult createDelegationToken() // (1)
CreateDelegationTokenResult createDelegationToken(
  CreateDelegationTokenOptions options)
  1. Uses a new CreateDelegationTokenOptions with the defaults

createPartitions

CreatePartitionsResult createPartitions(
  Map<String, NewPartitions> newPartitions) // (1)
CreatePartitionsResult createPartitions(
  Map<String, NewPartitions> newPartitions,
  CreatePartitionsOptions options)
  1. Uses a new CreatePartitionsOptions with the defaults

createTopics

CreateTopicsResult createTopics(
  Collection<NewTopic> newTopics) // (1)
CreateTopicsResult createTopics(
  Collection<NewTopic> newTopics,
  CreateTopicsOptions options)
  1. Uses a CreateTopicsOptions with the defaults

deleteAcls

DeleteAclsResult deleteAcls(
  Collection<AclBindingFilter> filters) // (1)
DeleteAclsResult deleteAcls(
  Collection<AclBindingFilter> filters,
  DeleteAclsOptions options)
  1. Uses a DeleteAclsOptions with the defaults

deleteConsumerGroupOffsets

DeleteConsumerGroupOffsetsResult deleteConsumerGroupOffsets(
  String groupId,
  Set<TopicPartition> partitions) // (1)
DeleteConsumerGroupOffsetsResult deleteConsumerGroupOffsets(
  String groupId,
  Set<TopicPartition> partitions,
  DeleteConsumerGroupOffsetsOptions options)
  1. Uses a DeleteConsumerGroupOffsetsOptions with the defaults

deleteConsumerGroups

DeleteConsumerGroupsResult deleteConsumerGroups(
  Collection<String> groupIds) // (1)
DeleteConsumerGroupsResult deleteConsumerGroups(
  Collection<String> groupIds,
  DeleteConsumerGroupsOptions options)
  1. Uses a DeleteConsumerGroupsOptions with the defaults

deleteRecords

DeleteRecordsResult deleteRecords(
  Map<TopicPartition, RecordsToDelete> recordsToDelete) // (1)
DeleteRecordsResult deleteRecords(
  Map<TopicPartition, RecordsToDelete> recordsToDelete,
  DeleteRecordsOptions options)
  1. Uses a DeleteRecordsOptions with the defaults

deleteTopics

DeleteTopicsResult deleteTopics(
  Collection<String> topics) // (1)
DeleteTopicsResult deleteTopics(
  Collection<String> topics,
  DeleteTopicsOptions options)
  1. Uses a DeleteTopicsOptions with the defaults

describeAcls

DescribeAclsResult describeAcls(
  AclBindingFilter filter) // (1)
DescribeAclsResult describeAcls(
  AclBindingFilter filter,
  DescribeAclsOptions options)
  1. Uses a DescribeAclsOptions with the defaults

describeCluster

DescribeClusterResult describeCluster() // (1)
DescribeClusterResult describeCluster(
  DescribeClusterOptions options)
  1. Uses a DescribeClusterOptions with the defaults

describeConfigs

DescribeConfigsResult describeConfigs(
  Collection<ConfigResource> resources) // (1)
DescribeConfigsResult describeConfigs(
  Collection<ConfigResource> resources,
  DescribeConfigsOptions options)
  1. Uses a DescribeConfigsOptions with the defaults

describeConsumerGroups

DescribeConsumerGroupsResult describeConsumerGroups(
  Collection<String> groupIds) // (1)
DescribeConsumerGroupsResult describeConsumerGroups(
  Collection<String> groupIds,
  DescribeConsumerGroupsOptions options)
  1. Uses a DescribeConsumerGroupsOptions with the defaults

describeDelegationToken

DescribeDelegationTokenResult describeDelegationToken() // (1)
DescribeDelegationTokenResult describeDelegationToken(
  DescribeDelegationTokenOptions options)
  1. Uses a DescribeDelegationTokenOptions with the defaults

describeLogDirs

DescribeLogDirsResult describeLogDirs(
  Collection<Integer> brokers) // (1)
DescribeLogDirsResult describeLogDirs(
  Collection<Integer> brokers,
  DescribeLogDirsOptions options)
  1. Uses a DescribeLogDirsOptions with the defaults

describeReplicaLogDirs

DescribeReplicaLogDirsResult describeReplicaLogDirs(
  Collection<TopicPartitionReplica> replicas) // (1)
DescribeReplicaLogDirsResult describeReplicaLogDirs(
  Collection<TopicPartitionReplica> replicas,
  DescribeReplicaLogDirsOptions options)
  1. Uses a DescribeReplicaLogDirsOptions with the defaults

describeTopics

DescribeTopicsResult describeTopics(
  Collection<String> topicNames) // (1)
DescribeTopicsResult describeTopics(
  Collection<String> topicNames,
  DescribeTopicsOptions options)
  1. Uses a DescribeTopicsOptions with the defaults

electLeaders

ElectLeadersResult electLeaders(
  ElectionType electionType,
  Set<TopicPartition> partitions) // (1)
ElectLeadersResult electLeaders(
  ElectionType electionType,
  Set<TopicPartition> partitions,
  ElectLeadersOptions options)
  1. Uses an ElectLeadersOptions with the defaults

Elects a replica as the leader for the given topic partitions

expireDelegationToken

ExpireDelegationTokenResult expireDelegationToken(
  byte[] hmac) // (1)
ExpireDelegationTokenResult expireDelegationToken(
  byte[] hmac,
  ExpireDelegationTokenOptions options)
  1. Uses a new ExpireDelegationTokenOptions with the defaults

incrementalAlterConfigs

AlterConfigsResult incrementalAlterConfigs(
  Map<ConfigResource, Collection<AlterConfigOp>> configs) // (1)
AlterConfigsResult incrementalAlterConfigs(
  Map<ConfigResource, Collection<AlterConfigOp>> configs,
  AlterConfigsOptions options)
  1. Uses a new AlterConfigsOptions with the defaults

listConsumerGroupOffsets

ListConsumerGroupOffsetsResult listConsumerGroupOffsets(
  String groupId) // (1)
ListConsumerGroupOffsetsResult listConsumerGroupOffsets(
  String groupId,
  ListConsumerGroupOffsetsOptions options)
  1. Uses a new ListConsumerGroupOffsetsOptions with the defaults

Used for ConsumerGroupCommand (when executed with --offsets option)

listConsumerGroups

ListConsumerGroupsResult listConsumerGroups() // (1)
ListConsumerGroupsResult listConsumerGroups(
  ListConsumerGroupsOptions options)
  1. Uses a new ListConsumerGroupsOptions with the defaults

Used for ConsumerGroupCommand (when executed with --list option)

listPartitionReassignments

ListPartitionReassignmentsResult listPartitionReassignments() // (1)
ListPartitionReassignmentsResult listPartitionReassignments(
  ListPartitionReassignmentsOptions options)
ListPartitionReassignmentsResult listPartitionReassignments(
  Set<TopicPartition> partitions)
ListPartitionReassignmentsResult listPartitionReassignments(
  Set<TopicPartition> partitions,
  ListPartitionReassignmentsOptions options)
ListPartitionReassignmentsResult listPartitionReassignments(
  Optional<Set<TopicPartition>> partitions,
  ListPartitionReassignmentsOptions options)
  1. Uses a new ListPartitionReassignmentsOptions with the defaults

listTopics

ListTopicsResult listTopics() // (1)
ListTopicsResult listTopics(
  ListTopicsOptions options)
  1. Uses a new ListTopicsOptions with the defaults

metrics

Map<MetricName, ? extends Metric> metrics()

Used for StreamThread (Kafka Streams)

removeMembersFromConsumerGroup

RemoveMembersFromConsumerGroupResult removeMembersFromConsumerGroup(
  String groupId,
  RemoveMembersFromConsumerGroupOptions options)

Removes members from the consumer group by given member identities

renewDelegationToken

RenewDelegationTokenResult renewDelegationToken(
  byte[] hmac) // (1)
RenewDelegationTokenResult renewDelegationToken(
  byte[] hmac,
  RenewDelegationTokenOptions options)
  1. Uses a new RenewDelegationTokenOptions with the defaults