use of com.linkedin.kafka.cruisecontrol.monitor.LoadMonitorState in project cruise-control by linkedin.
the class KafkaCruiseControlServletDataFromTest method getState.
/**
* Generate the KCC state.
*/
private KafkaCruiseControlState getState(int numReadyGoals, int totalGoals, int numValidWindows) {
ExecutorState executorState = ExecutorState.noTaskInProgress();
LoadMonitorState loadMonitorState = LoadMonitorState.running(numValidWindows, new TreeMap<>(), 1, 10, Collections.emptyMap());
Map<Goal, Boolean> goalReadiness = new HashMap<>();
int i = 0;
for (; i < numReadyGoals; i++) {
goalReadiness.put(new MockGoal(i), true);
}
for (; i < totalGoals; i++) {
goalReadiness.put(new MockGoal(i), false);
}
AnalyzerState analyzerState = new AnalyzerState(true, goalReadiness);
return new KafkaCruiseControlState(executorState, loadMonitorState, analyzerState);
}
Aggregations