Class BrokerRemovalDescription
java.lang.Object
org.apache.kafka.clients.admin.BrokerRemovalDescription
A description of a broker removal, which has been listed via
ConfluentAdmin.describeBrokerRemovals(DescribeBrokerRemovalsOptions).
The status of the removal is tracked by two separate status fields:
1. #shutdownStatus(), a #BrokerShutdownStatus
denoting the status of the shutdown operation
2. #reassignmentsStatus(), a #PartitionReassignmentsStatus
denoting the status of the partition reassignments operation
3. #isShutdownScheduled(), a boolean to decide whether to
shutdown the broker after excluding.
4. #brokerReplicaExclusionStatus(), a #BrokerReplicaExclusionStatus
denoting the status of excluding the broker and removing the exclusion.
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 #ConfluentAdmin.removeBrokers(List).
When both have a completed status, the broker removal operation is considered a success.-
Constructor Summary
ConstructorsConstructorDescriptionBrokerRemovalDescription(Integer brokerId, BalancerOperationStatus generalOperationStatus, BrokerShutdownStatus brokerShutdownStatus, PartitionReassignmentsStatus partitionReassignmentsStatus, BrokerReplicaExclusionStatus brokerReplicaExclusionStatus, boolean shutdownScheduled, Optional<BrokerRemovalError> removalError, long createTimeMs, long lastUpdateTimeMs) -
Method Summary
Modifier and TypeMethodDescriptionbrokerId()Nullable for server versions below 7.0, the status of the broker replica exclusion subtask of the broker removal operation.longThe timestamp at which this broker removal operation was createderror()The error that failed the broker removal operation.Nullable, the current high-level status of the broker removal operation.booleanlongThe timestamp at which this broker removal operation was last updatedThe status of the partition reassignments, draining replicas out of the to be removed broker.The error that failed the broker removal operation.The status of the broker shutdown subtask of the broker removal operation.toString()
-
Constructor Details
-
BrokerRemovalDescription
public BrokerRemovalDescription(Integer brokerId, BalancerOperationStatus generalOperationStatus, BrokerShutdownStatus brokerShutdownStatus, PartitionReassignmentsStatus partitionReassignmentsStatus, BrokerReplicaExclusionStatus brokerReplicaExclusionStatus, boolean shutdownScheduled, Optional<BrokerRemovalError> removalError, long createTimeMs, long lastUpdateTimeMs)
-
-
Method Details
-
brokerId
-
createTimeMs
public long createTimeMs()The timestamp at which this broker removal operation was created -
lastUpdateTimeMs
public long lastUpdateTimeMs()The timestamp at which this broker removal operation was last updated -
generalOperationStatus
Nullable, the current high-level status of the broker removal operation. -
brokerReplicaExclusionStatus
Nullable for server versions below 7.0, the status of the broker replica exclusion subtask of the broker removal operation. BrokerReplicaExclusionStatus that can have the following states: 1.BrokerReplicaExclusionStatus.PENDING- When the broker is yet to be excluded from having replicas on it. 2.BrokerReplicaExclusionStatus.IN_PROGRESS- When the broker is being excluded from having replicas on it. 3.BrokerReplicaExclusionStatus.EXCLUDED- When the broker has been excluded from the cluster. 4.BrokerReplicaExclusionStatus.REMOVING- When the exclusion is in the process of being removed. 5.BrokerReplicaExclusionStatus.ERROR- When there was an exception during the broker replica exclusion task either while excluding the broker or while removing the exclusion - ultimately, the task did not succeed. 6.BrokerReplicaExclusionStatus.CANCELED- When the exclusion operation is canceled due to external influence before the broker replica exclusion task. 7.BrokerReplicaExclusionStatus.COMPLETED- When the broker has been excluded successfully. 8.BrokerReplicaExclusionStatus.UNKNOWN- Kept for future-compatibility reasons - clients will fall-back to this status when they receive an unrecognized one -
isShutdownScheduled
public boolean isShutdownScheduled()- Returns:
- a boolean, indicating whether this broker removal operation was scheduled to shutdown the broker.
-
shutdownStatus
The status of the broker shutdown subtask of the broker removal operation. Broker shutdown can be in one of the following states: 1.BrokerShutdownStatus.ERROR- when the broker removal operation failed midway and unable to initiate a shutdown on the broker. The user is expected to either retry the removal or cancel it. 2.BrokerShutdownStatus.PENDING- when the broker is yet to be shut down. 3.BrokerShutdownStatus.CANCELED- when the shutdown operation is canceled (e.g due to the initial reassignment plan computation failing) 4.BrokerShutdownStatus.COMPLETED- when the broker has successfully been shut down. If this status is returned, the broker to be removed is no longer part of the Kafka cluster. -
reassignmentsStatus
The status of the partition reassignments, draining replicas out of the to be removed broker. Partition reassignments can be in one of five states: 1.PartitionReassignmentsStatus.ERROR- when the broker removal operation failed midway. It is unknown whether any replicas were moved away or not. The user is expected to either retry the removal or cancel it. 2.PartitionReassignmentsStatus.PENDING- when the partition reassignments plan is being computed. Reassignments are yet to happen. 3.PartitionReassignmentsStatus.IN_PROGRESS- when the partitions are actively being reassigned. 4.PartitionReassignmentsStatus.CANCELED- when the partition drain was cancelled because of unrelated factors, like the broker being restarted or the shutdown failing 5.PartitionReassignmentsStatus.COMPLETED- when all the replicas of the to be removed broker were reassigned away from it. If this status is returned, the broker to be removed has no replicas on it. -
removalError
The error that failed the broker removal operation. Prefer using the newer #error()method. -
error
The error that failed the broker removal operation. -
toString
-