|
@@ -18,8 +18,10 @@
|
|
|
|
|
|
package org.apache.hadoop.mapred;
|
|
package org.apache.hadoop.mapred;
|
|
|
|
|
|
-import static org.junit.Assert.assertTrue;
|
|
|
|
-import static org.junit.Assert.fail;
|
|
|
|
|
|
+import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
|
|
+import static org.junit.jupiter.api.Assertions.assertNull;
|
|
|
|
+import static org.junit.jupiter.api.Assertions.assertTrue;
|
|
|
|
+import static org.junit.jupiter.api.Assertions.fail;
|
|
|
|
|
|
import java.io.BufferedReader;
|
|
import java.io.BufferedReader;
|
|
import java.io.File;
|
|
import java.io.File;
|
|
@@ -56,8 +58,7 @@ import org.apache.hadoop.yarn.server.timelineservice.storage.FileSystemTimelineR
|
|
import org.apache.hadoop.yarn.server.timelineservice.storage.FileSystemTimelineWriterImpl;
|
|
import org.apache.hadoop.yarn.server.timelineservice.storage.FileSystemTimelineWriterImpl;
|
|
import org.apache.hadoop.yarn.server.timelineservice.storage.TimelineWriter;
|
|
import org.apache.hadoop.yarn.server.timelineservice.storage.TimelineWriter;
|
|
import org.apache.hadoop.yarn.util.timeline.TimelineUtils;
|
|
import org.apache.hadoop.yarn.util.timeline.TimelineUtils;
|
|
-import org.junit.Assert;
|
|
|
|
-import org.junit.Test;
|
|
|
|
|
|
+import org.junit.jupiter.api.Test;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
@@ -85,8 +86,8 @@ public class TestMRTimelineEventHandling {
|
|
cluster.start();
|
|
cluster.start();
|
|
|
|
|
|
//verify that the timeline service is not started.
|
|
//verify that the timeline service is not started.
|
|
- Assert.assertNull("Timeline Service should not have been started",
|
|
|
|
- cluster.getApplicationHistoryServer());
|
|
|
|
|
|
+ assertNull(cluster.getApplicationHistoryServer(),
|
|
|
|
+ "Timeline Service should not have been started");
|
|
}
|
|
}
|
|
finally {
|
|
finally {
|
|
if(cluster != null) {
|
|
if(cluster != null) {
|
|
@@ -103,8 +104,8 @@ public class TestMRTimelineEventHandling {
|
|
cluster.start();
|
|
cluster.start();
|
|
|
|
|
|
//verify that the timeline service is not started.
|
|
//verify that the timeline service is not started.
|
|
- Assert.assertNull("Timeline Service should not have been started",
|
|
|
|
- cluster.getApplicationHistoryServer());
|
|
|
|
|
|
+ assertNull(cluster.getApplicationHistoryServer(),
|
|
|
|
+ "Timeline Service should not have been started");
|
|
}
|
|
}
|
|
finally {
|
|
finally {
|
|
if(cluster != null) {
|
|
if(cluster != null) {
|
|
@@ -135,33 +136,31 @@ public class TestMRTimelineEventHandling {
|
|
Path outDir = new Path(localPathRoot, "output");
|
|
Path outDir = new Path(localPathRoot, "output");
|
|
RunningJob job =
|
|
RunningJob job =
|
|
UtilsForTests.runJobSucceed(new JobConf(conf), inDir, outDir);
|
|
UtilsForTests.runJobSucceed(new JobConf(conf), inDir, outDir);
|
|
- Assert.assertEquals(JobStatus.SUCCEEDED,
|
|
|
|
- job.getJobStatus().getState().getValue());
|
|
|
|
|
|
+ assertEquals(JobStatus.SUCCEEDED, job.getJobStatus().getState().getValue());
|
|
TimelineEntities entities = ts.getEntities("MAPREDUCE_JOB", null, null,
|
|
TimelineEntities entities = ts.getEntities("MAPREDUCE_JOB", null, null,
|
|
- null, null, null, null, null, null, null);
|
|
|
|
- Assert.assertEquals(1, entities.getEntities().size());
|
|
|
|
|
|
+ null, null, null, null, null, null, null);
|
|
|
|
+ assertEquals(1, entities.getEntities().size());
|
|
TimelineEntity tEntity = entities.getEntities().get(0);
|
|
TimelineEntity tEntity = entities.getEntities().get(0);
|
|
- Assert.assertEquals(job.getID().toString(), tEntity.getEntityId());
|
|
|
|
- Assert.assertEquals("MAPREDUCE_JOB", tEntity.getEntityType());
|
|
|
|
- Assert.assertEquals(EventType.AM_STARTED.toString(),
|
|
|
|
- tEntity.getEvents().get(tEntity.getEvents().size() - 1)
|
|
|
|
- .getEventType());
|
|
|
|
- Assert.assertEquals(EventType.JOB_FINISHED.toString(),
|
|
|
|
- tEntity.getEvents().get(0).getEventType());
|
|
|
|
|
|
+ assertEquals(job.getID().toString(), tEntity.getEntityId());
|
|
|
|
+ assertEquals("MAPREDUCE_JOB", tEntity.getEntityType());
|
|
|
|
+ assertEquals(EventType.AM_STARTED.toString(),
|
|
|
|
+ tEntity.getEvents().get(tEntity.getEvents().size() - 1)
|
|
|
|
+ .getEventType());
|
|
|
|
+ assertEquals(EventType.JOB_FINISHED.toString(),
|
|
|
|
+ tEntity.getEvents().get(0).getEventType());
|
|
|
|
|
|
job = UtilsForTests.runJobFail(new JobConf(conf), inDir, outDir);
|
|
job = UtilsForTests.runJobFail(new JobConf(conf), inDir, outDir);
|
|
- Assert.assertEquals(JobStatus.FAILED,
|
|
|
|
- job.getJobStatus().getState().getValue());
|
|
|
|
|
|
+ assertEquals(JobStatus.FAILED, job.getJobStatus().getState().getValue());
|
|
entities = ts.getEntities("MAPREDUCE_JOB", null, null, null, null, null,
|
|
entities = ts.getEntities("MAPREDUCE_JOB", null, null, null, null, null,
|
|
null, null, null, null);
|
|
null, null, null, null);
|
|
- Assert.assertEquals(2, entities.getEntities().size());
|
|
|
|
|
|
+ assertEquals(2, entities.getEntities().size());
|
|
tEntity = entities.getEntities().get(0);
|
|
tEntity = entities.getEntities().get(0);
|
|
- Assert.assertEquals(job.getID().toString(), tEntity.getEntityId());
|
|
|
|
- Assert.assertEquals("MAPREDUCE_JOB", tEntity.getEntityType());
|
|
|
|
- Assert.assertEquals(EventType.AM_STARTED.toString(),
|
|
|
|
- tEntity.getEvents().get(tEntity.getEvents().size() - 1)
|
|
|
|
- .getEventType());
|
|
|
|
- Assert.assertEquals(EventType.JOB_FAILED.toString(),
|
|
|
|
|
|
+ assertEquals(job.getID().toString(), tEntity.getEntityId());
|
|
|
|
+ assertEquals("MAPREDUCE_JOB", tEntity.getEntityType());
|
|
|
|
+ assertEquals(EventType.AM_STARTED.toString(),
|
|
|
|
+ tEntity.getEvents().get(tEntity.getEvents().size() - 1)
|
|
|
|
+ .getEventType());
|
|
|
|
+ assertEquals(EventType.JOB_FAILED.toString(),
|
|
tEntity.getEvents().get(0).getEventType());
|
|
tEntity.getEvents().get(0).getEventType());
|
|
} finally {
|
|
} finally {
|
|
if (cluster != null) {
|
|
if (cluster != null) {
|
|
@@ -221,7 +220,7 @@ public class TestMRTimelineEventHandling {
|
|
UtilsForTests.createConfigValue(101 * 1024));
|
|
UtilsForTests.createConfigValue(101 * 1024));
|
|
RunningJob job =
|
|
RunningJob job =
|
|
UtilsForTests.runJobSucceed(successConf, inDir, outDir);
|
|
UtilsForTests.runJobSucceed(successConf, inDir, outDir);
|
|
- Assert.assertEquals(JobStatus.SUCCEEDED,
|
|
|
|
|
|
+ assertEquals(JobStatus.SUCCEEDED,
|
|
job.getJobStatus().getState().getValue());
|
|
job.getJobStatus().getState().getValue());
|
|
|
|
|
|
YarnClient yarnClient = YarnClient.createYarnClient();
|
|
YarnClient yarnClient = YarnClient.createYarnClient();
|
|
@@ -232,7 +231,7 @@ public class TestMRTimelineEventHandling {
|
|
|
|
|
|
ApplicationId firstAppId = null;
|
|
ApplicationId firstAppId = null;
|
|
List<ApplicationReport> apps = yarnClient.getApplications(appStates);
|
|
List<ApplicationReport> apps = yarnClient.getApplications(appStates);
|
|
- Assert.assertEquals(apps.size(), 1);
|
|
|
|
|
|
+ assertEquals(apps.size(), 1);
|
|
ApplicationReport appReport = apps.get(0);
|
|
ApplicationReport appReport = apps.get(0);
|
|
firstAppId = appReport.getApplicationId();
|
|
firstAppId = appReport.getApplicationId();
|
|
UtilsForTests.waitForAppFinished(job, cluster);
|
|
UtilsForTests.waitForAppFinished(job, cluster);
|
|
@@ -240,11 +239,11 @@ public class TestMRTimelineEventHandling {
|
|
|
|
|
|
LOG.info("Run 2nd job which should be failed.");
|
|
LOG.info("Run 2nd job which should be failed.");
|
|
job = UtilsForTests.runJobFail(new JobConf(conf), inDir, outDir);
|
|
job = UtilsForTests.runJobFail(new JobConf(conf), inDir, outDir);
|
|
- Assert.assertEquals(JobStatus.FAILED,
|
|
|
|
|
|
+ assertEquals(JobStatus.FAILED,
|
|
job.getJobStatus().getState().getValue());
|
|
job.getJobStatus().getState().getValue());
|
|
|
|
|
|
apps = yarnClient.getApplications(appStates);
|
|
apps = yarnClient.getApplications(appStates);
|
|
- Assert.assertEquals(apps.size(), 2);
|
|
|
|
|
|
+ assertEquals(apps.size(), 2);
|
|
|
|
|
|
appReport = apps.get(0).getApplicationId().equals(firstAppId) ?
|
|
appReport = apps.get(0).getApplicationId().equals(firstAppId) ?
|
|
apps.get(0) : apps.get(1);
|
|
apps.get(0) : apps.get(1);
|
|
@@ -270,7 +269,7 @@ public class TestMRTimelineEventHandling {
|
|
|
|
|
|
File tmpRootFolder = new File(tmpRoot);
|
|
File tmpRootFolder = new File(tmpRoot);
|
|
|
|
|
|
- Assert.assertTrue(tmpRootFolder.isDirectory());
|
|
|
|
|
|
+ assertTrue(tmpRootFolder.isDirectory());
|
|
String basePath = tmpRoot + YarnConfiguration.DEFAULT_RM_CLUSTER_ID +
|
|
String basePath = tmpRoot + YarnConfiguration.DEFAULT_RM_CLUSTER_ID +
|
|
File.separator +
|
|
File.separator +
|
|
UserGroupInformation.getCurrentUser().getShortUserName() +
|
|
UserGroupInformation.getCurrentUser().getShortUserName() +
|
|
@@ -283,9 +282,8 @@ public class TestMRTimelineEventHandling {
|
|
basePath + File.separator + "MAPREDUCE_JOB" + File.separator;
|
|
basePath + File.separator + "MAPREDUCE_JOB" + File.separator;
|
|
|
|
|
|
File entityFolder = new File(outputDirJob);
|
|
File entityFolder = new File(outputDirJob);
|
|
- Assert.assertTrue("Job output directory: " + outputDirJob +
|
|
|
|
- " does not exist.",
|
|
|
|
- entityFolder.isDirectory());
|
|
|
|
|
|
+ assertTrue(entityFolder.isDirectory(),
|
|
|
|
+ "Job output directory: " + outputDirJob + " does not exist.");
|
|
|
|
|
|
// check for job event file
|
|
// check for job event file
|
|
String jobEventFileName = appId.toString().replaceAll("application", "job")
|
|
String jobEventFileName = appId.toString().replaceAll("application", "job")
|
|
@@ -293,9 +291,8 @@ public class TestMRTimelineEventHandling {
|
|
|
|
|
|
String jobEventFilePath = outputDirJob + jobEventFileName;
|
|
String jobEventFilePath = outputDirJob + jobEventFileName;
|
|
File jobEventFile = new File(jobEventFilePath);
|
|
File jobEventFile = new File(jobEventFilePath);
|
|
- Assert.assertTrue("jobEventFilePath: " + jobEventFilePath +
|
|
|
|
- " does not exist.",
|
|
|
|
- jobEventFile.exists());
|
|
|
|
|
|
+ assertTrue(jobEventFile.exists(),
|
|
|
|
+ "jobEventFilePath: " + jobEventFilePath + " does not exist.");
|
|
verifyEntity(jobEventFile, EventType.JOB_FINISHED.name(),
|
|
verifyEntity(jobEventFile, EventType.JOB_FINISHED.name(),
|
|
true, false, null, false);
|
|
true, false, null, false);
|
|
Set<String> cfgsToCheck = Sets.newHashSet("dummy_conf1", "dummy_conf2",
|
|
Set<String> cfgsToCheck = Sets.newHashSet("dummy_conf1", "dummy_conf2",
|
|
@@ -306,10 +303,8 @@ public class TestMRTimelineEventHandling {
|
|
String outputAppDir =
|
|
String outputAppDir =
|
|
basePath + File.separator + "YARN_APPLICATION" + File.separator;
|
|
basePath + File.separator + "YARN_APPLICATION" + File.separator;
|
|
entityFolder = new File(outputAppDir);
|
|
entityFolder = new File(outputAppDir);
|
|
- Assert.assertTrue(
|
|
|
|
- "Job output directory: " + outputAppDir +
|
|
|
|
- " does not exist.",
|
|
|
|
- entityFolder.isDirectory());
|
|
|
|
|
|
+ assertTrue(entityFolder.isDirectory(),
|
|
|
|
+ "Job output directory: " + outputAppDir + " does not exist.");
|
|
|
|
|
|
// check for job event file
|
|
// check for job event file
|
|
String appEventFileName = appId.toString()
|
|
String appEventFileName = appId.toString()
|
|
@@ -317,10 +312,9 @@ public class TestMRTimelineEventHandling {
|
|
|
|
|
|
String appEventFilePath = outputAppDir + appEventFileName;
|
|
String appEventFilePath = outputAppDir + appEventFileName;
|
|
File appEventFile = new File(appEventFilePath);
|
|
File appEventFile = new File(appEventFilePath);
|
|
- Assert.assertTrue(
|
|
|
|
|
|
+ assertTrue(appEventFile.exists(),
|
|
"appEventFilePath: " + appEventFilePath +
|
|
"appEventFilePath: " + appEventFilePath +
|
|
- " does not exist.",
|
|
|
|
- appEventFile.exists());
|
|
|
|
|
|
+ " does not exist.");
|
|
verifyEntity(appEventFile, null, true, false, null, false);
|
|
verifyEntity(appEventFile, null, true, false, null, false);
|
|
verifyEntity(appEventFile, null, false, true, cfgsToCheck, false);
|
|
verifyEntity(appEventFile, null, false, true, cfgsToCheck, false);
|
|
|
|
|
|
@@ -328,9 +322,9 @@ public class TestMRTimelineEventHandling {
|
|
String outputDirTask =
|
|
String outputDirTask =
|
|
basePath + File.separator + "MAPREDUCE_TASK" + File.separator;
|
|
basePath + File.separator + "MAPREDUCE_TASK" + File.separator;
|
|
File taskFolder = new File(outputDirTask);
|
|
File taskFolder = new File(outputDirTask);
|
|
- Assert.assertTrue("Task output directory: " + outputDirTask +
|
|
|
|
- " does not exist.",
|
|
|
|
- taskFolder.isDirectory());
|
|
|
|
|
|
+ assertTrue(taskFolder.isDirectory(),
|
|
|
|
+ "Task output directory: " + outputDirTask +
|
|
|
|
+ " does not exist.");
|
|
|
|
|
|
String taskEventFileName =
|
|
String taskEventFileName =
|
|
appId.toString().replaceAll("application", "task") +
|
|
appId.toString().replaceAll("application", "task") +
|
|
@@ -339,9 +333,8 @@ public class TestMRTimelineEventHandling {
|
|
|
|
|
|
String taskEventFilePath = outputDirTask + taskEventFileName;
|
|
String taskEventFilePath = outputDirTask + taskEventFileName;
|
|
File taskEventFile = new File(taskEventFilePath);
|
|
File taskEventFile = new File(taskEventFilePath);
|
|
- Assert.assertTrue("taskEventFileName: " + taskEventFilePath +
|
|
|
|
- " does not exist.",
|
|
|
|
- taskEventFile.exists());
|
|
|
|
|
|
+ assertTrue(taskEventFile.exists(),
|
|
|
|
+ "taskEventFileName: " + taskEventFilePath + " does not exist.");
|
|
verifyEntity(taskEventFile, EventType.TASK_FINISHED.name(),
|
|
verifyEntity(taskEventFile, EventType.TASK_FINISHED.name(),
|
|
true, false, null, true);
|
|
true, false, null, true);
|
|
|
|
|
|
@@ -349,8 +342,9 @@ public class TestMRTimelineEventHandling {
|
|
String outputDirTaskAttempt =
|
|
String outputDirTaskAttempt =
|
|
basePath + File.separator + "MAPREDUCE_TASK_ATTEMPT" + File.separator;
|
|
basePath + File.separator + "MAPREDUCE_TASK_ATTEMPT" + File.separator;
|
|
File taskAttemptFolder = new File(outputDirTaskAttempt);
|
|
File taskAttemptFolder = new File(outputDirTaskAttempt);
|
|
- Assert.assertTrue("TaskAttempt output directory: " + outputDirTaskAttempt +
|
|
|
|
- " does not exist.", taskAttemptFolder.isDirectory());
|
|
|
|
|
|
+ assertTrue(taskAttemptFolder.isDirectory(),
|
|
|
|
+ "TaskAttempt output directory: " + outputDirTaskAttempt +
|
|
|
|
+ " does not exist.");
|
|
|
|
|
|
String taskAttemptEventFileName = appId.toString().replaceAll(
|
|
String taskAttemptEventFileName = appId.toString().replaceAll(
|
|
"application", "attempt") + "_m_000000_0" +
|
|
"application", "attempt") + "_m_000000_0" +
|
|
@@ -359,8 +353,9 @@ public class TestMRTimelineEventHandling {
|
|
String taskAttemptEventFilePath = outputDirTaskAttempt +
|
|
String taskAttemptEventFilePath = outputDirTaskAttempt +
|
|
taskAttemptEventFileName;
|
|
taskAttemptEventFileName;
|
|
File taskAttemptEventFile = new File(taskAttemptEventFilePath);
|
|
File taskAttemptEventFile = new File(taskAttemptEventFilePath);
|
|
- Assert.assertTrue("taskAttemptEventFileName: " + taskAttemptEventFilePath +
|
|
|
|
- " does not exist.", taskAttemptEventFile.exists());
|
|
|
|
|
|
+ assertTrue(taskAttemptEventFile.exists(),
|
|
|
|
+ "taskAttemptEventFileName: " + taskAttemptEventFilePath +
|
|
|
|
+ " does not exist.");
|
|
verifyEntity(taskAttemptEventFile, EventType.MAP_ATTEMPT_FINISHED.name(),
|
|
verifyEntity(taskAttemptEventFile, EventType.MAP_ATTEMPT_FINISHED.name(),
|
|
true, false, null, true);
|
|
true, false, null, true);
|
|
}
|
|
}
|
|
@@ -397,14 +392,14 @@ public class TestMRTimelineEventHandling {
|
|
|
|
|
|
LOG.info("strLine.trim()= " + strLine.trim());
|
|
LOG.info("strLine.trim()= " + strLine.trim());
|
|
if (checkIdPrefix) {
|
|
if (checkIdPrefix) {
|
|
- Assert.assertTrue("Entity ID prefix expected to be > 0",
|
|
|
|
- entity.getIdPrefix() > 0);
|
|
|
|
|
|
+ assertTrue(entity.getIdPrefix() > 0,
|
|
|
|
+ "Entity ID prefix expected to be > 0");
|
|
if (idPrefix == -1) {
|
|
if (idPrefix == -1) {
|
|
idPrefix = entity.getIdPrefix();
|
|
idPrefix = entity.getIdPrefix();
|
|
} else {
|
|
} else {
|
|
- Assert.assertEquals("Entity ID prefix should be same across " +
|
|
|
|
- "each publish of same entity",
|
|
|
|
- idPrefix, entity.getIdPrefix());
|
|
|
|
|
|
+ assertEquals(idPrefix, entity.getIdPrefix(),
|
|
|
|
+ "Entity ID prefix should be same across " +
|
|
|
|
+ "each publish of same entity");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (eventId == null) {
|
|
if (eventId == null) {
|
|
@@ -492,21 +487,21 @@ public class TestMRTimelineEventHandling {
|
|
|
|
|
|
RunningJob job =
|
|
RunningJob job =
|
|
UtilsForTests.runJobSucceed(new JobConf(conf), inDir, outDir);
|
|
UtilsForTests.runJobSucceed(new JobConf(conf), inDir, outDir);
|
|
- Assert.assertEquals(JobStatus.SUCCEEDED,
|
|
|
|
|
|
+ assertEquals(JobStatus.SUCCEEDED,
|
|
job.getJobStatus().getState().getValue());
|
|
job.getJobStatus().getState().getValue());
|
|
TimelineEntities entities = ts.getEntities("MAPREDUCE_JOB", null, null,
|
|
TimelineEntities entities = ts.getEntities("MAPREDUCE_JOB", null, null,
|
|
null, null, null, null, null, null, null);
|
|
null, null, null, null, null, null, null);
|
|
- Assert.assertEquals(0, entities.getEntities().size());
|
|
|
|
|
|
+ assertEquals(0, entities.getEntities().size());
|
|
|
|
|
|
conf.setBoolean(MRJobConfig.MAPREDUCE_JOB_EMIT_TIMELINE_DATA, true);
|
|
conf.setBoolean(MRJobConfig.MAPREDUCE_JOB_EMIT_TIMELINE_DATA, true);
|
|
job = UtilsForTests.runJobSucceed(new JobConf(conf), inDir, outDir);
|
|
job = UtilsForTests.runJobSucceed(new JobConf(conf), inDir, outDir);
|
|
- Assert.assertEquals(JobStatus.SUCCEEDED,
|
|
|
|
|
|
+ assertEquals(JobStatus.SUCCEEDED,
|
|
job.getJobStatus().getState().getValue());
|
|
job.getJobStatus().getState().getValue());
|
|
entities = ts.getEntities("MAPREDUCE_JOB", null, null, null, null, null,
|
|
entities = ts.getEntities("MAPREDUCE_JOB", null, null, null, null, null,
|
|
null, null, null, null);
|
|
null, null, null, null);
|
|
- Assert.assertEquals(1, entities.getEntities().size());
|
|
|
|
|
|
+ assertEquals(1, entities.getEntities().size());
|
|
TimelineEntity tEntity = entities.getEntities().get(0);
|
|
TimelineEntity tEntity = entities.getEntities().get(0);
|
|
- Assert.assertEquals(job.getID().toString(), tEntity.getEntityId());
|
|
|
|
|
|
+ assertEquals(job.getID().toString(), tEntity.getEntityId());
|
|
} finally {
|
|
} finally {
|
|
if (cluster != null) {
|
|
if (cluster != null) {
|
|
cluster.stop();
|
|
cluster.stop();
|
|
@@ -532,21 +527,21 @@ public class TestMRTimelineEventHandling {
|
|
conf.setBoolean(MRJobConfig.MAPREDUCE_JOB_EMIT_TIMELINE_DATA, false);
|
|
conf.setBoolean(MRJobConfig.MAPREDUCE_JOB_EMIT_TIMELINE_DATA, false);
|
|
RunningJob job =
|
|
RunningJob job =
|
|
UtilsForTests.runJobSucceed(new JobConf(conf), inDir, outDir);
|
|
UtilsForTests.runJobSucceed(new JobConf(conf), inDir, outDir);
|
|
- Assert.assertEquals(JobStatus.SUCCEEDED,
|
|
|
|
|
|
+ assertEquals(JobStatus.SUCCEEDED,
|
|
job.getJobStatus().getState().getValue());
|
|
job.getJobStatus().getState().getValue());
|
|
TimelineEntities entities = ts.getEntities("MAPREDUCE_JOB", null, null,
|
|
TimelineEntities entities = ts.getEntities("MAPREDUCE_JOB", null, null,
|
|
null, null, null, null, null, null, null);
|
|
null, null, null, null, null, null, null);
|
|
- Assert.assertEquals(0, entities.getEntities().size());
|
|
|
|
|
|
+ assertEquals(0, entities.getEntities().size());
|
|
|
|
|
|
conf.setBoolean(MRJobConfig.MAPREDUCE_JOB_EMIT_TIMELINE_DATA, true);
|
|
conf.setBoolean(MRJobConfig.MAPREDUCE_JOB_EMIT_TIMELINE_DATA, true);
|
|
job = UtilsForTests.runJobSucceed(new JobConf(conf), inDir, outDir);
|
|
job = UtilsForTests.runJobSucceed(new JobConf(conf), inDir, outDir);
|
|
- Assert.assertEquals(JobStatus.SUCCEEDED,
|
|
|
|
|
|
+ assertEquals(JobStatus.SUCCEEDED,
|
|
job.getJobStatus().getState().getValue());
|
|
job.getJobStatus().getState().getValue());
|
|
entities = ts.getEntities("MAPREDUCE_JOB", null, null, null, null, null,
|
|
entities = ts.getEntities("MAPREDUCE_JOB", null, null, null, null, null,
|
|
null, null, null, null);
|
|
null, null, null, null);
|
|
- Assert.assertEquals(1, entities.getEntities().size());
|
|
|
|
|
|
+ assertEquals(1, entities.getEntities().size());
|
|
TimelineEntity tEntity = entities.getEntities().get(0);
|
|
TimelineEntity tEntity = entities.getEntities().get(0);
|
|
- Assert.assertEquals(job.getID().toString(), tEntity.getEntityId());
|
|
|
|
|
|
+ assertEquals(job.getID().toString(), tEntity.getEntityId());
|
|
} finally {
|
|
} finally {
|
|
if (cluster != null) {
|
|
if (cluster != null) {
|
|
cluster.stop();
|
|
cluster.stop();
|