public class ResourceDistributionStatsSnapshot extends AbstractDistributionStatsSnapshot
Modifier and Type | Class and Description |
---|---|
static class |
ResourceDistributionStatsSnapshot.ResourceValueThresholds
A POJO that holds particular thresholds related to the balance of particular
Resource distribution, in absolute values. |
LOG, maxBrokerResource, minBrokerResource
Modifier and Type | Method and Description |
---|---|
int |
numBrokersUnderLowUtilizationThreshold() |
ResourceDistributionStatsSnapshot.ResourceValueThresholds |
resourceValueThresholds() |
String |
toString() |
static Optional<ResourceDistributionStatsSnapshot> |
tryCompute(DistributionThresholdUtils.ResourcePercentageThresholds percentageThresholds,
Collection<BrokerResourceStats> resources)
Attempts to compute a
ResourceDistributionStatsSnapshot by converting
the given DistributionThresholdUtils.ResourcePercentageThresholds to absolute values and evaluating them
against the respective lower, upper balance limits and minimum utilization thresholds. |
maxBrokerResource, maxResource, minBrokerResource, minResource
public int numBrokersUnderLowUtilizationThreshold()
public ResourceDistributionStatsSnapshot.ResourceValueThresholds resourceValueThresholds()
public static Optional<ResourceDistributionStatsSnapshot> tryCompute(DistributionThresholdUtils.ResourcePercentageThresholds percentageThresholds, Collection<BrokerResourceStats> resources) throws IllegalArgumentException
ResourceDistributionStatsSnapshot
by converting
the given DistributionThresholdUtils.ResourcePercentageThresholds
to absolute values and evaluating them
against the respective lower, upper balance limits and minimum utilization thresholds.
In the case of a cluster whose brokers have large differences in capacities,
the computation will fail and an empty optional will be returned.IllegalArgumentException
- if no broker resources are given