public abstract class SbcAbstractScheduleBrokerRemovalEvent extends SbcEvent
Modifier and Type | Class and Description |
---|---|
static class |
SbcAbstractScheduleBrokerRemovalEvent.EligibleBrokers |
SbcEvent.SbcEventHandlerResult
Modifier and Type | Field and Description |
---|---|
protected List<Integer> |
brokersToRemove |
eventContext, LOG
Constructor and Description |
---|
SbcAbstractScheduleBrokerRemovalEvent(SbcContext context,
List<Integer> brokersToRemove,
boolean shouldShutdown,
kafka.controller.ClusterBalanceManager.BalanceManagerOperationInvocationClientCallback cb) |
Modifier and Type | Method and Description |
---|---|
protected void |
respondToClient(org.apache.kafka.common.requests.ApiError error,
SbcEvent.SbcEventHandlerResult result)
This method is invoked when an operation completes (the
SbcEvent.SbcEventHandlerResult does not indicate that any resources are needed
to continue. |
protected SbcEvent.SbcEventHandlerResult |
validateAndScheduleRemoval(kafka.common.AliveBrokersMetadata aliveBrokersMetadata,
kafka.common.TopicsMetadataSnapshot topicsMetadataSnapshot) |
protected SbcAbstractScheduleBrokerRemovalEvent.EligibleBrokers |
validateIfBrokersCanBeRemoved(kafka.common.TopicsMetadataSnapshot topicsMetadataSnapshot,
kafka.common.AliveBrokersMetadata aliveBrokersMetadata)
Validate if the given set of brokers can be removed from the cluster.
|
public SbcAbstractScheduleBrokerRemovalEvent(SbcContext context, List<Integer> brokersToRemove, boolean shouldShutdown, kafka.controller.ClusterBalanceManager.BalanceManagerOperationInvocationClientCallback cb)
protected SbcEvent.SbcEventHandlerResult validateAndScheduleRemoval(kafka.common.AliveBrokersMetadata aliveBrokersMetadata, kafka.common.TopicsMetadataSnapshot topicsMetadataSnapshot)
protected void respondToClient(org.apache.kafka.common.requests.ApiError error, SbcEvent.SbcEventHandlerResult result)
SbcEvent
SbcEvent.SbcEventHandlerResult
does not indicate that any resources are needed
to continue. Events which need to respond to clients via a client callback will respond here.respondToClient
in class SbcEvent
error
- the ApiError value for success or failure. handleEvent operations which completed normally will have a result of ApiError.NONE.result
- The SbcEventHandlerResult which was returned from SbcEvent.handleEvent()
}.protected SbcAbstractScheduleBrokerRemovalEvent.EligibleBrokers validateIfBrokersCanBeRemoved(kafka.common.TopicsMetadataSnapshot topicsMetadataSnapshot, kafka.common.AliveBrokersMetadata aliveBrokersMetadata)
aliveBrokersMetadata
- the latest snapshot of broker metadatatopicsMetadataSnapshot
- the latest snapshot of topic metadataSbcAbstractScheduleBrokerRemovalEvent.EligibleBrokers
consisting of the broker ids that are eligible to be removed
and the broker ids that are non-existent (offline and have 0 replicas placed on them)
in the clusterorg.apache.kafka.common.errors.InvalidBrokerRemovalException
- in cases where the validation fails due to the number of leftover brokers
in the cluster post-shutdown being less than any partition's replication factor, or the removal trying to remove a replica from an offline partition