use of com.sequenceiq.periscope.model.yarn.YarnScalingServiceV1Response.DecommissionCandidate in project cloudbreak by hortonworks.
the class YarnLoadEvaluatorTest method getMockYarnScalingResponse.
private YarnScalingServiceV1Response getMockYarnScalingResponse(String instanceType, int upScaleCount, int downScaleCount) {
NewNodeManagerCandidates.Candidate candidate = new NewNodeManagerCandidates.Candidate();
candidate.setCount(upScaleCount);
candidate.setModelName(instanceType);
NewNodeManagerCandidates candidates = new NewNodeManagerCandidates();
candidates.setCandidates(List.of(candidate));
YarnScalingServiceV1Response yarnScalingReponse = new YarnScalingServiceV1Response();
if (upScaleCount > 0) {
yarnScalingReponse.setNewNMCandidates(candidates);
}
List decommissionCandidates = new ArrayList();
for (int i = 1; i <= downScaleCount; i++) {
DecommissionCandidate decommissionCandidate = new DecommissionCandidate();
decommissionCandidate.setAmCount(2);
decommissionCandidate.setNodeId(fqdnBase + i + ":8042");
decommissionCandidates.add(decommissionCandidate);
}
yarnScalingReponse.setDecommissionCandidates(Map.of("candidates", decommissionCandidates));
return yarnScalingReponse;
}
Aggregations