public class ReplicaBalancingAction extends Object implements BalancingAction
Constructor and Description |
---|
ReplicaBalancingAction(org.apache.kafka.common.TopicPartition tp,
Disk sourceDisk,
Disk destinationDisk,
ActionType actionType)
Constructor for creating a balancing proposal with given topic partition, source and destination disk (on the same broker),
and balancing action type.
|
ReplicaBalancingAction(org.apache.kafka.common.TopicPartition sourceTp,
Disk sourceDisk,
Disk destinationDisk,
ActionType actionType,
org.apache.kafka.common.TopicPartition destinationTp)
Constructor for creating a balancing proposal with given topic partitions, source and destination disk (on the same broker),
balancing action type and the topic partition of replica to swap with.
|
ReplicaBalancingAction(org.apache.kafka.common.TopicPartition tp,
Integer sourceBrokerId,
Integer destinationBrokerId,
ActionType actionType)
Constructor for creating a balancing proposal with given topic partition, source and destination broker id, and
balancing action type.
|
ReplicaBalancingAction(org.apache.kafka.common.TopicPartition sourceTp,
Integer sourceBrokerId,
Integer destinationBrokerId,
ActionType actionType,
org.apache.kafka.common.TopicPartition destinationTp)
Constructor for creating a balancing proposal with given topic partitions, source and destination broker id, balancing
action type and the topic partition of replica to swap with.
|
Modifier and Type | Method and Description |
---|---|
ActionAcceptance |
actionAcceptance(GoalBalancingActionAcceptance actionAcceptance,
ClusterModel clusterModel) |
ActionType |
balancingAction()
Get the type of action that provides balancing.
|
Integer |
destinationBrokerId()
Get the destination broker Id.
|
String |
destinationBrokerLogdir()
Get the destination broker logdir.
|
String |
destinationTopic()
Get topic name of the replica to swap with at the destination.
|
org.apache.kafka.common.TopicPartition |
destinationTopicPartition()
Get the destination topic partition to swap with.
|
boolean |
equals(Object other)
Compare the given object with this object.
|
Map<String,Object> |
getJsonStructure()
Return an object that can be further used
to encode into JSON
|
int |
hashCode() |
int |
partitionId()
Get the partition Id that is impacted by the balancing action.
|
boolean |
selfSatisfied(ClusterModel clusterModel,
GoalBalancingActionAcceptance actionAcceptance) |
Integer |
sourceBrokerId()
Get the source broker id that is impacted by the balancing action.
|
String |
sourceBrokerLogdir()
Get the source broker logdir.
|
String |
topic()
Get topic name of the impacted partition.
|
org.apache.kafka.common.TopicPartition |
topicPartition()
Get the source topic partition.
|
String |
toString()
Get string representation of this balancing proposal.
|
public ReplicaBalancingAction(org.apache.kafka.common.TopicPartition tp, Integer sourceBrokerId, Integer destinationBrokerId, ActionType actionType)
tp
- Topic partition of the replica.sourceBrokerId
- Source broker id of the replica.destinationBrokerId
- Destination broker id of the replica.actionType
- Action type.public ReplicaBalancingAction(org.apache.kafka.common.TopicPartition sourceTp, Integer sourceBrokerId, Integer destinationBrokerId, ActionType actionType, org.apache.kafka.common.TopicPartition destinationTp)
sourceTp
- Topic partition of the source replica.sourceBrokerId
- Source broker id of the replica.destinationBrokerId
- Destination broker id of the replica.actionType
- Action type.destinationTp
- Topic partition of the replica to swap with, null if there is no replica to swap with, i.e.
only move source replica to destination broker.public ReplicaBalancingAction(org.apache.kafka.common.TopicPartition tp, Disk sourceDisk, Disk destinationDisk, ActionType actionType)
tp
- Topic partition of the replica.sourceDisk
- Source disk of the replica.destinationDisk
- Destination disk of the replica.actionType
- Action type.public ReplicaBalancingAction(org.apache.kafka.common.TopicPartition sourceTp, Disk sourceDisk, Disk destinationDisk, ActionType actionType, org.apache.kafka.common.TopicPartition destinationTp)
sourceTp
- Topic partition of the source replica.sourceDisk
- Source disk of the replica.destinationDisk
- Destination disk of the replica.actionType
- Action type.destinationTp
- Topic partition of the replica to swap with, null if there is no replica to swap with, i.e.
only move source replica to destination disk.public org.apache.kafka.common.TopicPartition destinationTopicPartition()
public String destinationTopic()
public int partitionId()
public String topic()
public org.apache.kafka.common.TopicPartition topicPartition()
topicPartition
in interface BalancingAction
public String sourceBrokerLogdir()
public String destinationBrokerLogdir()
public Integer sourceBrokerId()
public Integer destinationBrokerId()
public ActionType balancingAction()
BalancingAction
balancingAction
in interface BalancingAction
public ActionAcceptance actionAcceptance(GoalBalancingActionAcceptance actionAcceptance, ClusterModel clusterModel)
actionAcceptance
in interface BalancingAction
public boolean selfSatisfied(ClusterModel clusterModel, GoalBalancingActionAcceptance actionAcceptance)
selfSatisfied
in interface BalancingAction
public Map<String,Object> getJsonStructure()
getJsonStructure
in interface BalancingAction
public String toString()
public boolean equals(Object other)