public class BalancingConstraint extends Object
Constructor and Description |
---|
BalancingConstraint(BalancingConstraint original) |
BalancingConstraint(KafkaCruiseControlConfig config)
Constructor for Balancing Constraint.
|
Modifier and Type | Method and Description |
---|---|
double |
allowedCapacityForBroker(Resource resource,
Capacity capacity)
Get the total amount of allowed capacity for one broker, in the respective unit of the given
Resource (MiB, KB, etc.). |
double |
allowedCapacityForBroker(Resource resource,
double totalCapacity)
|
double |
desiredCapacityForBroker(Resource resource,
Capacity capacity)
Get the total amount of desired capacity for one broker, in the respective unit of the given
Resource (MiB, KB, etc.). |
Double |
goalViolationDistributionThresholdMultiplier()
Get goal violation distribution threshold multiplier to be used in detection and fixing goal violations.
|
double |
hotPartitionUtilizationThreshold() |
Double |
leaderReplicaBalancePercentage()
Get leader replica balance percentage for
LeaderReplicaDistributionGoal . |
double |
lowUtilizationThreshold(Resource resource,
OptimizationOptions options)
Get the low utilization threshold for a resource.
|
Long |
maxReplicasPerBroker()
Get maximum number of replicas per broker.
|
Double |
replicaBalancePercentage()
Get replica balance percentage for
ReplicaDistributionGoal . |
double |
resourceBalancePercentage(Resource resource)
Get the balance percentage for the requested resource.
|
List<Resource> |
resources()
Get the balancing for different resources.
|
void |
setCapacityThreshold(double capacityThreshold)
Set alive resource capacity threshold for all resources.
|
Properties |
setProps(Properties props) |
void |
setResourceBalancePercentage(double resourceBalancePercentage)
Set a common resource balance percentage for all resources.
|
Double |
topicReplicaBalancePercentage()
Get topic replica balance percentage for
TopicReplicaDistributionGoal . |
String |
toString()
Get string representation of
BalancingConstraint . |
public BalancingConstraint(KafkaCruiseControlConfig config)
public BalancingConstraint(BalancingConstraint original)
public Properties setProps(Properties props)
public Long maxReplicasPerBroker()
public Double replicaBalancePercentage()
ReplicaDistributionGoal
.public Double leaderReplicaBalancePercentage()
LeaderReplicaDistributionGoal
.public Double topicReplicaBalancePercentage()
TopicReplicaDistributionGoal
.public Double goalViolationDistributionThresholdMultiplier()
public double resourceBalancePercentage(Resource resource)
resource
- Resource for which the balance percentage will be provided.public double allowedCapacityForBroker(Resource resource, Capacity capacity)
Resource
(MiB, KB, etc.).resource
- The resource for which to find allowed capacity.capacity
- The total capacity for given resource (per broker / host).Capacity.totalCapacityFor(Resource)
,
denoting the total amount of allowed capacity in the respective unit of the given Resource
(MiB, KB, etc.).
In the exceptional cases where the capacity is zero or negative, the same capacity value is returned.public double allowedCapacityForBroker(Resource resource, double totalCapacity)
public double desiredCapacityForBroker(Resource resource, Capacity capacity)
Resource
(MiB, KB, etc.).
Desired capacity denotes the amount of resource usage we would prefer a broker to be at once it goes over its allowed capacity.resource
- The resource for which to find allowed capacity.capacity
- The total capacity for given resource (per broker / host).allowedCapacityForBroker(Resource, Capacity)
,
denoting the total amount of desired capacity in the respective unit of the given Resource
(MiB, KB, etc.).
In the exceptional cases where the capacity is zero or negative, the same capacity value is returned.public double lowUtilizationThreshold(Resource resource, OptimizationOptions options)
resource
- Resource for which the low utilization threshold will be provided.options
- Optimization options for the resource.public double hotPartitionUtilizationThreshold()
public void setResourceBalancePercentage(double resourceBalancePercentage)
resourceBalancePercentage
- Common balance percentage for all resources.public void setCapacityThreshold(double capacityThreshold)
capacityThreshold
- Common capacity threshold for all resources in alive brokers.public String toString()
BalancingConstraint
.