use of org.apache.myriad.scheduler.constraints.Constraint in project incubator-myriad by apache.
the class MyriadOperations method flexDownTasks.
private int flexDownTasks(Collection<Protos.TaskID> taskIDs, ServiceResourceProfile profile, Constraint constraint, int numInstancesToScaleDown) {
int numInstancesScaledDown = 0;
for (Protos.TaskID taskID : taskIDs) {
NodeTask nodeTask = schedulerState.getTask(taskID);
if (nodeTask.getProfile().getName().equals(profile.getName()) && meetsConstraint(nodeTask, constraint)) {
this.schedulerState.makeTaskKillable(taskID);
numInstancesScaledDown++;
if (numInstancesScaledDown == numInstancesToScaleDown) {
break;
}
}
}
return numInstancesScaledDown;
}
Aggregations