Examples of TezVertexID


Examples of org.apache.tez.dag.records.TezVertexID

    TezUmbilical tezUmbilical = null;
    String dagName = "currentDAG";
    String taskVertexName = "currentVertex";
    String destinationVertexName = "destinationVertex";
    TezDAGID dagID = TezDAGID.getInstance("2000", 1, 1);
    TezVertexID vertexID = TezVertexID.getInstance(dagID, 1);
    TezTaskID taskID = TezTaskID.getInstance(vertexID, 1);
    TezTaskAttemptID taskAttemptID = TezTaskAttemptID.getInstance(taskID, 1);
    TezCounters counters = new TezCounters();
    UserPayload userPayload = TezUtils.createUserPayloadFromConf(conf);
    RuntimeTask runtimeTask = mock(RuntimeTask.class);
View Full Code Here

Examples of org.apache.tez.dag.records.TezVertexID

public class TestLogicalIOProcessorRuntimeTask {

  @Test
  public void testAutoStart() throws Exception {
    TezDAGID dagId = createTezDagId();
    TezVertexID vertexId = createTezVertexId(dagId);
    Map<String, ByteBuffer> serviceConsumerMetadata = new HashMap<String, ByteBuffer>();
    Multimap<String, String> startedInputsMap = HashMultimap.create();
    TezUmbilical umbilical = mock(TezUmbilical.class);
    TezConfiguration tezConf = new TezConfiguration();
View Full Code Here

Examples of org.apache.tez.dag.records.TezVertexID

        containerIdentifier, pid);
    int getTaskMaxSleepTime = defaultConf.getInt(
        TezConfiguration.TEZ_TASK_GET_TASK_SLEEP_INTERVAL_MS_MAX,
        TezConfiguration.TEZ_TASK_GET_TASK_SLEEP_INTERVAL_MS_MAX_DEFAULT);
    int taskCount = 0;
    TezVertexID lastVertexId = null;
    EventMetaData currentSourceInfo = null;
    try {
      while (true) {
        // poll for new task
        if (taskCount > 0) {
          updateLoggers(null);
        }
        boolean isNewGetTask = true;
        long getTaskPollStartTime = System.currentTimeMillis();
        long nextGetTaskPrintTime = getTaskPollStartTime + 2000l;
        for (int idle = 0; null == containerTask; ++idle) {
          if (!isNewGetTask) { // Don't sleep on the first iteration.
            long sleepTimeMilliSecs = Math.min(idle * 10, getTaskMaxSleepTime);
            if (sleepTimeMilliSecs + System.currentTimeMillis() > nextGetTaskPrintTime) {
              LOG.info("Sleeping for "
                  + sleepTimeMilliSecs
                  + "ms before retrying getTask again. Got null now. "
                  + "Next getTask sleep message after 2s");
              nextGetTaskPrintTime = System.currentTimeMillis() + sleepTimeMilliSecs + 2000l;
            }
            MILLISECONDS.sleep(sleepTimeMilliSecs);
          } else {
            LOG.info("Attempting to fetch new task");
          }
          isNewGetTask = false;
          containerTask = umbilical.getTask(containerContext);
        }
        LOG.info("Got TaskUpdate: "
            + (System.currentTimeMillis() - getTaskPollStartTime)
            + " ms after starting to poll."
            + " TaskInfo: shouldDie: " + containerTask.shouldDie()
            + (containerTask.shouldDie() == true ? "" : ", currentTaskAttemptId: "
                + containerTask.getTaskSpec().getTaskAttemptID()));
        if (containerTask.shouldDie()) {
          return;
        }
        taskCount++;

        // Reset file system statistics for the new task.
        FileSystem.clearStatistics();
       
        // Re-use the UGI only if the Credentials have not changed.
        if (containerTask.haveCredentialsChanged()) {
          LOG.info("Refreshing UGI since Credentials have changed");
          Credentials taskCreds = containerTask.getCredentials();
          if (taskCreds != null) {
            LOG.info("Credentials : #Tokens=" + taskCreds.numberOfTokens() + ", #SecretKeys="
                + taskCreds.numberOfSecretKeys());
            childUGI = UserGroupInformation.createRemoteUser(System
                .getenv(ApplicationConstants.Environment.USER.toString()));
            childUGI.addCredentials(containerTask.getCredentials());
          } else {
            LOG.info("Not loading any credentials, since no credentials provided");
          }
        }

        Map<String, TezLocalResource> additionalResources = containerTask.getAdditionalResources();
        if (LOG.isDebugEnabled()) {
          LOG.debug("Additional Resources added to container: " + additionalResources);
        }
        processAdditionalResources(additionalResources, defaultConf);
        final TaskSpec taskSpec = containerTask.getTaskSpec();
        if (LOG.isDebugEnabled()) {
          LOG.debug("New container task context:"
              + taskSpec.toString());
        }

        try {
          taskLock.writeLock().lock();
          currentTaskAttemptID = taskSpec.getTaskAttemptID();
          TezVertexID newVertexId =
              currentTaskAttemptID.getTaskID().getVertexID();
          currentTaskComplete.set(false);

          if (lastVertexId != null) {
            if (!lastVertexId.equals(newVertexId)) {
              objectRegistry.clearCache(ObjectLifeCycle.VERTEX);
            }
            if (!lastVertexId.getDAGId().equals(newVertexId.getDAGId())) {
              objectRegistry.clearCache(ObjectLifeCycle.DAG);
              startedInputsMap = HashMultimap.create();
            }
          }
          lastVertexId = newVertexId;
View Full Code Here

Examples of org.apache.tez.dag.records.TezVertexID

        if (LOG.isDebugEnabled()) {
          LOG.debug("Ping from " + taskAttemptID.toString() +
              " events: " + (inEvents != null? inEvents.size() : -1));
        }
        if(inEvents!=null && !inEvents.isEmpty()) {
          TezVertexID vertexId = taskAttemptID.getTaskID().getVertexID();
          context.getEventHandler().handle(
              new VertexEventRouteEvent(vertexId, inEvents));
        }
        taskHeartbeatHandler.pinged(taskAttemptID);
        List<TezEvent> outEvents = context
View Full Code Here

Examples of org.apache.tez.dag.records.TezVertexID

        // This assumption is fine for now since these tasks haven't been started.
        // So they can only get events generated from source task attempts that
        // have already been started.
        DAG dag = getDAG();
        for(TezEvent event : pendingEvents) {
          TezVertexID sourceVertexId = event.getSourceInfo().getTaskAttemptID()
              .getTaskID().getVertexID();
          Vertex sourceVertex = dag.getVertex(sourceVertexId);
          Edge sourceEdge = sourceVertices.get(sourceVertex);
          sourceEdge.sendTezEventToDestinationTasks(event);
        }
View Full Code Here

Examples of org.apache.tez.dag.records.TezVertexID

    @Override
    public VertexState transition(VertexImpl vertex, VertexEvent event) {
      VertexEventOneToOneSourceSplit splitEvent =
          (VertexEventOneToOneSourceSplit)event;
      TezVertexID originalSplitSource = splitEvent.getOriginalSplitSource();
      if (vertex.originalOneToOneSplitSource != null) {
        Preconditions.checkState(vertex.getState() == VertexState.INITED,
            " Unexpected 1-1 split for vertex " + vertex.getVertexId() +
            " in state " + vertex.getState() +
            " . Split in vertex " + originalSplitSource +
View Full Code Here

Examples of org.apache.tez.dag.records.TezVertexID

    vertices = new HashMap<String, VertexImpl>();
    vertexIdMap = new HashMap<TezVertexID, VertexImpl>();
    for (int i = 0; i < vCnt; ++i) {
      VertexPlan vPlan = dagPlan.getVertex(i);
      String vName = vPlan.getName();
      TezVertexID vertexId = TezVertexID.getInstance(dagId, i+1);
      VertexImpl v = null;
      VertexLocationHint locationHint = DagTypeConverters.convertFromDAGPlan(
          vPlan.getTaskLocationHintList());
      if (useCustomInitializer) {
        v = new VertexImplWithCustomInitializer(vertexId, vPlan, vPlan.getName(), conf,
View Full Code Here

Examples of org.apache.tez.dag.records.TezVertexID

      public Vertex answer(InvocationOnMock invocation) throws Throwable {
        Object[] args = invocation.getArguments();
        if (args.length != 1) {
          return null;
        }
        TezVertexID vId = (TezVertexID) args[0];
        return vertexIdMap.get(vId);
      }
    });
    when(dag.getVertex(any(String.class))).thenAnswer(new Answer<Vertex>() {
      @Override
View Full Code Here

Examples of org.apache.tez.dag.records.TezVertexID

    return locationHints;
  }

  @Test(timeout = 5000)
  public void testVertexWithNoTasks() {
    TezVertexID vId = null;
    try {
      TezDAGID invalidDagId = TezDAGID.getInstance(
          dagId.getApplicationId(), 1000);
      vId = TezVertexID.getInstance(invalidDagId, 1);
      VertexPlan vPlan = invalidDagPlan.getVertex(0);
View Full Code Here

Examples of org.apache.tez.dag.records.TezVertexID

  public void testCredentialsTransfer() {
    WrappedContainerMultipleDAGs wc = new WrappedContainerMultipleDAGs();

    TezDAGID dagID2 = TezDAGID.getInstance("800", 500, 2);
    TezDAGID dagID3 = TezDAGID.getInstance("800", 500, 3);
    TezVertexID vertexID2 = TezVertexID.getInstance(dagID2, 1);
    TezVertexID vertexID3 = TezVertexID.getInstance(dagID3, 1);
    TezTaskID taskID2 = TezTaskID.getInstance(vertexID2, 1);
    TezTaskID taskID3 = TezTaskID.getInstance(vertexID3, 1);

    TezTaskAttemptID attempt11 = TezTaskAttemptID.getInstance(wc.taskID, 200);
    TezTaskAttemptID attempt12 = TezTaskAttemptID.getInstance(wc.taskID, 300);
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.