use of org.apache.tez.dag.api.client.DAGStatus.State in project tez by apache.
the class TestMRRJobsDAGApi method testMRRSleepJobDagSubmit.
// Submits a simple 5 stage sleep job using the DAG submit API instead of job
// client.
@Test(timeout = 60000)
public void testMRRSleepJobDagSubmit() throws IOException, InterruptedException, TezException, ClassNotFoundException, YarnException {
State finalState = testMRRSleepJobDagSubmitCore(false, false, false, false);
Assert.assertEquals(DAGStatus.State.SUCCEEDED, finalState);
// TODO Add additional checks for tracking URL etc. - once it's exposed by
// the DAG API.
}
use of org.apache.tez.dag.api.client.DAGStatus.State in project tez by apache.
the class TestMRRJobsDAGApi method testAMRelocalization.
// Submit 2 jobs via RPC using a custom initializer. The second job is submitted with an
// additional local resource, which is verified by the initializer.
@Test(timeout = 120000)
public void testAMRelocalization() throws Exception {
Path relocPath = new Path("/tmp/relocalizationfilefound");
if (remoteFs.exists(relocPath)) {
remoteFs.delete(relocPath, true);
}
TezClient tezSession = createTezSession();
State finalState = testMRRSleepJobDagSubmitCore(true, false, false, tezSession, true, MRInputAMSplitGeneratorRelocalizationTest.class, null);
Assert.assertEquals(DAGStatus.State.SUCCEEDED, finalState);
Assert.assertFalse(remoteFs.exists(new Path("/tmp/relocalizationfilefound")));
// Start the second job with some additional resources.
// Create a test jar directly to HDFS
LOG.info("Creating jar for relocalization test");
Path relocFilePath = new Path("/tmp/test.jar");
relocFilePath = remoteFs.makeQualified(relocFilePath);
OutputStream os = remoteFs.create(relocFilePath, true);
createTestJar(os, RELOCALIZATION_TEST_CLASS_NAME);
// Also upload one of Tez's own JARs to HDFS and add as resource; should be ignored
Path tezAppJar = new Path(MiniTezCluster.APPJAR);
Path tezAppJarRemote = remoteFs.makeQualified(new Path("/tmp/" + tezAppJar.getName()));
remoteFs.copyFromLocalFile(tezAppJar, tezAppJarRemote);
Map<String, LocalResource> additionalResources = new HashMap<String, LocalResource>();
additionalResources.put("test.jar", createLrObjFromPath(relocFilePath));
additionalResources.put("TezAppJar.jar", createLrObjFromPath(tezAppJarRemote));
Assert.assertEquals(TezAppMasterStatus.READY, tezSession.getAppMasterStatus());
finalState = testMRRSleepJobDagSubmitCore(true, false, false, tezSession, true, MRInputAMSplitGeneratorRelocalizationTest.class, additionalResources);
Assert.assertEquals(DAGStatus.State.SUCCEEDED, finalState);
Assert.assertEquals(TezAppMasterStatus.READY, tezSession.getAppMasterStatus());
Assert.assertTrue(remoteFs.exists(new Path("/tmp/relocalizationfilefound")));
stopAndVerifyYarnApp(tezSession);
}
Aggregations