public final class ResourceUtilizationRatioThresholdsProvider extends Object
NOTE: If cell is not enabled, all brokers are automatically assigned the default cell id Cell.DEFAULT_CELL_ID
,
so querying for cluster-wide cell and the default cell id should return the same result.
Constructor and Description |
---|
ResourceUtilizationRatioThresholdsProvider(ResourceUtilizationRatioThresholds clusterThresholds,
Map<Integer,ResourceUtilizationRatioThresholds> cellThresholds) |
Modifier and Type | Method and Description |
---|---|
double |
balanceLowerThreshold(Broker broker)
The lower bound of the resource utilization band towards which a resource distribution goal will try to balance the brokers.
|
double |
balanceLowerThreshold(int cellId)
The lower bound of the resource utilization band towards which a resource distribution goal will try to balance the brokers.
|
double |
balanceUpperThreshold(Broker broker)
The upper bound of the resource utilization band towards which a resource distribution goal will try to balance the
brokers.
|
double |
balanceUpperThreshold(int cellId)
The upper bound of the resource utilization band towards which a resource distribution goal will try to balance the
brokers.
|
Map<Integer,ResourceUtilizationRatioThresholds> |
cellsThresholds()
Returns the underlying per-cell thresholds.
|
ResourceUtilizationRatioThresholds |
clusterThresholds()
Returns the underlying cluster-wide thresholds.
|
double |
lowUtilizationRatio(Broker broker)
Retrieves the low utilization ratio of the cluster when the cell for the broker we are checking is not assigned to a real cell; otherwise,
returns the ratio for the cell associated with broker.
|
double |
lowUtilizationRatio(int cellId)
Retrieves the low utilization ratio of the cluster when the cell id we are checking is not assigned to a real cell; otherwise,
returns the ratio for the cell associated with that cell id.
|
double |
meanUtilizationRatio(Broker broker)
The arithmetic mean utilization ratio of all brokers within a cell or within the cluster if the broker is not part of a cell.
|
double |
meanUtilizationRatio(int cellId)
The arithmetic mean utilization ratio of all brokers within a cell or within the cluster if the broker is not part of a cell.
|
Resource |
resource()
The
Resource to which the thresholds correspond. |
public ResourceUtilizationRatioThresholdsProvider(ResourceUtilizationRatioThresholds clusterThresholds, Map<Integer,ResourceUtilizationRatioThresholds> cellThresholds)
public ResourceUtilizationRatioThresholds clusterThresholds()
public Map<Integer,ResourceUtilizationRatioThresholds> cellsThresholds()
public double balanceUpperThreshold(Broker broker)
public double balanceUpperThreshold(int cellId)
public double balanceLowerThreshold(Broker broker)
public double balanceLowerThreshold(int cellId)
public double lowUtilizationRatio(Broker broker)
broker
- the broker we use to find its cell.public double lowUtilizationRatio(int cellId)
cellId
- the cell id we use to find it low utilization ratio.public double meanUtilizationRatio(Broker broker)
public double meanUtilizationRatio(int cellId)