Examples of TaskWithLocationHint


Examples of org.apache.tez.dag.api.VertexManagerPluginContext.TaskWithLocationHint

    @Override
    public void onVertexStarted(Map<String, List<Integer>> completions) {
        if (dynamicParallelism != -1) {
            List<TaskWithLocationHint> tasksToStart = Lists.newArrayListWithCapacity(dynamicParallelism);
            for (int i=0; i<dynamicParallelism; ++i) {
                tasksToStart.add(new TaskWithLocationHint(new Integer(i), null));
            }
            getContext().scheduleVertexTasks(tasksToStart);
        }
    }
View Full Code Here

Examples of org.apache.tez.dag.api.VertexManagerPluginContext.TaskWithLocationHint

    // send events and test that they are buffered until some task is scheduled
    dispatcher.getEventHandler().handle(
        new VertexEventRouteEvent(v3.getVertexId(), taskEvents));
    dispatcher.await();
    Assert.assertEquals(2, v3.pendingTaskEvents.size());
    v3.scheduleTasks(Collections.singletonList(new TaskWithLocationHint(new Integer(0), null)));
    dispatcher.await();
    Assert.assertEquals(0, v3.pendingTaskEvents.size());
    // send events and test that they are not buffered anymore
    dispatcher.getEventHandler().handle(
        new VertexEventRouteEvent(v3.getVertexId(), taskEvents));
View Full Code Here

Examples of org.apache.tez.dag.api.VertexManagerPluginContext.TaskWithLocationHint

        } else if (successAttemptId == getContext().getDAGAttemptNumber()) {
          LOG.info("Scheduling tasks for vertex=" + getContext().getVertexName());
          int numTasks = getContext().getVertexNumTasks(getContext().getVertexName());
          List<TaskWithLocationHint> scheduledTasks = Lists.newArrayListWithCapacity(numTasks);
          for (int i=0; i<numTasks; ++i) {
            scheduledTasks.add(new TaskWithLocationHint(new Integer(i), null));
          }
          getContext().scheduleVertexTasks(scheduledTasks);
        }
      }
    }
View Full Code Here

Examples of org.apache.tez.dag.api.VertexManagerPluginContext.TaskWithLocationHint

      determineParallelismAndApply();
    }
    List<TaskWithLocationHint> scheduledTasks = Lists.newArrayListWithCapacity(numTasksToSchedule);
    while(!pendingTasks.isEmpty() && numTasksToSchedule > 0) {
      numTasksToSchedule--;
      scheduledTasks.add(new TaskWithLocationHint(pendingTasks.get(0), null));
      pendingTasks.remove(0);
    }
    getContext().scheduleVertexTasks(scheduledTasks);
  }
View Full Code Here

Examples of org.apache.tez.dag.api.VertexManagerPluginContext.TaskWithLocationHint

      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()) {
View Full Code Here

Examples of org.apache.tez.dag.api.VertexManagerPluginContext.TaskWithLocationHint

  @Override
  public void onVertexStarted(Map<String, List<Integer>> completions) {
    int numTasks = getContext().getVertexNumTasks(getContext().getVertexName());
    List<TaskWithLocationHint> scheduledTasks = Lists.newArrayListWithCapacity(numTasks);
    for (int i=0; i<numTasks; ++i) {
      scheduledTasks.add(new TaskWithLocationHint(new Integer(i), null));
    }
    getContext().scheduleVertexTasks(scheduledTasks);
  }
View Full Code Here

Examples of org.apache.tez.dag.api.VertexManagerPluginContext.TaskWithLocationHint

  @Override
  public void onVertexStarted(Map<String, List<Integer>> completions) {
    int numTasks = getContext().getVertexNumTasks(getContext().getVertexName());
    List<TaskWithLocationHint> scheduledTasks = Lists.newArrayListWithCapacity(numTasks);
    for (int i=0; i<numTasks; ++i) {
      scheduledTasks.add(new TaskWithLocationHint(new Integer(i), null));
    }
    getContext().scheduleVertexTasks(scheduledTasks);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.