use of com.alibaba.jstorm.utils.FailedAssignTopologyException in project jstorm by alibaba.
the class TaskScheduler method getDifferNodeTaskWokers.
private List<ResourceWorkerSlot> getDifferNodeTaskWokers(String name) {
List<ResourceWorkerSlot> workers = new ArrayList<ResourceWorkerSlot>();
workers.addAll(taskContext.getWorkerToTaskNum().keySet());
for (Entry<String, List<ResourceWorkerSlot>> entry : taskContext.getSupervisorToWorker().entrySet()) {
if (taskContext.getComponentNumOnSupervisor(entry.getKey(), name) != 0)
workers.removeAll(entry.getValue());
}
if (workers.size() == 0)
throw new FailedAssignTopologyException("there's no enough supervisor for making component: " + name + " 's tasks on different node");
return workers;
}
Aggregations