Search in sources :

Example 6 with FailedAssignTopologyException

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;
}
Also used : FailedAssignTopologyException(com.alibaba.jstorm.utils.FailedAssignTopologyException) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

FailedAssignTopologyException (com.alibaba.jstorm.utils.FailedAssignTopologyException)6 SupervisorInfo (com.alibaba.jstorm.daemon.supervisor.SupervisorInfo)3 StormTopology (backtype.storm.generated.StormTopology)2 StormClusterState (com.alibaba.jstorm.cluster.StormClusterState)2 ResourceWorkerSlot (com.alibaba.jstorm.schedule.default_assign.ResourceWorkerSlot)2 IOException (java.io.IOException)2 HashMap (java.util.HashMap)2 HashSet (java.util.HashSet)2 Map (java.util.Map)2 TreeMap (java.util.TreeMap)2 AlreadyAliveException (backtype.storm.generated.AlreadyAliveException)1 InvalidTopologyException (backtype.storm.generated.InvalidTopologyException)1 KeyAlreadyExistsException (backtype.storm.generated.KeyAlreadyExistsException)1 KeyNotFoundException (backtype.storm.generated.KeyNotFoundException)1 NotAliveException (backtype.storm.generated.NotAliveException)1 TopologyAssignException (backtype.storm.generated.TopologyAssignException)1 Assignment (com.alibaba.jstorm.schedule.Assignment)1 AssignmentBak (com.alibaba.jstorm.schedule.AssignmentBak)1 TopologyAssignContext (com.alibaba.jstorm.schedule.TopologyAssignContext)1 TimeCacheMap (com.alibaba.jstorm.utils.TimeCacheMap)1