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);