nodeGroups = clusterEntityMgr.findAllGroups(clusterName);
}
// only fix worker nodes that have datanode or tasktracker roles
boolean workerNodesFound = false;
JobParametersBuilder parametersBuilder = new JobParametersBuilder();
List<JobParameters> jobParameterList = new ArrayList<JobParameters>();
for (NodeGroupEntity nodeGroup : nodeGroups) {
List<String> roles = nodeGroup.getRoleNameList();
// TODO: more fine control on node roles
if (softMgr.hasMgmtRole(roles)) {
logger.info("node group " + nodeGroup.getName()
+ " contains management roles, pass it");
continue;
}
workerNodesFound = true;
for (NodeEntity node : clusterEntityMgr.findAllNodes(clusterName,
nodeGroup.getName())) {
if (node.isObsoleteNode()) {
logger.info("Ingore node " + node.getVmName()
+ ", for it violate VM name convention."
+ "or exceed defined group instance number. ");
continue;
}
if (clusterHealService.hasBadDisks(node.getVmName())) {
logger.warn("node " + node.getVmName()
+ " has bad disks. Fixing it..");
boolean vmPowerOn =
(node.getStatus().ordinal() != NodeStatus.POWERED_OFF
.ordinal());
JobParameters nodeParameters =
parametersBuilder
.addString(JobConstants.CLUSTER_NAME_JOB_PARAM,
clusterName)
.addString(JobConstants.TARGET_NAME_JOB_PARAM,
node.getVmName())
.addString(JobConstants.GROUP_NAME_JOB_PARAM,