public class BrokerRemovalContext extends Object
BrokerRemovalPhaseExecutor
.
Callers are expected to set the #proposals
variable when the removal plan is computed.
Callers are expected to set the #executorFuture
variable when the plan is submitted for
execution.Modifier and Type | Field and Description |
---|---|
Map<Integer,Optional<Long>> |
brokersToRemoveAndEpochs |
OperationProgress |
operationProgress |
PlanComputationOptions |
planComputationOptions |
BrokerRemovalCallback |
progressCallback |
Set<ExecutionProposal> |
proposals |
boolean |
shouldShutdown |
String |
uid |
Constructor and Description |
---|
BrokerRemovalContext(Map<Integer,Optional<Long>> brokersToRemoveAndEpochs,
boolean shouldShutdown,
BrokerRemovalCallback progressCallback,
String uid,
PlanComputationOptions planComputationOptions,
OperationProgress operationProgress) |
Modifier and Type | Method and Description |
---|---|
Set<Integer> |
brokersToRemove() |
Optional<Future<?>> |
executorFuture()
Executor future is only present once Executor initiates rebalance plan execution.
|
void |
executorFuture(Future<?> executorFuture) |
Exception |
planExecutionException()
Return the exception, if any, generated by the plan execution phase.
|
void |
planExecutionException(Exception executionException)
Save the exception generated by plan execution.
|
Optional<Boolean> |
planExecutionSuccess()
Check the status of the plan execution phase of broker removal.
|
void |
planExecutionSuccess(boolean executionSuccess)
Set the state of the plan execution phase of broker removal.
|
void |
proposals(Set<ExecutionProposal> proposals) |
AtomicReference<Executor.ReservationHandle> |
reservationHandle() |
public final boolean shouldShutdown
public final BrokerRemovalCallback progressCallback
public final String uid
public final PlanComputationOptions planComputationOptions
public final OperationProgress operationProgress
public Set<ExecutionProposal> proposals
public BrokerRemovalContext(Map<Integer,Optional<Long>> brokersToRemoveAndEpochs, boolean shouldShutdown, BrokerRemovalCallback progressCallback, String uid, PlanComputationOptions planComputationOptions, OperationProgress operationProgress)
brokersToRemoveAndEpochs
- - a map consisting of the broker ids to remove as keys and an
optional value of their broker epochs (needed for the shutdown request)shouldShutdown
- - whether the removal operation should include the shutdown stepprogressCallback
- - the callback to invoke when there is progress made on the removaluid
- - a unique identifier of this specific operationplanComputationOptions
- - the options to use for the removal plan computationpublic void proposals(Set<ExecutionProposal> proposals)
public void executorFuture(Future<?> executorFuture)
public AtomicReference<Executor.ReservationHandle> reservationHandle()
public Optional<Future<?>> executorFuture()
public Optional<Boolean> planExecutionSuccess()
public void planExecutionSuccess(boolean executionSuccess)
executionSuccess
- public Exception planExecutionException()
public void planExecutionException(Exception executionException)
executionException
-