use of com.linkedin.kafka.cruisecontrol.monitor.sampling.aggregator.SampleExtrapolation in project cruise-control by linkedin.
the class LoadMonitor method partitionSampleExtrapolations.
private Map<TopicPartition, List<SampleExtrapolation>> partitionSampleExtrapolations(Map<PartitionEntity, ValuesAndExtrapolations> valuesAndExtrapolations) {
Map<TopicPartition, List<SampleExtrapolation>> sampleExtrapolations = new HashMap<>();
for (Map.Entry<PartitionEntity, ValuesAndExtrapolations> entry : valuesAndExtrapolations.entrySet()) {
TopicPartition tp = entry.getKey().tp();
Map<Integer, Extrapolation> extrapolations = entry.getValue().extrapolations();
if (extrapolations.isEmpty()) {
List<SampleExtrapolation> extrapolationForPartition = sampleExtrapolations.computeIfAbsent(tp, p -> new ArrayList<>());
extrapolations.forEach((t, imputation) -> extrapolationForPartition.add(new SampleExtrapolation(t, imputation)));
}
}
return sampleExtrapolations;
}
Aggregations