int numTasks = taskIsStarted.length;
LOG.info("Starting all " + numTasks + "tasks for vertex: " + getContext().getVertexName());
tasksToStart = Lists.newArrayListWithCapacity(numTasks);
for (int i=0; i<numTasks; ++i) {
taskIsStarted[i] = true;
tasksToStart.add(new TaskWithLocationHint(new Integer(i), null));
}
} else {
// start only the ready 1-1 tasks
tasksToStart = Lists.newLinkedList();
for (int i=0; i<taskIsStarted.length; ++i) {
if (!taskIsStarted[i] && oneToOneSrcTasksDoneCount[i] == numOneToOneEdges) {
taskIsStarted[i] = true;
TaskLocationHint locationHint = null;
if (oneToOneLocationHints[i] != null) {
locationHint = TaskLocationHint.createTaskLocationHint(oneToOneLocationHints[i].getId());
}
LOG.info("Starting task " + i + " for vertex: "
+ getContext().getVertexName() + " with location: "
+ ((locationHint != null) ? locationHint.getAffinitizedContainer() : "null"));
tasksToStart.add(new TaskWithLocationHint(new Integer(i), locationHint));
}
}
}
if (tasksToStart != null && !tasksToStart.isEmpty()) {