use of org.apache.tez.dag.app.RecoveryParser.DAGSummaryData in project tez by apache.
the class TestRecoveryParser method testGetLastInProgressDAG.
@Test(timeout = 5000)
public void testGetLastInProgressDAG() {
Map<TezDAGID, DAGSummaryData> summaryDataMap = new HashMap<TezDAGID, DAGSummaryData>();
int dagNum = 20;
int lastInProgressDAGId = new Random().nextInt(dagNum) + 1;
for (int i = 1; i <= dagNum; ++i) {
ApplicationId appId = ApplicationId.newInstance(1, 1);
TezDAGID dagId = TezDAGID.getInstance(appId, i);
if (i == lastInProgressDAGId) {
summaryDataMap.put(dagId, createDAGSummaryData(dagId, false));
} else {
summaryDataMap.put(dagId, createDAGSummaryData(dagId, true));
}
}
DAGSummaryData lastInProgressDAG = parser.getLastCompletedOrInProgressDAG(summaryDataMap);
assertEquals(lastInProgressDAGId, lastInProgressDAG.dagId.getId());
}
use of org.apache.tez.dag.app.RecoveryParser.DAGSummaryData in project tez by apache.
the class TestRecoveryParser method testGetLastCompletedDAG.
@Test(timeout = 5000)
public void testGetLastCompletedDAG() {
Map<TezDAGID, DAGSummaryData> summaryDataMap = new HashMap<TezDAGID, DAGSummaryData>();
int lastCompletedDAGId = new Random().nextInt(20) + 1;
for (int i = 1; i <= lastCompletedDAGId; ++i) {
ApplicationId appId = ApplicationId.newInstance(1, 1);
TezDAGID dagId = TezDAGID.getInstance(appId, i);
summaryDataMap.put(dagId, createDAGSummaryData(dagId, true));
}
DAGSummaryData lastCompletedDAG = parser.getLastCompletedOrInProgressDAG(summaryDataMap);
assertEquals(lastCompletedDAGId, lastCompletedDAG.dagId.getId());
}
use of org.apache.tez.dag.app.RecoveryParser.DAGSummaryData in project tez by apache.
the class TestRecoveryParser method createDAGSummaryData.
private DAGSummaryData createDAGSummaryData(TezDAGID dagId, boolean completed) {
DAGSummaryData data = new DAGSummaryData(dagId);
data.completed = completed;
return data;
}
Aggregations