@Confluent public interface ConfluentAdmin extends Admin
Modifier and Type | Method and Description |
---|---|
default AlterBrokerReplicaExclusionsResult |
alterBrokerReplicaExclusions(Map<Integer,ExclusionOp> operations)
Alters the broker replica exclusions in the cluster.
|
AlterBrokerReplicaExclusionsResult |
alterBrokerReplicaExclusions(Map<Integer,ExclusionOp> operations,
AlterBrokerReplicaExclusionsOptions options)
Alters the broker replica exclusions in the cluster.
|
AlterLeadershipPriorityResult |
alterLeadershipPriority(AlterLeadershipPrioritySpec spec,
AlterLeadershipPriorityOptions options)
Change broker leadership priority by promoting / demoting a list of brokerIds for a given reason.
|
AlterMirrorsResult |
alterMirrors(Map<String,AlterMirrorOp> ops,
AlterMirrorsOptions options)
Performs a state alteration for topic mirroring.
|
static ConfluentAdmin |
create(Map<String,Object> conf)
Create a new ConfluentAdmin with the given configuration.
|
static ConfluentAdmin |
create(Properties props)
Create a new ConfluentAdmin with the given configuration.
|
CreateAclsResult |
createCentralizedAcls(Collection<AclBinding> acls,
CreateAclsOptions options,
String clusterId,
int writerBrokerId)
Creates access control lists (ACLs) which are bound to specific resources.
|
CreateClusterLinksResult |
createClusterLinks(Collection<NewClusterLink> clusterLinks,
CreateClusterLinksOptions options)
Creates links to remote clusters with the specified configurations for performing inter-cluster
communications.
|
DeleteAclsResult |
deleteCentralizedAcls(Collection<AclBindingFilter> filters,
DeleteAclsOptions options,
String clusterId,
int writerBrokerId)
Deletes access control lists (ACLs) according to the supplied filters.
|
DeleteClusterLinksResult |
deleteClusterLinks(Collection<String> linkNames,
DeleteClusterLinksOptions options)
Deletes established links to remote clusters with the provided link names.
|
default DescribeBalancerStatusResult |
describeBalancerStatus()
Describes status of Confluent Balancer component.
|
DescribeBalancerStatusResult |
describeBalancerStatus(DescribeBalancerStatusOptions options)
Describes status of confluent balancer component.
|
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.
|
default DescribeBrokerReplicaExclusionsResult |
describeBrokerReplicaExclusions()
Describes the active broker replica exclusions in the cluster.
|
DescribeBrokerReplicaExclusionsResult |
describeBrokerReplicaExclusions(DescribeBrokerReplicaExclusionsOptions options)
Describes the active broker replica exclusions in the cluster.
|
DescribeClusterLinksResult |
describeClusterLinks(DescribeClusterLinksOptions options)
Describe the cluster links.
|
default DescribeEvenClusterLoadStatusResult |
describeEvenClusterLoadStatus()
Describe the status of the even cluster load operation.
|
DescribeEvenClusterLoadStatusResult |
describeEvenClusterLoadStatus(DescribeEvenClusterLoadStatusOptions options)
Describe the status of the even cluster load operation.
|
DescribeLeadershipPriorityResult |
describeLeadershipPriority(DescribeLeadershipPriorityOptions options)
Describe all brokers with demoted leadership priority and their list of reasons for demotion.
|
DescribeMirrorsResult |
describeMirrors(Collection<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(List<Integer> brokersToRemove)
Drain data off a given set of brokers and remove them from the cluster via shutdown.
|
RemoveBrokersResult |
removeBrokers(List<Integer> brokersToRemove,
RemoveBrokersOptions options)
Drain data off a given set of brokers and remove them from the cluster via shutdown.
|
ReplicaStatusResult |
replicaStatus(Set<TopicPartition> partitions,
ReplicaStatusOptions options)
Retrieves the status of the replicas for a set of partitions, including observers.
|
default TriggerEvenClusterLoadResult |
triggerEvenClusterLoad()
Triggers the even cluster load operation.
|
TriggerEvenClusterLoadResult |
triggerEvenClusterLoad(TriggerEvenClusterLoadOptions options)
Triggers the even cluster load operation.
|
abortTransaction, abortTransaction, alterClientQuotas, alterClientQuotas, alterConfigs, alterConfigs, alterConsumerGroupOffsets, alterConsumerGroupOffsets, alterPartitionReassignments, alterPartitionReassignments, alterReplicaLogDirs, alterReplicaLogDirs, alterUserScramCredentials, alterUserScramCredentials, close, close, createAcls, createAcls, createDelegationToken, createDelegationToken, createPartitions, createPartitions, createTopics, createTopics, deleteAcls, deleteAcls, deleteConsumerGroupOffsets, deleteConsumerGroupOffsets, deleteConsumerGroups, deleteConsumerGroups, deleteRecords, deleteRecords, deleteTopics, deleteTopics, deleteTopics, deleteTopics, describeAcls, describeAcls, describeClientQuotas, describeClientQuotas, describeCluster, describeCluster, describeConfigs, describeConfigs, describeConsumerGroups, describeConsumerGroups, describeDelegationToken, describeDelegationToken, describeFeatures, describeFeatures, describeLogDirs, describeLogDirs, describeProducers, describeProducers, describeReplicaLogDirs, describeReplicaLogDirs, describeTopics, describeTopics, describeTopics, describeTopics, describeTransactions, describeTransactions, describeUserScramCredentials, describeUserScramCredentials, describeUserScramCredentials, electLeaders, electLeaders, expireDelegationToken, expireDelegationToken, incrementalAlterConfigs, incrementalAlterConfigs, listConsumerGroupOffsets, listConsumerGroupOffsets, listConsumerGroups, listConsumerGroups, listOffsets, listOffsets, listPartitionReassignments, listPartitionReassignments, listPartitionReassignments, listPartitionReassignments, listPartitionReassignments, listTopics, listTopics, listTransactions, listTransactions, metrics, removeMembersFromConsumerGroup, renewDelegationToken, renewDelegationToken, unregisterBroker, unregisterBroker, updateFeatures
static ConfluentAdmin create(Properties props)
static ConfluentAdmin create(Map<String,Object> conf)
@Confluent ReplicaStatusResult replicaStatus(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(Collection<AclBinding> acls, CreateAclsOptions options, 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(Collection<AclBindingFilter> filters, DeleteAclsOptions options, 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(List<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(List<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. Query its status with describeBalancerStatus()
for more informationBalancerLoadError
If the Confluent Balancer component failed to load. Query its status with describeBalancerStatus()
for more informationBalancerOperationFailedException
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. BalancerBrokerExcludedForReplicaPlacementException
If there are active broker replica exclusions in the cluster for brokers that are not part of the removal request.
See describeBrokerReplicaExclusions()
for more information 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. Query its status with describeBalancerStatus()
for more informationBalancerLoadError
If the Confluent Balancer component failed to load. Query its status with describeBalancerStatus()
for more informationoptions
- 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. Query its status with describeBalancerStatus()
for more informationBalancerLoadError
If the Confluent Balancer component failed to load. Query its status with describeBalancerStatus()
for more informationClusterAuthorizationException
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 default DescribeBalancerStatusResult describeBalancerStatus()
describeBalancerStatus(DescribeBalancerStatusOptions)
with default options. See the overload for more details.@Confluent DescribeBalancerStatusResult describeBalancerStatus(DescribeBalancerStatusOptions options)
BalancerStatus
.
In addition to the status field, the #BalancerStatusDescription.balancerOperationError()
gives context about the status of the balancer, e.g. why the balancer is in error state etc.
The following exceptions can be anticipated when calling get()
on the future
obtained from the returned DescribeBalancerStatusResult
:
ClusterAuthorizationException
If the authenticated user didn't have DESCRIBE
access to the cluster.TimeoutException
If the request timed out before the controller could fetch balancer status.options
- The options to use when fetching the balancer status.@Confluent default TriggerEvenClusterLoadResult triggerEvenClusterLoad()
describeEvenClusterLoadStatus()
@Confluent TriggerEvenClusterLoadResult triggerEvenClusterLoad(TriggerEvenClusterLoadOptions options)
ConfluentConfigs.BALANCER_AUTO_HEAL_MODE_CONFIG
is configured to
ConfluentConfigs.BalancerSelfHealMode.ANY_UNEVEN_LOAD
,
then Confluent Balancer is continuously monitoring the cluster and determining whether it
can improve the balance of the cluster's load. This API helps manually trigger the operation.
The following exceptions can be anticipated when calling get()
on the futures obtained from
the returned TriggerEvenClusterLoadResult
:
ClusterAuthorizationException
If we didn't have sufficient permission to request rebalance. The request would not be started. TimeoutException
If the request timed out as no response was received from the controller, possible reasons
could be request was faulted or response being dropped due to some network issue etc. The
status of the even cluster load is unknown in this case.
BalancerOfflineException
If the Confluent Balancer component is disabled or not started yet. Query its status with describeBalancerStatus()
for more informationBalancerLoadError
If the Confluent Balancer component failed to load. Query its status with describeBalancerStatus()
for more informationBrokerRemovalInProgressException
If a broker removal operation is in progress. BrokerAdditionInProgressException
If a broker addition operation is in progress. EvenClusterLoadTaskInProgressException
If an even cluster load operation is already in progress. BalancerBrokerExcludedForReplicaPlacementException
If there are active broker replica exclusions in the cluster.
See describeBrokerReplicaExclusions()
for more information options
- The options to use for the request.@Confluent default DescribeEvenClusterLoadStatusResult describeEvenClusterLoadStatus()
describeEvenClusterLoadStatus(DescribeEvenClusterLoadStatusOptions)
with default
options.
See the overload for more details.@Confluent DescribeEvenClusterLoadStatusResult describeEvenClusterLoadStatus(DescribeEvenClusterLoadStatusOptions options)
get()
on the future
obtained from the returned DescribeEvenClusterLoadStatusResult
:
ClusterAuthorizationException
If the authenticated user didn't have DESCRIBE
access to the cluster.TimeoutException
If the request timed out before the controller could fetch even cluster load status.options
- The options to use when fetching the even cluster load status.@Confluent AlterBrokerReplicaExclusionsResult alterBrokerReplicaExclusions(Map<Integer,ExclusionOp> operations, AlterBrokerReplicaExclusionsOptions options)
ExclusionOp
s or fail for all.
The following exceptions can be anticipated when calling get()
on the future
obtained from the returned AlterBrokerReplicaExclusionsResult
:
ClusterAuthorizationException
If the authenticated user didn't have ALTER
access to the cluster.TimeoutException
If the request timed out before the controller could fetch even cluster load status.InvalidBrokerReplicaExclusionException
If any given ExclusionOp.reason()
is invalid (for the constraints, see ExclusionOp.reason()
),
or any other exception.UnrepresentableBrokerIdException
If an invalid broker ID was provided.BrokerReplicaExclusionNotFoundException
If an attempt to remove an exclusion which doesn't exist is made.operations
- a map of broker ID to the desired ExclusionOp
to be performed on that broker.options
- The options to use when altering the broker replica exclusions.@Confluent default AlterBrokerReplicaExclusionsResult alterBrokerReplicaExclusions(Map<Integer,ExclusionOp> operations)
ExclusionOp
s or fail for all.
This is a convenience method for alterBrokerReplicaExclusions(Map, AlterBrokerReplicaExclusionsOptions)
with default options. See the overload for more details.
operations
- a map of broker ID to the desired ExclusionOp
to be performed on that broker.@Confluent DescribeBrokerReplicaExclusionsResult describeBrokerReplicaExclusions(DescribeBrokerReplicaExclusionsOptions options)
get()
on the future
obtained from the returned DescribeBrokerReplicaExclusionsResult
:
ClusterAuthorizationException
If the authenticated user didn't have DESCRIBE
access to the cluster.TimeoutException
If the request timed out before the controller could fetch even cluster load status.options
- The options to use when describing the broker replica exclusions.@Confluent default DescribeBrokerReplicaExclusionsResult describeBrokerReplicaExclusions()
This is a convenience method for describeBrokerRemovals(DescribeBrokerRemovalsOptions)
with default options. See the overload for more details.
@Confluent CreateClusterLinksResult createClusterLinks(Collection<NewClusterLink> clusterLinks, CreateClusterLinksOptions options)
get()
on the futures obtained from
the returned CreateClusterLinksResult
:
BalancerOfflineException
If the Confluent Balancer component is disabled or not started yet. Query its status with describeBalancerStatus()
for more informationBalancerLoadError
If the Confluent Balancer component failed to load. Query its status with describeBalancerStatus()
for more informationInvalidClusterLinkException
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
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(Collection<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(Map<String,AlterMirrorOp> 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
:
TopicAuthorizationException
If the authenticated user didn't have ALTER
access to the topic.TimeoutException
If the request timed out before the controller could complete the mirror operation.ops
- The mirror alteration operation for each topic.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(Collection<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.@Confluent AlterLeadershipPriorityResult alterLeadershipPriority(AlterLeadershipPrioritySpec spec, AlterLeadershipPriorityOptions options)
The following exceptions can be anticipated when calling get()
on the futures obtained from
the returned AlterLeadershipPriorityResult
:
org.apache.kafka.common.errors.BrokerAlreadyDemotedException
If the specified brokerId has already been demoted.org.apache.kafka.common.errors.BrokerNeverDemotedException
If the specified brokerId has never been demoted.ClusterAuthorizationException
If the authenticated user didn't have ALTER
access to the cluster.InvalidRequestException
If an invalid reason or no brokerIds are specified as request arguments.TimeoutException
If the request timed out before the controller could complete the operation.spec
- The request arguments for changing leadership priority request.options
- The options to use when changing leadership priority.@Confluent DescribeLeadershipPriorityResult describeLeadershipPriority(DescribeLeadershipPriorityOptions options)
The following exceptions can be anticipated when calling get()
on the futures obtained from
the returned DescribeLeadershipPriorityResult
:
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 leadership priority.@Confluent DescribeClusterLinksResult describeClusterLinks(DescribeClusterLinksOptions options)
The following exceptions can be anticipated when calling get()
on the futures obtained from
the returned DescribeClusterLinksResult
:
ClusterAuthorizationException
If the authenticated user didn't have DESCRIBE
access to the cluster.NotControllerException
If the Kafka broker is not a controller.ClusterLinkDisabledException
If cluster link is disabled.TimeoutException
If the request timed out before the controller could list the cluster links.options
- The options to use when describing the cluster links. When no link name is provided,
all the cluster links descriptions will be returned.