task = new Task(jobID, vertexId, taskIndex, numSubtasks, executionId, tdd.getTaskName(), this);
if (this.runningTasks.putIfAbsent(executionId, task) != null) {
throw new Exception("TaskManager contains already a task with executionId " + executionId);
}
final InputSplitProvider splitProvider = new TaskInputSplitProvider(this.globalInputSplitProvider, jobID, vertexId, executionId);
final RuntimeEnvironment env = new RuntimeEnvironment(task, tdd, userCodeClassLoader, this.memoryManager, this.ioManager, splitProvider, this.accumulatorProtocolProxy, this.bcVarManager);
task.setEnvironment(env);
// register the task with the network stack and profilers
this.channelManager.register(task);