Class AdminClient
- java.lang.Object
-
- org.apache.kafka.clients.admin.AdminClient
-
- All Implemented Interfaces:
java.lang.AutoCloseable
- Direct Known Subclasses:
KafkaAdminClient
@Evolving public abstract class AdminClient extends java.lang.Object implements java.lang.AutoCloseable
The administrative client for Kafka, which supports managing and inspecting topics, brokers, configurations and ACLs. The minimum broker version required is 0.10.0.0. Methods with stricter requirements will specify the minimum broker version required. This client was introduced in 0.11.0.0 and the API is still evolving. We will try to evolve the API in a compatible manner, but we reserve the right to make breaking changes in minor releases, if necessary. We will update theInterfaceStability
annotation and this notice once the API is considered stable.
-
-
Constructor Summary
Constructors Constructor Description AdminClient()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description AlterConfigsResult
alterConfigs(java.util.Map<ConfigResource,Config> configs)
This API is not supported.abstract AlterConfigsResult
alterConfigs(java.util.Map<ConfigResource,Config> configs, AlterConfigsOptions options)
This API is not supported.AlterReplicaLogDirsResult
alterReplicaLogDirs(java.util.Map<TopicPartitionReplica,java.lang.String> replicaAssignment)
This API is not supported.abstract AlterReplicaLogDirsResult
alterReplicaLogDirs(java.util.Map<TopicPartitionReplica,java.lang.String> replicaAssignment, AlterReplicaLogDirsOptions options)
This API is not supported.void
close()
Close the AdminClient and release all associated resources.abstract void
close(long duration, java.util.concurrent.TimeUnit unit)
Close the AdminClient and release all associated resources.static AdminClient
create(java.util.Map<java.lang.String,java.lang.Object> conf)
Create a new AdminClient with the given configuration.static AdminClient
create(java.util.Properties props)
Create a new AdminClient with the given configuration.CreateAclsResult
createAcls(java.util.Collection<AclBinding> acls)
This API is not supported.abstract CreateAclsResult
createAcls(java.util.Collection<AclBinding> acls, CreateAclsOptions options)
This API is not supported.CreateDelegationTokenResult
createDelegationToken()
Create a Delegation Token.abstract CreateDelegationTokenResult
createDelegationToken(CreateDelegationTokenOptions options)
Create a Delegation Token.CreatePartitionsResult
createPartitions(java.util.Map<java.lang.String,NewPartitions> newPartitions)
Increase the number of partitions of the topics given as the keys ofnewPartitions
according to the corresponding values.abstract CreatePartitionsResult
createPartitions(java.util.Map<java.lang.String,NewPartitions> newPartitions, CreatePartitionsOptions options)
Increase the number of partitions of the topics given as the keys ofnewPartitions
according to the corresponding values.CreateTopicsResult
createTopics(java.util.Collection<NewTopic> newTopics)
Create a batch of new topics with the default options.abstract CreateTopicsResult
createTopics(java.util.Collection<NewTopic> newTopics, CreateTopicsOptions options)
Create a batch of new topics.DeleteAclsResult
deleteAcls(java.util.Collection<AclBindingFilter> filters)
This API is not supported.abstract DeleteAclsResult
deleteAcls(java.util.Collection<AclBindingFilter> filters, DeleteAclsOptions options)
This API is not supported.DeleteConsumerGroupsResult
deleteConsumerGroups(java.util.Collection<java.lang.String> groupIds)
Delete consumer groups from the cluster with the default options.abstract DeleteConsumerGroupsResult
deleteConsumerGroups(java.util.Collection<java.lang.String> groupIds, DeleteConsumerGroupsOptions options)
Delete consumer groups from the cluster.DeleteRecordsResult
deleteRecords(java.util.Map<TopicPartition,RecordsToDelete> recordsToDelete)
This API is not supported.abstract DeleteRecordsResult
deleteRecords(java.util.Map<TopicPartition,RecordsToDelete> recordsToDelete, DeleteRecordsOptions options)
This API is not supported.DeleteTopicsResult
deleteTopics(java.util.Collection<java.lang.String> topics)
This is a convenience method for #deleteTopics(Collection, DeleteTopicsOptions)
with default options.abstract DeleteTopicsResult
deleteTopics(java.util.Collection<java.lang.String> topics, DeleteTopicsOptions options)
Delete a batch of topics.DescribeAclsResult
describeAcls(AclBindingFilter filter)
This API is not supported.abstract DescribeAclsResult
describeAcls(AclBindingFilter filter, DescribeAclsOptions options)
This API is not supported.DescribeClusterResult
describeCluster()
Get information about the nodes in the cluster, using the default options.abstract DescribeClusterResult
describeCluster(DescribeClusterOptions options)
Get information about the nodes in the cluster.DescribeConfigsResult
describeConfigs(java.util.Collection<ConfigResource> resources)
This API is not supported.abstract DescribeConfigsResult
describeConfigs(java.util.Collection<ConfigResource> resources, DescribeConfigsOptions options)
This API is not supported.DescribeConsumerGroupsResult
describeConsumerGroups(java.util.Collection<java.lang.String> groupIds)
Describe some group IDs in the cluster, with the default options.abstract DescribeConsumerGroupsResult
describeConsumerGroups(java.util.Collection<java.lang.String> groupIds, DescribeConsumerGroupsOptions options)
Describe some group IDs in the cluster.DescribeDelegationTokenResult
describeDelegationToken()
Describe the Delegation Tokens.abstract DescribeDelegationTokenResult
describeDelegationToken(DescribeDelegationTokenOptions options)
Describe the Delegation Tokens.DescribeLogDirsResult
describeLogDirs(java.util.Collection<java.lang.Integer> brokers)
This API is not supported.abstract DescribeLogDirsResult
describeLogDirs(java.util.Collection<java.lang.Integer> brokers, DescribeLogDirsOptions options)
This API is not supported.DescribeReplicaLogDirsResult
describeReplicaLogDirs(java.util.Collection<TopicPartitionReplica> replicas)
This API is not supported.abstract DescribeReplicaLogDirsResult
describeReplicaLogDirs(java.util.Collection<TopicPartitionReplica> replicas, DescribeReplicaLogDirsOptions options)
This API is not supported.DescribeTopicsResult
describeTopics(java.util.Collection<java.lang.String> topicNames)
Describe some topics in the cluster, with the default options.abstract DescribeTopicsResult
describeTopics(java.util.Collection<java.lang.String> topicNames, DescribeTopicsOptions options)
Describe some topics in the cluster.ExpireDelegationTokenResult
expireDelegationToken(byte[] hmac)
Expire a Delegation Token.abstract ExpireDelegationTokenResult
expireDelegationToken(byte[] hmac, ExpireDelegationTokenOptions options)
Expire a Delegation Token.ListConsumerGroupOffsetsResult
listConsumerGroupOffsets(java.lang.String groupId)
List the consumer group offsets available in the cluster with the default options.abstract ListConsumerGroupOffsetsResult
listConsumerGroupOffsets(java.lang.String groupId, ListConsumerGroupOffsetsOptions options)
List the consumer group offsets available in the cluster.ListConsumerGroupsResult
listConsumerGroups()
List the consumer groups available in the cluster with the default options.abstract ListConsumerGroupsResult
listConsumerGroups(ListConsumerGroupsOptions options)
List the consumer groups available in the cluster.ListTopicsResult
listTopics()
List the topics available in the default stream with the default options.ListTopicsResult
listTopics(java.lang.String streamPath)
List the topics available in the specified stream with the default options.abstract ListTopicsResult
listTopics(java.lang.String streamPath, ListTopicsOptions options)
List the topics available in the specified stream.abstract ListTopicsResult
listTopics(ListTopicsOptions options)
List the topics available in the default stream.abstract java.util.Map<MetricName,? extends Metric>
metrics()
Get the metrics kept by the adminClientRenewDelegationTokenResult
renewDelegationToken(byte[] hmac)
Renew a Delegation Token.abstract RenewDelegationTokenResult
renewDelegationToken(byte[] hmac, RenewDelegationTokenOptions options)
Renew a Delegation Token.
-
-
-
Method Detail
-
create
public static AdminClient create(java.util.Properties props)
Create a new AdminClient with the given configuration.- Parameters:
props
- The configuration.- Returns:
- The new KafkaAdminClient.
-
create
public static AdminClient create(java.util.Map<java.lang.String,java.lang.Object> conf)
Create a new AdminClient with the given configuration.- Parameters:
conf
- The configuration.- Returns:
- The new KafkaAdminClient.
-
close
public void close()
Close the AdminClient and release all associated resources. Seeclose(long, TimeUnit)
- Specified by:
close
in interfacejava.lang.AutoCloseable
-
close
public abstract void close(long duration, java.util.concurrent.TimeUnit unit)
Close the AdminClient and release all associated resources. The close operation has a grace period during which current operations will be allowed to complete, specified by the given duration and time unit. New operations will not be accepted during the grace period. Once the grace period is over, all operations that have not yet been completed will be aborted with a TimeoutException.- Parameters:
duration
- The duration to use for the wait time.unit
- The time unit to use for the wait time.
-
createTopics
public CreateTopicsResult createTopics(java.util.Collection<NewTopic> newTopics)
Create a batch of new topics with the default options. This is a convenience method for #createTopics(Collection, CreateTopicsOptions)
with default options. See the overload for more details. This operation is supported by brokers with version 0.10.1.0 or higher.- Parameters:
newTopics
- The new topics to create.- Returns:
- The CreateTopicsResult.
-
createTopics
public abstract CreateTopicsResult createTopics(java.util.Collection<NewTopic> newTopics, CreateTopicsOptions options)
Create a batch of new topics. This operation is not transactional so it may succeed for some topics while fail for others. It may take several seconds afterCreateTopicsResult
returns success for all the brokers to become aware that the topics have been created. During this time,listTopics()
anddescribeTopics(Collection)
may not return information about the new topics. This operation is supported by brokers with version 0.10.1.0 or higher. The validateOnly option is supported from version 0.10.2.0.- Parameters:
newTopics
- The new topics to create.options
- The options to use when creating the new topics.- Returns:
- The CreateTopicsResult.
-
deleteTopics
public DeleteTopicsResult deleteTopics(java.util.Collection<java.lang.String> topics)
This is a convenience method for #deleteTopics(Collection, DeleteTopicsOptions)
with default options. See the overload for more details. This operation is supported by brokers with version 0.10.1.0 or higher.- Parameters:
topics
- The topic names to delete.- Returns:
- The DeleteTopicsResult.
-
deleteTopics
public abstract DeleteTopicsResult deleteTopics(java.util.Collection<java.lang.String> topics, DeleteTopicsOptions options)
Delete a batch of topics. This operation is not transactional so it may succeed for some topics while fail for others. It may take several seconds after theDeleteTopicsResult
returns success for all the brokers to become aware that the topics are gone. During this time, AdminClient#listTopics and AdminClient#describeTopics may continue to return information about the deleted topics. If delete.topic.enable is false on the brokers, deleteTopics will mark the topics for deletion, but not actually delete them. The futures will return successfully in this case. This operation is supported by brokers with version 0.10.1.0 or higher.- Parameters:
topics
- The topic names to delete.options
- The options to use when deleting the topics.- Returns:
- The DeleteTopicsResult.
-
listTopics
public ListTopicsResult listTopics()
List the topics available in the default stream with the default options. This is a convenience method for #listTopics(ListTopicsOptions)
with default options. See the overload for more details.- Returns:
- The ListTopicsResult.
-
listTopics
public abstract ListTopicsResult listTopics(ListTopicsOptions options)
List the topics available in the default stream.- Parameters:
options
- The options to use when listing the topics.- Returns:
- The ListTopicsResult.
-
listTopics
public ListTopicsResult listTopics(java.lang.String streamPath)
List the topics available in the specified stream with the default options. This is a convenience method for #listTopics(ListTopicsOptions)
with default options. See the overload for more details.- Parameters:
streamPath
- The name of the stream for which the topics should be listed- Returns:
- The ListTopicsResult.
-
listTopics
public abstract ListTopicsResult listTopics(java.lang.String streamPath, ListTopicsOptions options)
List the topics available in the specified stream.- Parameters:
streamPath
- The name of the stream for which the topics should be listedoptions
- The options to use when listing the topics.- Returns:
- The ListTopicsResult.
-
describeTopics
public DescribeTopicsResult describeTopics(java.util.Collection<java.lang.String> topicNames)
Describe some topics in the cluster, with the default options. This is a convenience method for #describeTopics(Collection, DescribeTopicsOptions)
with default options. See the overload for more details.- Parameters:
topicNames
- The names of the topics to describe.- Returns:
- The DescribeTopicsResult.
-
describeTopics
public abstract DescribeTopicsResult describeTopics(java.util.Collection<java.lang.String> topicNames, DescribeTopicsOptions options)
Describe some topics in the cluster.- Parameters:
topicNames
- The names of the topics to describe.options
- The options to use when describing the topic.- Returns:
- The DescribeTopicsResult.
-
describeCluster
public DescribeClusterResult describeCluster()
Get information about the nodes in the cluster, using the default options. This is a convenience method for #describeCluster(DescribeClusterOptions)
with default options. See the overload for more details.- Returns:
- The DescribeClusterResult.
-
describeCluster
public abstract DescribeClusterResult describeCluster(DescribeClusterOptions options)
Get information about the nodes in the cluster.- Parameters:
options
- The options to use when getting information about the cluster.- Returns:
- The DescribeClusterResult.
-
describeAcls
public DescribeAclsResult describeAcls(AclBindingFilter filter)
This API is not supported. This is a convenience method for #describeAcls(AclBindingFilter, DescribeAclsOptions)
with default options. See the overload for more details. This operation is supported by brokers with version 0.11.0.0 or higher.- Parameters:
filter
- The filter to use.- Returns:
- The DeleteAclsResult.
-
describeAcls
public abstract DescribeAclsResult describeAcls(AclBindingFilter filter, DescribeAclsOptions options)
This API is not supported. Lists access control lists (ACLs) according to the supplied filter. Note: it may take some time for changes made by createAcls or deleteAcls to be reflected in the output of describeAcls. This operation is supported by brokers with version 0.11.0.0 or higher.- Parameters:
filter
- The filter to use.options
- The options to use when listing the ACLs.- Returns:
- The DeleteAclsResult.
-
createAcls
public CreateAclsResult createAcls(java.util.Collection<AclBinding> acls)
This API is not supported. This is a convenience method for #createAcls(Collection, CreateAclsOptions)
with default options. See the overload for more details. This operation is supported by brokers with version 0.11.0.0 or higher.- Parameters:
acls
- The ACLs to create- Returns:
- The CreateAclsResult.
-
createAcls
public abstract CreateAclsResult createAcls(java.util.Collection<AclBinding> acls, CreateAclsOptions options)
This API is not supported. Creates access control lists (ACLs) which are bound to specific resources. This operation is not transactional so it may succeed for some ACLs while fail for others. If you attempt to add an ACL that duplicates an existing ACL, no error will be raised, but no changes will be made. This operation is supported by brokers with version 0.11.0.0 or higher.- Parameters:
acls
- The ACLs to createoptions
- The options to use when creating the ACLs.- Returns:
- The CreateAclsResult.
-
deleteAcls
public DeleteAclsResult deleteAcls(java.util.Collection<AclBindingFilter> filters)
This API is not supported. This is a convenience method for #deleteAcls(Collection, DeleteAclsOptions)
with default options. See the overload for more details. This operation is supported by brokers with version 0.11.0.0 or higher.- Parameters:
filters
- The filters to use.- Returns:
- The DeleteAclsResult.
-
deleteAcls
public abstract DeleteAclsResult deleteAcls(java.util.Collection<AclBindingFilter> filters, DeleteAclsOptions options)
This API is not supported. Deletes access control lists (ACLs) according to the supplied filters. This operation is not transactional so it may succeed for some ACLs while fail for others. This operation is supported by brokers with version 0.11.0.0 or higher.- Parameters:
filters
- The filters to use.options
- The options to use when deleting the ACLs.- Returns:
- The DeleteAclsResult.
-
describeConfigs
public DescribeConfigsResult describeConfigs(java.util.Collection<ConfigResource> resources)
This API is not supported. Get the configuration for the specified resources with the default options. This is a convenience method for #describeConfigs(Collection, DescribeConfigsOptions)
with default options. See the overload for more details. This operation is supported by brokers with version 0.11.0.0 or higher.- Parameters:
resources
- The resources (topic and broker resource types are currently supported)- Returns:
- The DescribeConfigsResult
-
describeConfigs
public abstract DescribeConfigsResult describeConfigs(java.util.Collection<ConfigResource> resources, DescribeConfigsOptions options)
This API is not supported. Get the configuration for the specified resources. The returned configuration includes default values and the isDefault() method can be used to distinguish them from user supplied values. The value of config entries where isSensitive() is true is alwaysnull
so that sensitive information is not disclosed. Config entries where isReadOnly() is true cannot be updated. This operation is supported by brokers with version 0.11.0.0 or higher.- Parameters:
resources
- The resources (topic and broker resource types are currently supported)options
- The options to use when describing configs- Returns:
- The DescribeConfigsResult
-
alterConfigs
public AlterConfigsResult alterConfigs(java.util.Map<ConfigResource,Config> configs)
This API is not supported. Update the configuration for the specified resources with the default options. This is a convenience method for #alterConfigs(Map, AlterConfigsOptions)
with default options. See the overload for more details. This operation is supported by brokers with version 0.11.0.0 or higher.- Parameters:
configs
- The resources with their configs (topic is the only resource type with configs that can be updated currently)- Returns:
- The AlterConfigsResult
-
alterConfigs
public abstract AlterConfigsResult alterConfigs(java.util.Map<ConfigResource,Config> configs, AlterConfigsOptions options)
This API is not supported. Update the configuration for the specified resources with the default options. Updates are not transactional so they may succeed for some resources while fail for others. The configs for a particular resource are updated atomically. This operation is supported by brokers with version 0.11.0.0 or higher.- Parameters:
configs
- The resources with their configs (topic is the only resource type with configs that can be updated currently)options
- The options to use when describing configs- Returns:
- The AlterConfigsResult
-
alterReplicaLogDirs
public AlterReplicaLogDirsResult alterReplicaLogDirs(java.util.Map<TopicPartitionReplica,java.lang.String> replicaAssignment)
This API is not supported. Change the log directory for the specified replicas. This API is currently only useful if it is used before the replica has been created on the broker. It will support moving replicas that have already been created after KIP-113 is fully implemented. This is a convenience method for #alterReplicaLogDirs(Map, AlterReplicaLogDirsOptions)
with default options. See the overload for more details. This operation is supported by brokers with version 1.0.0 or higher.- Parameters:
replicaAssignment
- The replicas with their log directory absolute path- Returns:
- The AlterReplicaLogDirsResult
-
alterReplicaLogDirs
public abstract AlterReplicaLogDirsResult alterReplicaLogDirs(java.util.Map<TopicPartitionReplica,java.lang.String> replicaAssignment, AlterReplicaLogDirsOptions options)
This API is not supported. Change the log directory for the specified replicas. This API is currently only useful if it is used before the replica has been created on the broker. It will support moving replicas that have already been created after KIP-113 is fully implemented. This operation is not transactional so it may succeed for some replicas while fail for others. This operation is supported by brokers with version 1.0.0 or higher.- Parameters:
replicaAssignment
- The replicas with their log directory absolute pathoptions
- The options to use when changing replica dir- Returns:
- The AlterReplicaLogDirsResult
-
describeLogDirs
public DescribeLogDirsResult describeLogDirs(java.util.Collection<java.lang.Integer> brokers)
This API is not supported. Query the information of all log directories on the given set of brokers This is a convenience method for #describeLogDirs(Collection, DescribeLogDirsOptions)
with default options. See the overload for more details. This operation is supported by brokers with version 1.0.0 or higher.- Parameters:
brokers
- A list of brokers- Returns:
- The DescribeLogDirsResult
-
describeLogDirs
public abstract DescribeLogDirsResult describeLogDirs(java.util.Collection<java.lang.Integer> brokers, DescribeLogDirsOptions options)
This API is not supported. Query the information of all log directories on the given set of brokers This operation is supported by brokers with version 1.0.0 or higher.- Parameters:
brokers
- A list of brokersoptions
- The options to use when querying log dir info- Returns:
- The DescribeLogDirsResult
-
describeReplicaLogDirs
public DescribeReplicaLogDirsResult describeReplicaLogDirs(java.util.Collection<TopicPartitionReplica> replicas)
This API is not supported. Query the replica log directory information for the specified replicas. This is a convenience method for #describeReplicaLogDirs(Collection, DescribeReplicaLogDirsOptions)
with default options. See the overload for more details. This operation is supported by brokers with version 1.0.0 or higher.- Parameters:
replicas
- The replicas to query- Returns:
- The DescribeReplicaLogDirsResult
-
describeReplicaLogDirs
public abstract DescribeReplicaLogDirsResult describeReplicaLogDirs(java.util.Collection<TopicPartitionReplica> replicas, DescribeReplicaLogDirsOptions options)
This API is not supported. Query the replica log directory information for the specified replicas. This operation is supported by brokers with version 1.0.0 or higher.- Parameters:
replicas
- The replicas to queryoptions
- The options to use when querying replica log dir info- Returns:
- The DescribeReplicaLogDirsResult
-
createPartitions
public CreatePartitionsResult createPartitions(java.util.Map<java.lang.String,NewPartitions> newPartitions)
Increase the number of partitions of the topics given as the keys of
newPartitions
according to the corresponding values. If partitions are increased for a topic that has a key, the partition logic or ordering of the messages will be affected.This is a convenience method for
createPartitions(Map, CreatePartitionsOptions)
with default options. See the overload for more details.- Parameters:
newPartitions
- The topics which should have new partitions created, and corresponding parameters for the created partitions.- Returns:
- The CreatePartitionsResult.
-
createPartitions
public abstract CreatePartitionsResult createPartitions(java.util.Map<java.lang.String,NewPartitions> newPartitions, CreatePartitionsOptions options)
Increase the number of partitions of the topics given as the keys of
newPartitions
according to the corresponding values. If partitions are increased for a topic that has a key, the partition logic or ordering of the messages will be affected.This operation is not transactional so it may succeed for some topics while fail for others.
It may take several seconds after this method returns success for all the brokers to become aware that the partitions have been created. During this time,
describeTopics(Collection)
may not return information about the new partitions.This operation is supported by brokers with version 1.0.0 or higher.
The following exceptions can be anticipated when calling
get()
on the futures obtained from thevalues()
method of the returnedCreatePartitionsResult
AuthorizationException
if the authenticated user is not authorized to alter the topicTimeoutException
if the request was not completed in within the givenAbstractOptions.timeoutMs()
.ReassignmentInProgressException
if a partition reassignment is currently in progressBrokerNotAvailableException
if the requestedNewPartitions.assignments()
contain a broker that is currently unavailable.InvalidReplicationFactorException
if noNewPartitions.assignments()
are given and it is impossible for the broker to assign replicas with the topics replication factor.- Subclasses of
KafkaException
if the request is invalid in some way.
- Parameters:
newPartitions
- The topics which should have new partitions created, and corresponding parameters for the created partitions.options
- The options to use when creating the new paritions.- Returns:
- The CreatePartitionsResult.
-
deleteRecords
public DeleteRecordsResult deleteRecords(java.util.Map<TopicPartition,RecordsToDelete> recordsToDelete)
This API is not supported. Delete records whose offset is smaller than the given offset of the corresponding partition. This is a convenience method fordeleteRecords(Map, DeleteRecordsOptions)
with default options. See the overload for more details. This operation is supported by brokers with version 0.11.0.0 or higher.- Parameters:
recordsToDelete
- The topic partitions and related offsets from which records deletion starts.- Returns:
- The DeleteRecordsResult.
-
deleteRecords
public abstract DeleteRecordsResult deleteRecords(java.util.Map<TopicPartition,RecordsToDelete> recordsToDelete, DeleteRecordsOptions options)
This API is not supported. Delete records whose offset is smaller than the given offset of the corresponding partition. This operation is supported by brokers with version 0.11.0.0 or higher.- Parameters:
recordsToDelete
- The topic partitions and related offsets from which records deletion starts.options
- The options to use when deleting records.- Returns:
- The DeleteRecordsResult.
-
createDelegationToken
public CreateDelegationTokenResult createDelegationToken()
Create a Delegation Token.
This is a convenience method for
createDelegationToken(CreateDelegationTokenOptions)
with default options. See the overload for more details.- Returns:
- The CreateDelegationTokenResult.
-
createDelegationToken
public abstract CreateDelegationTokenResult createDelegationToken(CreateDelegationTokenOptions options)
Create a Delegation Token.
This operation is supported by brokers with version 1.1.0 or higher.
The following exceptions can be anticipated when calling
get()
on the futures obtained from thedelegationToken()
method of the returnedCreateDelegationTokenResult
UnsupportedByAuthenticationException
If the request sent on PLAINTEXT/1-way SSL channels or delegation token authenticated channels.InvalidPrincipalTypeException
if the renewers principal type is not supported.DelegationTokenDisabledException
if the delegation token feature is disabled.TimeoutException
if the request was not completed in within the givenAbstractOptions.timeoutMs()
.
- Parameters:
options
- The options to use when creating delegation token.- Returns:
- The DeleteRecordsResult.
-
renewDelegationToken
public RenewDelegationTokenResult renewDelegationToken(byte[] hmac)
Renew a Delegation Token.
This is a convenience method for
renewDelegationToken(byte[], RenewDelegationTokenOptions)
with default options. See the overload for more details.- Parameters:
hmac
- HMAC of the Delegation token- Returns:
- The RenewDelegationTokenResult.
-
renewDelegationToken
public abstract RenewDelegationTokenResult renewDelegationToken(byte[] hmac, RenewDelegationTokenOptions options)
Renew a Delegation Token.
This operation is supported by brokers with version 1.1.0 or higher.
The following exceptions can be anticipated when calling
get()
on the futures obtained from theexpiryTimestamp()
method of the returnedRenewDelegationTokenResult
UnsupportedByAuthenticationException
If the request sent on PLAINTEXT/1-way SSL channels or delegation token authenticated channels.DelegationTokenDisabledException
if the delegation token feature is disabled.DelegationTokenNotFoundException
if the delegation token is not found on server.DelegationTokenOwnerMismatchException
if the authenticated user is not owner/renewer of the token.DelegationTokenExpiredException
if the delegation token is expired.TimeoutException
if the request was not completed in within the givenAbstractOptions.timeoutMs()
.
- Parameters:
hmac
- HMAC of the Delegation tokenoptions
- The options to use when renewing delegation token.- Returns:
- The RenewDelegationTokenResult.
-
expireDelegationToken
public ExpireDelegationTokenResult expireDelegationToken(byte[] hmac)
Expire a Delegation Token.
This is a convenience method for
expireDelegationToken(byte[], ExpireDelegationTokenOptions)
with default options. This will expire the token immediately. See the overload for more details.- Parameters:
hmac
- HMAC of the Delegation token- Returns:
- The ExpireDelegationTokenResult.
-
expireDelegationToken
public abstract ExpireDelegationTokenResult expireDelegationToken(byte[] hmac, ExpireDelegationTokenOptions options)
Expire a Delegation Token.
This operation is supported by brokers with version 1.1.0 or higher.
The following exceptions can be anticipated when calling
get()
on the futures obtained from theexpiryTimestamp()
method of the returnedExpireDelegationTokenResult
UnsupportedByAuthenticationException
If the request sent on PLAINTEXT/1-way SSL channels or delegation token authenticated channels.DelegationTokenDisabledException
if the delegation token feature is disabled.DelegationTokenNotFoundException
if the delegation token is not found on server.DelegationTokenOwnerMismatchException
if the authenticated user is not owner/renewer of the requested token.DelegationTokenExpiredException
if the delegation token is expired.TimeoutException
if the request was not completed in within the givenAbstractOptions.timeoutMs()
.
- Parameters:
hmac
- HMAC of the Delegation tokenoptions
- The options to use when expiring delegation token.- Returns:
- The ExpireDelegationTokenResult.
-
describeDelegationToken
public DescribeDelegationTokenResult describeDelegationToken()
Describe the Delegation Tokens.
This is a convenience method for
describeDelegationToken(DescribeDelegationTokenOptions)
with default options. This will return all the user owned tokens and tokens where user have Describe permission. See the overload for more details.- Returns:
- The DescribeDelegationTokenResult.
-
describeDelegationToken
public abstract DescribeDelegationTokenResult describeDelegationToken(DescribeDelegationTokenOptions options)
Describe the Delegation Tokens.
This operation is supported by brokers with version 1.1.0 or higher.
The following exceptions can be anticipated when calling
get()
on the futures obtained from thedelegationTokens()
method of the returnedDescribeDelegationTokenResult
UnsupportedByAuthenticationException
If the request sent on PLAINTEXT/1-way SSL channels or delegation token authenticated channels.DelegationTokenDisabledException
if the delegation token feature is disabled.TimeoutException
if the request was not completed in within the givenAbstractOptions.timeoutMs()
.
- Parameters:
options
- The options to use when describing delegation tokens.- Returns:
- The DescribeDelegationTokenResult.
-
describeConsumerGroups
public abstract DescribeConsumerGroupsResult describeConsumerGroups(java.util.Collection<java.lang.String> groupIds, DescribeConsumerGroupsOptions options)
Describe some group IDs in the cluster.- Parameters:
groupIds
- The IDs of the groups to describe.options
- The options to use when describing the groups.- Returns:
- The DescribeConsumerGroupResult.
-
describeConsumerGroups
public DescribeConsumerGroupsResult describeConsumerGroups(java.util.Collection<java.lang.String> groupIds)
Describe some group IDs in the cluster, with the default options.This is a convenience method for #
describeConsumerGroups(Collection, DescribeConsumerGroupsOptions)
with default options. See the overload for more details.- Parameters:
groupIds
- The IDs of the groups to describe.- Returns:
- The DescribeConsumerGroupResult.
-
listConsumerGroups
public abstract ListConsumerGroupsResult listConsumerGroups(ListConsumerGroupsOptions options)
List the consumer groups available in the cluster.- Parameters:
options
- The options to use when listing the consumer groups.- Returns:
- The ListGroupsResult.
-
listConsumerGroups
public ListConsumerGroupsResult listConsumerGroups()
List the consumer groups available in the cluster with the default options. This is a convenience method for #listConsumerGroups(ListConsumerGroupsOptions)
with default options. See the overload for more details.- Returns:
- The ListGroupsResult.
-
listConsumerGroupOffsets
public abstract ListConsumerGroupOffsetsResult listConsumerGroupOffsets(java.lang.String groupId, ListConsumerGroupOffsetsOptions options)
List the consumer group offsets available in the cluster.- Parameters:
options
- The options to use when listing the consumer group offsets.- Returns:
- The ListGroupOffsetsResult
-
listConsumerGroupOffsets
public ListConsumerGroupOffsetsResult listConsumerGroupOffsets(java.lang.String groupId)
List the consumer group offsets available in the cluster with the default options. This is a convenience method for #listConsumerGroupOffsets(String, ListConsumerGroupOffsetsOptions)
with default options.- Returns:
- The ListGroupOffsetsResult.
-
deleteConsumerGroups
public abstract DeleteConsumerGroupsResult deleteConsumerGroups(java.util.Collection<java.lang.String> groupIds, DeleteConsumerGroupsOptions options)
Delete consumer groups from the cluster.- Parameters:
options
- The options to use when deleting a consumer group.- Returns:
- The DeletConsumerGroupResult.
-
deleteConsumerGroups
public DeleteConsumerGroupsResult deleteConsumerGroups(java.util.Collection<java.lang.String> groupIds)
Delete consumer groups from the cluster with the default options.- Returns:
- The DeleteConsumerGroupResult.
-
metrics
public abstract java.util.Map<MetricName,? extends Metric> metrics()
Get the metrics kept by the adminClient
-
-