@Confluent public interface ConfluentAdmin extends Admin
Modifier and Type | Method and Description |
---|---|
AlterMirrorsResult |
alterMirrors(java.util.List<org.apache.kafka.common.requests.AlterMirrorsRequest.Op> ops,
AlterMirrorsOptions options)
Performs a state alteration for topic mirroring.
|
static ConfluentAdmin |
create(java.util.Map<java.lang.String,java.lang.Object> conf)
Create a new ConfluentAdmin with the given configuration.
|
static ConfluentAdmin |
create(java.util.Properties props)
Create a new ConfluentAdmin with the given configuration.
|
CreateAclsResult |
createCentralizedAcls(java.util.Collection<AclBinding> acls,
CreateAclsOptions options,
java.lang.String clusterId,
int writerBrokerId)
Creates access control lists (ACLs) which are bound to specific resources.
|
CreateClusterLinksResult |
createClusterLinks(java.util.Collection<org.apache.kafka.common.requests.NewClusterLink> clusterLinks,
CreateClusterLinksOptions options)
Creates links to remote clusters with the specified configurations for performing inter-cluster
communications.
|
DeleteAclsResult |
deleteCentralizedAcls(java.util.Collection<AclBindingFilter> filters,
DeleteAclsOptions options,
java.lang.String clusterId,
int writerBrokerId)
Deletes access control lists (ACLs) according to the supplied filters.
|
DeleteClusterLinksResult |
deleteClusterLinks(java.util.Collection<java.lang.String> linkNames,
DeleteClusterLinksOptions options)
Deletes established links to remote clusters with the provided link names.
|
default DescribeBrokerAdditionsResult |
describeBrokerAdditions()
Describes all the broker additions in the cluster.
|
DescribeBrokerAdditionsResult |
describeBrokerAdditions(DescribeBrokerAdditionsOptions options)
Describes all the broker additions in the cluster.
|
default DescribeBrokerRemovalsResult |
describeBrokerRemovals()
Describes all the broker removals in the cluster.
|
DescribeBrokerRemovalsResult |
describeBrokerRemovals(DescribeBrokerRemovalsOptions options)
Describes all the broker removals in the cluster.
|
DescribeMirrorsResult |
describeMirrors(java.util.Collection<java.lang.String> topics,
DescribeMirrorsOptions options)
Describes the state of mirrored topics, i.e.
|
ListClusterLinksResult |
listClusterLinks(ListClusterLinksOptions options)
Lists the cluster links.
|
ListMirrorsResult |
listMirrors(ListMirrorsOptions options)
Lists the mirrored topics, i.e.
|
default RemoveBrokersResult |
removeBrokers(java.util.List<java.lang.Integer> brokersToRemove)
Drain data off a given set of brokers and remove them from the cluster via shutdown.
|
RemoveBrokersResult |
removeBrokers(java.util.List<java.lang.Integer> brokersToRemove,
RemoveBrokersOptions options)
Drain data off a given set of brokers and remove them from the cluster via shutdown.
|
ReplicaStatusResult |
replicaStatus(java.util.Set<TopicPartition> partitions,
ReplicaStatusOptions options)
Retrieves the status of the replicas for a set of partitions, including observers.
|
alterClientQuotas, alterClientQuotas, alterConfigs, alterConfigs, alterConsumerGroupOffsets, alterConsumerGroupOffsets, alterPartitionReassignments, alterPartitionReassignments, alterReplicaLogDirs, alterReplicaLogDirs, alterUserScramCredentials, alterUserScramCredentials, close, close, close, createAcls, createAcls, createDelegationToken, createDelegationToken, createPartitions, createPartitions, createTopics, createTopics, deleteAcls, deleteAcls, deleteConsumerGroupOffsets, deleteConsumerGroupOffsets, deleteConsumerGroups, deleteConsumerGroups, deleteRecords, deleteRecords, deleteTopics, deleteTopics, describeAcls, describeAcls, describeClientQuotas, describeClientQuotas, describeCluster, describeCluster, describeConfigs, describeConfigs, describeConsumerGroups, describeConsumerGroups, describeDelegationToken, describeDelegationToken, describeFeatures, describeFeatures, describeLogDirs, describeLogDirs, describeReplicaLogDirs, describeReplicaLogDirs, describeTopics, describeTopics, describeUserScramCredentials, describeUserScramCredentials, describeUserScramCredentials, electLeaders, electLeaders, electPreferredLeaders, electPreferredLeaders, expireDelegationToken, expireDelegationToken, incrementalAlterConfigs, incrementalAlterConfigs, listConsumerGroupOffsets, listConsumerGroupOffsets, listConsumerGroups, listConsumerGroups, listOffsets, listOffsets, listPartitionReassignments, listPartitionReassignments, listPartitionReassignments, listPartitionReassignments, listPartitionReassignments, listTopics, listTopics, metrics, removeMembersFromConsumerGroup, renewDelegationToken, renewDelegationToken, updateFeatures
static ConfluentAdmin create(java.util.Properties props)
static ConfluentAdmin create(java.util.Map<java.lang.String,java.lang.Object> conf)
@Confluent ReplicaStatusResult replicaStatus(java.util.Set<TopicPartition> partitions, ReplicaStatusOptions options)
The status of the replicas will be as witnessed by the partition leader. That is, the replicas themselves may be further in progress than what's provided, however the leader has not yet processed that state update.
The following exceptions can be anticipated when calling get()
on the futures obtained from
the returned ReplicaStatusResult
:
TopicAuthorizationException
If the authenticated user didn't have describe access to the Topic.UnknownTopicOrPartitionException
If a given topic or partition does not exist.NotLeaderOrFollowerException
If the partition leader changed while the request was outstanding.TimeoutException
If the request timed out before the controller could retrieve the partition's replica status.partitions
- The partitions to retrieve replica status for.options
- The options to use.@Confluent CreateAclsResult createCentralizedAcls(java.util.Collection<AclBinding> acls, CreateAclsOptions options, java.lang.String clusterId, int writerBrokerId)
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.
acls
- The ACLs to createoptions
- The options to use when creating the ACLs.clusterId
- Cluster id for which ACLs are being updatedwriterBrokerId
- Broker id of the current centralized metadata master writer@Confluent DeleteAclsResult deleteCentralizedAcls(java.util.Collection<AclBindingFilter> filters, DeleteAclsOptions options, java.lang.String clusterId, int writerBrokerId)
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.
filters
- The filters to use.options
- The options to use when deleting the ACLs.clusterId
- Cluster id for which ACLs are being updatedwriterBrokerId
- Broker id of the current centralized metadata master writer@Confluent default RemoveBrokersResult removeBrokers(java.util.List<java.lang.Integer> brokersToRemove)
describeBrokerRemovals()
Once initiated, the brokers will be shut down and replicas will be reassigned away from them.
This is a convenience method for removeBrokers(List, RemoveBrokersOptions)
with default options. See the overload for more details.
brokersToRemove
- The broker IDs to drain off partition replicas and shut down. Must not be empty.@Confluent RemoveBrokersResult removeBrokers(java.util.List<java.lang.Integer> brokersToRemove, RemoveBrokersOptions options)
describeBrokerRemovals()
Once initiated, the brokers will be shut down and replicas will be reassigned away from them.
The following exceptions can be anticipated when calling get()
on the futures obtained from
the returned RemoveBrokersResult
:
ClusterAuthorizationException
If we didn't have sufficient permission to initiate the broker removal. None of the requests started. TimeoutException
If the request timed out before the controller could initiate the broker removal.
It cannot be guaranteed whether the removal was initiated or not. BalancerOfflineException
If the Confluent Balancer component is disabled or not started yet. BalancerOperationFailedException
If the operation failed during execution of the removal. InsufficientRebalancePlanMetricsException
If computing the rebalance plan for broker removal failed due to insufficient metrics. RebalancePlanComputationException
If computing the rebalance plan for broker removal failed for reasons other than
insufficient metrics like not enough disk space, replication factor same as the cluster size
in case of broker removal etc. InvalidBrokerRemovalException
If requested broker removal operation is invalid, examples being a non-existent
broker ID or some partitions (RF=1) becoming unavailable as a result of the removal. BrokerRemovalInProgressException
If the broker is already being removed. BrokerRemovedException
If the broker was already removed successfully. brokersToRemove
- The broker IDs to drain off partition replicas and shut down. Must not be empty.options
- The options to use for the request.@Confluent default DescribeBrokerRemovalsResult describeBrokerRemovals()
describeBrokerRemovals(DescribeBrokerRemovalsOptions)
with default options. See the overload for more details.@Confluent DescribeBrokerRemovalsResult describeBrokerRemovals(DescribeBrokerRemovalsOptions options)
BrokerRemovalDescription.shutdownStatus()
, a #BrokerShutdownStatus
denoting the status of the shutdown operation
2. #BrokerRemovalDescription.reassignmentsStatus()
, a #PartitionReassignmentsStatus
denoting the status of the partition reassignments operation
When at least one of the two has a failed status, the broker removal operation is considered failed. The user is expected to retry the removal via #removeBrokers(List)
.
When both have a completed status, the broker removal operation is considered a success.
The following exceptions can be anticipated when calling get()
on the futures obtained from
the returned DescribeBrokerRemovalsResult
:
ClusterAuthorizationException
If the authenticated user didn't have DESCRIBE
access to the cluster.TimeoutException
If the request timed out before the controller could describe the removals.BalancerOfflineException
If the Confluent Balancer component is disabled or not started yet.options
- The options to use when describing the broker removals.@Confluent default DescribeBrokerAdditionsResult describeBrokerAdditions()
describeBrokerAdditions(DescribeBrokerAdditionsOptions)
with default options. See the overload for more details.@Confluent DescribeBrokerAdditionsResult describeBrokerAdditions(DescribeBrokerAdditionsOptions options)
PartitionReassignmentsStatus.ERROR
- when the broker addition operation failed midway
2. PartitionReassignmentsStatus.PENDING
- when the intent of addition is registered but the balancer is yet to start on it (e.g still collecting metrics)
3. PartitionReassignmentsStatus.CANCELED
- when the addition is canceled (e.g due to a higher priority operation coming through)
4. PartitionReassignmentsStatus.IN_PROGRESS
- when the addition is in progress (replicas are being reassigned)
5. PartitionReassignmentsStatus.COMPLETED
- when the broker has successfully been added to the cluster
The operation's status is also exposed through the general #BalancerOperationStatus
, which can be in one of the following statuses:
1. #BalancerOperationStatus.FAILED
- when the operation has ceased before completing due to an external influence canceling it or an internal error failing it.
2. #BalancerOperationStatus.IN_PROGRESS
- when the intent of the operation is registered and is in the process of being completed.
3. #BalancerOperationStatus.SUCCESS
- when the balancer operation has completed successfully.
Additionally, each broker addition exposes a #BrokerAdditionDescription.additionError()
that provides additional context regarding the reason the operation is in the given status
The following exceptions can be anticipated when calling get()
on the futures obtained from
the returned DescribeBrokerAdditionsResult
:
BalancerOfflineException
If the Confluent Balancer component is disabled or not started yet.ClusterAuthorizationException
If the authenticated user didn't have DESCRIBE
access to the cluster.TimeoutException
If the request timed out before the controller could describe the removals.options
- The options to use when describing the broker additions@Confluent CreateClusterLinksResult createClusterLinks(java.util.Collection<org.apache.kafka.common.requests.NewClusterLink> clusterLinks, CreateClusterLinksOptions options)
get()
on the futures obtained from
the returned CreateClusterLinksResult
:
InvalidClusterLinkException
If the cluster link name is illegal.ClusterAuthorizationException
If the authenticated user didn't have CREATE
access to the cluster.ClusterLinkExistsException
If a cluster link already exists for the provided link name.TimeoutException
If the request timed out before the controller could create the cluster link.clusterLinks
- The cluster links to create.options
- The options to use when creating the cluster links.@Confluent ListClusterLinksResult listClusterLinks(ListClusterLinksOptions options)
The following exceptions can be anticipated when calling get()
on the futures obtained from
the returned ListClusterLinksResult
:
ClusterAuthorizationException
If the authenticated user didn't have DESCRIBE_CONFIGS
access to the cluster.TimeoutException
If the request timed out before the controller could list the cluster links.options
- The options to use when listing the cluster links.@Confluent DeleteClusterLinksResult deleteClusterLinks(java.util.Collection<java.lang.String> linkNames, DeleteClusterLinksOptions options)
Deleting a cluster link does not affect the cluster link's data in any way.
The following exceptions can be anticipated when calling get()
on the futures obtained from
the returned DeleteClusterLinksResult
:
InvalidClusterLinkException
If the cluster link name is illegal.ClusterAuthorizationException
If the authenticated user didn't have DELETE
access to the cluster.ClusterLinkNotFoundException
If the cluster link to delete doesn't exist.TimeoutException
If the request timed out before the controller could delete the cluster link.linkNames
- The names of the cluster links to delete.options
- The options to use when deleting the cluster links.@Confluent AlterMirrorsResult alterMirrors(java.util.List<org.apache.kafka.common.requests.AlterMirrorsRequest.Op> ops, AlterMirrorsOptions options)
The future of the individual alter mirror ops should be used for obtaining the result.
The following exceptions can be anticipated when calling get()
on the futures obtained from
the returned AlterMirrorsResult
:
ClusterAuthorizationException
If the authenticated user didn't have ALTER
access to the cluster.TimeoutException
If the request timed out before the controller could complete the mirror operation.ops
- The mirror alteration operations.options
- The options to use when altering mirrors.@Confluent ListMirrorsResult listMirrors(ListMirrorsOptions options)
The following exceptions can be anticipated when calling get()
on the future obtained from
the returned ListMirrorsResult
:
ClusterAuthorizationException
If the authenticated user didn't have DESCRIBE
access to the cluster.ClusterLinkNotFoundException
If a specific cluster link was requested and the cluster link doesn't exist.TimeoutException
If the request timed out before the controller could complete the operation.options
- The options to use when describing mirrors.@Confluent DescribeMirrorsResult describeMirrors(java.util.Collection<java.lang.String> topics, DescribeMirrorsOptions options)
The following exceptions can be anticipated when calling get()
on the futures obtained from
the returned DescribeMirrorsResult
:
ClusterAuthorizationException
If the authenticated user didn't have DESCRIBE
access to the cluster.TimeoutException
If the request timed out before the controller could complete the operation.options
- The options to use when describing mirrors.