Examples of TezDAGID


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

    HistoryEventType eventType = event.getHistoryEvent().getEventType();
    if (LOG.isDebugEnabled()) {
      LOG.debug("Handling recovery event of type "
          + event.getHistoryEvent().getEventType());
    }
    TezDAGID dagID = event.getDagID();

    if (completedDAGs.contains(dagID)) {
      // no need to recover completed DAGs
      if (LOG.isDebugEnabled()) {
        LOG.debug("Skipping Recovery Event as DAG completed"
            + ", dagId=" + dagID
            + ", completed=" + completedDAGs.contains(dagID)
            + ", skipped=" + skippedDAGs.contains(dagID)
            + ", eventType=" + eventType);
      }
      return;
    }

    if (!outputStreamMap.containsKey(dagID)) {
      Path dagFilePath = TezCommonUtils.getDAGRecoveryPath(recoveryPath, dagID.toString());
      FSDataOutputStream outputStream;
      if (recoveryDirFS.exists(dagFilePath)) {
        if (LOG.isDebugEnabled()) {
          LOG.debug("Opening DAG recovery file in append mode"
              + ", filePath=" + dagFilePath);
View Full Code Here

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

  }

  private void handleEvent(DAGHistoryEvent event) {
    HistoryEventType eventType = event.getHistoryEvent().getEventType();

    TezDAGID dagId = event.getDagID();

    if (eventType.equals(HistoryEventType.DAG_SUBMITTED)) {
      DAGSubmittedEvent dagSubmittedEvent =
          (DAGSubmittedEvent) event.getHistoryEvent();
      String dagName = dagSubmittedEvent.getDAGName();
View Full Code Here

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

    atsHistoryLoggingService = null;
  }

  @Test(timeout=20000)
  public void testATSHistoryLoggingServiceShutdown() {
    TezDAGID tezDAGID = TezDAGID.getInstance(
        ApplicationId.newInstance(100l, 1), 1);
    DAGHistoryEvent historyEvent = new DAGHistoryEvent(tezDAGID,
        new DAGStartedEvent(tezDAGID, 1001l, "user1", "dagName1"));

    for (int i = 0; i < 20; ++i) {
View Full Code Here

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

    return status;
  }

  DAG getDAG(String dagIdStr) throws TezException {
    TezDAGID dagId = TezDAGID.fromString(dagIdStr);
    if (dagId == null) {
      throw new TezException("Bad dagId: " + dagIdStr);
    }

    DAG currentDAG = getCurrentDAG();
    if (currentDAG == null) {
      throw new TezException("No running dag at present");
    }
    if (!currentDAG.getID().toString().equals(dagId.toString())) {
      LOG.warn("Current DAGID : "
          + (currentDAG.getID() == null ? "NULL" : currentDAG.getID())
          + ", Looking for string (not found): " + dagIdStr + ", dagIdObj: "
          + dagId);
      throw new TezException("Unknown dagId: " + dagIdStr);
View Full Code Here

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

        LOG.debug("[RECOVERY SUMMARY]"
            + " dagId=" + proto.getDagId()
            + ", timestamp=" + proto.getTimestamp()
            + ", event=" + eventType);
      }
      TezDAGID dagId = TezDAGID.fromString(proto.getDagId());
      if (dagCounter < dagId.getId()) {
        dagCounter = dagId.getId();
      }
      if (!dagSummaryDataMap.containsKey(dagId)) {
        dagSummaryDataMap.put(dagId, new DAGSummaryData(dagId));
      }
      dagSummaryDataMap.get(dagId).handleSummaryEvent(proto);
      proto.writeDelimitedTo(newSummaryStream);
    }
    summaryStream.close();
    newSummaryStream.hsync();
    newSummaryStream.close();

    // Set counter for next set of DAGs & update dagNames Set in DAGAppMaster
    dagAppMaster.setDAGCounter(dagCounter);
    for (DAGSummaryData dagSummaryData: dagSummaryDataMap.values()){
      dagAppMaster.dagNames.add(dagSummaryData.dagName);
    }

    DAGSummaryData lastInProgressDAGData =
        getLastCompletedOrInProgressDAG(dagSummaryDataMap);
    if (lastInProgressDAGData == null) {
      LOG.info("Nothing to recover as no uncompleted/completed DAGs found");
      return null;
    }
    TezDAGID lastInProgressDAG = lastInProgressDAGData.dagId;
    if (lastInProgressDAG == null) {
      LOG.info("Nothing to recover as no uncompleted/completed DAGs found");
      return null;
    }

    LOG.info("Checking if DAG is in recoverable state"
        + ", dagId=" + lastInProgressDAGData.dagId);

    final RecoveredDAGData recoveredDAGData = new RecoveredDAGData();
    if (lastInProgressDAGData.completed) {
      recoveredDAGData.isCompleted = true;
      recoveredDAGData.dagState = lastInProgressDAGData.dagState;
    }

    String nonRecoverableReason = isDAGRecoverable(lastInProgressDAGData);
    if (nonRecoverableReason != null) {
      LOG.warn("Found last inProgress DAG but not recoverable: "
          + lastInProgressDAGData);
      recoveredDAGData.nonRecoverable = true;
      recoveredDAGData.reason = nonRecoverableReason;
    }

    LOG.info("Trying to recover dag from recovery file"
        + ", dagId=" + lastInProgressDAG.toString()
        + ", dataDir=" + previousAttemptRecoveryDataDir
        + ", intoCurrentDir=" + currentAttemptRecoveryDataDir);

    FSDataInputStream dagRecoveryStream = getDAGRecoveryStream(
        previousAttemptRecoveryDataDir, lastInProgressDAG);
View Full Code Here

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

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.TezDAGID

      return status;
    }

    DAG getDAG(String dagIdStr) throws TezException {
      TezDAGID dagId = TezDAGID.fromString(dagIdStr);
      if(dagId == null) {
        throw new TezException("Bad dagId: " + dagIdStr);
      }

      if(currentDAG == null) {
        throw new TezException("No running dag at present");
      }
      if(!dagId.equals(currentDAG.getID())) {
        LOG.warn("Current DAGID : "
            + (currentDAG.getID() == null ? "NULL" : currentDAG.getID())
            + ", Looking for string (not found): " + dagIdStr + ", dagIdObj: "
            + dagId);
        throw new TezException("Unknown dagId: " + dagIdStr);
View Full Code Here

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

    LOG.info("Stopping HistoryEventHandler");
    super.serviceStop();
  }

  public void handle(DAGHistoryEvent event) {
    TezDAGID dagId = event.getDagID();
    String dagIdStr = "N/A";
    if(dagId != null) {
      dagIdStr = dagId.toString();
    }

    if (LOG.isDebugEnabled()) {
      LOG.debug("Handling history event"
          + ", eventType=" + event.getHistoryEvent().getEventType());
View Full Code Here

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

      // anything to be done?
      // TODO
      return;
    }

    TezDAGID dagID = event.getDagID();
    if (completedDAGs.contains(dagID)) {
      // Skip events for completed DAGs
      // no need to recover completed DAGs
      return;
    }

    try {

      if (eventType.equals(HistoryEventType.DAG_SUBMITTED)
          || eventType.equals(HistoryEventType.DAG_FINISHED)) {
        if (summaryStream == null) {
          Path summaryPath = new Path(recoveryPath,
              appContext.getApplicationID()
              + TezConfiguration.DAG_RECOVERY_SUMMARY_FILE_SUFFIX);
          summaryStream = recoveryDirFS.create(summaryPath, false,
              bufferSize);
        }
        if (eventType.equals(HistoryEventType.DAG_SUBMITTED)) {
          DAGSubmittedEvent dagSubmittedEvent =
              (DAGSubmittedEvent) event.getHistoryEvent();
          String dagName = dagSubmittedEvent.getDAGName();
          if (dagName != null
              && dagName.startsWith(
              TezConfiguration.TEZ_PREWARM_DAG_NAME_PREFIX)) {
            // Skip recording pre-warm DAG events
            return;
          }
          Path dagFilePath = new Path(recoveryPath,
              dagID.toString() + TezConfiguration.DAG_RECOVERY_RECOVER_FILE_SUFFIX);
          FSDataOutputStream outputStream =
              recoveryDirFS.create(dagFilePath, false, bufferSize);
          outputStreamMap.put(dagID, outputStream);
        }
View Full Code Here

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

      if (LOG.isDebugEnabled()) {
        LOG.debug("AssignTA: attempt: " + event.getRemoteTaskSpec());
        LOG.debug("AdditionalLocalResources: " + container.additionalLocalResources);
      }

      TezDAGID currentDAGID = container.appContext.getCurrentDAGID();
      if (!currentDAGID.equals(container.lastTaskDAGID)) {
        // Will be null for the first task.
        container.credentialsChanged = true;
        container.credentials = event.getCredentials();
        container.lastTaskDAGID = currentDAGID;
      } else {
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.