@Immutable public class DetailedProposal extends Object implements Comparable<DetailedProposal>
Modifier and Type | Class and Description |
---|---|
static class |
DetailedProposal.Builder |
static interface |
DetailedProposal.DetailedReasonBuilder
A callable interface for constructing a detailed reason string.
|
static class |
DetailedProposal.Result
The result of a
DetailedProposal that was generated. |
Modifier and Type | Field and Description |
---|---|
ActionType |
actionType |
int |
brokerForRebalance |
String |
reason |
double |
resourceLoad |
org.apache.kafka.common.TopicPartition |
topicPartition |
Constructor and Description |
---|
DetailedProposal(org.apache.kafka.common.TopicPartition topicPartition,
int brokerForRebalance,
double resourceLoad,
ActionType actionType,
String reason) |
Modifier and Type | Method and Description |
---|---|
static DetailedProposal.Builder |
builder(org.apache.kafka.common.TopicPartition topicPartition,
int brokerForRebalance,
double resourceLoad,
ActionType actionType)
Creates a builder for a
DetailedProposal . |
int |
compareTo(DetailedProposal detailedProposal) |
boolean |
equals(Object o) |
int |
hashCode() |
DetailedProposal.Result |
result(boolean isAccepted)
Returns a
DetailedProposal.Result of this DetailedProposal |
public final org.apache.kafka.common.TopicPartition topicPartition
public final int brokerForRebalance
public final double resourceLoad
public final ActionType actionType
public final String reason
public DetailedProposal(org.apache.kafka.common.TopicPartition topicPartition, int brokerForRebalance, double resourceLoad, ActionType actionType, String reason)
topicPartition
- - the topic partition being moved.brokerForRebalance
- - the broker which is being rebalanced right now. This broker can be the source (if it's overloaded) or the destination (if it's underloaded).resourceLoad
- - the amount of resource load to be moved as part of this proposal.
Note that for replica swaps, this represents the absolute net amount of load change of brokerForRebalance
.actionType
- - the type of proposal.reason
- - the details string reason for the proposal. e.g "Moving 100MB of disk from broker 1 to broker 2"public int compareTo(DetailedProposal detailedProposal)
compareTo
in interface Comparable<DetailedProposal>
public DetailedProposal.Result result(boolean isAccepted)
DetailedProposal.Result
of this DetailedProposal
isAccepted
- whether the proposal was accepted or not.public static DetailedProposal.Builder builder(org.apache.kafka.common.TopicPartition topicPartition, int brokerForRebalance, double resourceLoad, ActionType actionType)
DetailedProposal
.topicPartition
- - the topic partition being movedbrokerForRebalance
- - the broker which is being rebalanced right now. This broker can be the source (if it's overloaded) or the destination (if it's underloaded).resourceLoad
- - the amount of resource load to be moved as part of this proposal.
Note that for replica swaps, this represents the absolute net amount of load change of brokerForRebalance
.actionType
- - the type of proposal.