use of org.apache.helix.controller.pipeline.Stage in project helix by apache.
the class ClusterExternalViewVerifier method calculateBestPossibleState.
BestPossibleStateOutput calculateBestPossibleState(ClusterDataCache cache) throws Exception {
ClusterEvent event = new ClusterEvent(ClusterEventType.StateVerifier);
event.addAttribute(AttributeName.ClusterDataCache.name(), cache);
List<Stage> stages = new ArrayList<Stage>();
stages.add(new ResourceComputationStage());
stages.add(new CurrentStateComputationStage());
stages.add(new BestPossibleStateCalcStage());
for (Stage stage : stages) {
runStage(event, stage);
}
return event.getAttribute(AttributeName.BEST_POSSIBLE_STATE.name());
}
use of org.apache.helix.controller.pipeline.Stage in project helix by apache.
the class TaskTestUtil method calculateBestPossibleState.
public static BestPossibleStateOutput calculateBestPossibleState(ClusterDataCache cache, HelixManager manager) throws Exception {
ClusterEvent event = new ClusterEvent(ClusterEventType.Unknown);
event.addAttribute(AttributeName.ClusterDataCache.name(), cache);
event.addAttribute(AttributeName.helixmanager.name(), manager);
List<Stage> stages = new ArrayList<Stage>();
stages.add(new ReadClusterDataStage());
stages.add(new ResourceComputationStage());
stages.add(new CurrentStateComputationStage());
stages.add(new BestPossibleStateCalcStage());
for (Stage stage : stages) {
runStage(event, stage);
}
return event.getAttribute(AttributeName.BEST_POSSIBLE_STATE.name());
}
Aggregations