Repository: tez Updated Branches: refs/heads/branch-0.6 7f6b1941e -> 548e12c21
TEZ-2097. TEZ-UI Add dag logs backend support (jeagles) (cherry picked from commit 6930e4baf04660ef52130169b02c2b1ef34229d6) (cherry picked from commit b939cc38b12b8dfa8c65846ffe66c4f41e66bb7d) Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/548e12c2 Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/548e12c2 Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/548e12c2 Branch: refs/heads/branch-0.6 Commit: 548e12c212788d8884d036e484a36d7864ae9d11 Parents: 7f6b194 Author: Jonathan Eagles <[email protected]> Authored: Fri Sep 18 21:35:11 2015 -0500 Committer: Jonathan Eagles <[email protected]> Committed: Fri Sep 18 21:35:11 2015 -0500 ---------------------------------------------------------------------- .../org/apache/tez/dag/app/DAGAppMaster.java | 27 +++++++++++++++++--- .../dag/history/events/DAGRecoveredEvent.java | 12 ++++++--- .../dag/history/events/DAGSubmittedEvent.java | 9 +++++-- .../apache/tez/dag/app/TestRecoveryParser.java | 8 +++--- .../TestHistoryEventsProtoConversion.java | 4 +-- .../impl/TestHistoryEventJsonConversion.java | 4 +-- .../ats/acls/TestATSHistoryWithACLs.java | 4 +-- .../ats/HistoryEventTimelineConversion.java | 4 +++ .../ats/TestHistoryEventTimelineConversion.java | 23 ++++++++++++----- 9 files changed, 70 insertions(+), 25 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/548e12c2/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java ---------------------------------------------------------------------- diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java b/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java index e9f710e..cb77d6e 100644 --- a/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java +++ b/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java @@ -165,6 +165,7 @@ import org.codehaus.jettison.json.JSONException; import com.google.common.annotations.VisibleForTesting; import com.google.common.base.Function; +import com.google.common.base.Joiner; import com.google.common.collect.Maps; /** @@ -194,6 +195,7 @@ public class DAGAppMaster extends AbstractService { * Priority of the DAGAppMaster shutdown hook. */ public static final int SHUTDOWN_HOOK_PRIORITY = 30; + private static final Joiner PATH_JOINER = Joiner.on('/'); private static Pattern sanitizeLabelPattern = Pattern.compile("[:\\-\\W]+"); @@ -230,6 +232,7 @@ public class DAGAppMaster extends AbstractService { private HistoryEventHandler historyEventHandler; private final Map<String, LocalResource> amResources = new HashMap<String, LocalResource>(); private final Map<String, LocalResource> cumulativeAdditionalResources = new HashMap<String, LocalResource>(); + private String containerLogs; private boolean isLocal = false; //Local mode flag @@ -309,6 +312,18 @@ public class DAGAppMaster extends AbstractService { + ", versionInfo=" + dagVersionInfo.toString()); } + // Pull this WebAppUtils function into Tez until YARN-4186 + public static String getRunningLogURL(String nodeHttpAddress, + String containerId, String user) { + if (nodeHttpAddress == null || nodeHttpAddress.isEmpty() + || containerId == null || containerId.isEmpty() || user == null + || user.isEmpty()) { + return null; + } + return PATH_JOINER.join(nodeHttpAddress, "node", "containerlogs", + containerId, user); + } + @Override public synchronized void serviceInit(final Configuration conf) throws Exception { @@ -356,6 +371,8 @@ public class DAGAppMaster extends AbstractService { conf.setBoolean(Dispatcher.DISPATCHER_EXIT_ON_ERROR_KEY, !isLocal); String strAppId = this.appAttemptID.getApplicationId().toString(); this.tezSystemStagingDir = TezCommonUtils.getTezSystemStagingPath(conf, strAppId); + this.containerLogs = getRunningLogURL(this.nmHost + ":" + this.nmHttpPort, + this.containerID.toString(), this.appMasterUgi.getShortUserName()); dispatcher = createDispatcher(); context = new RunningAppContext(conf); @@ -1676,7 +1693,8 @@ public class DAGAppMaster extends AbstractService { DAGRecoveredEvent dagRecoveredEvent = new DAGRecoveredEvent(this.appAttemptID, recoveredDAGData.recoveredDAG.getID(), recoveredDAGData.recoveredDAG.getName(), recoveredDAGData.recoveredDAG.getUserName(), - this.clock.getTime(), DAGState.FAILED, recoveredDAGData.reason); + this.clock.getTime(), DAGState.FAILED, recoveredDAGData.reason, + this.containerLogs); dagRecoveredEvent.setHistoryLoggingEnabled( recoveredDAGData.recoveredDAG.getConf().getBoolean( TezConfiguration.TEZ_DAG_HISTORY_LOGGING_ENABLED, @@ -1692,7 +1710,7 @@ public class DAGAppMaster extends AbstractService { DAGRecoveredEvent dagRecoveredEvent = new DAGRecoveredEvent(this.appAttemptID, recoveredDAGData.recoveredDAG.getID(), recoveredDAGData.recoveredDAG.getName(), recoveredDAGData.recoveredDAG.getUserName(), this.clock.getTime(), - recoveredDAGData.dagState, null); + recoveredDAGData.dagState, null, this.containerLogs); this.historyEventHandler.handle(new DAGHistoryEvent(recoveredDAGData.recoveredDAG.getID(), dagRecoveredEvent)); dagEventDispatcher.handle(recoverDAGEvent); @@ -1703,7 +1721,7 @@ public class DAGAppMaster extends AbstractService { _updateLoggers(recoveredDAGData.recoveredDAG, ""); DAGRecoveredEvent dagRecoveredEvent = new DAGRecoveredEvent(this.appAttemptID, recoveredDAGData.recoveredDAG.getID(), recoveredDAGData.recoveredDAG.getName(), - recoveredDAGData.recoveredDAG.getUserName(), this.clock.getTime()); + recoveredDAGData.recoveredDAG.getUserName(), this.clock.getTime(), this.containerLogs); this.historyEventHandler.handle(new DAGHistoryEvent(recoveredDAGData.recoveredDAG.getID(), dagRecoveredEvent)); DAGEventRecoverEvent recoverDAGEvent = new DAGEventRecoverEvent( @@ -2057,11 +2075,12 @@ public class DAGAppMaster extends AbstractService { String timeStamp = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(Calendar.getInstance().getTime()); System.err.println(timeStamp + " Running Dag: "+ newDAG.getID()); System.out.println(timeStamp + " Running Dag: "+ newDAG.getID()); + // Job name is the same as the app name until we support multiple dags // for an app later DAGSubmittedEvent submittedEvent = new DAGSubmittedEvent(newDAG.getID(), submitTime, dagPlan, this.appAttemptID, cumulativeAdditionalResources, - newDAG.getUserName(), newDAG.getConf()); + newDAG.getUserName(), newDAG.getConf(), containerLogs); boolean dagLoggingEnabled = newDAG.getConf().getBoolean( TezConfiguration.TEZ_DAG_HISTORY_LOGGING_ENABLED, TezConfiguration.TEZ_DAG_HISTORY_LOGGING_ENABLED_DEFAULT); http://git-wip-us.apache.org/repos/asf/tez/blob/548e12c2/tez-dag/src/main/java/org/apache/tez/dag/history/events/DAGRecoveredEvent.java ---------------------------------------------------------------------- diff --git a/tez-dag/src/main/java/org/apache/tez/dag/history/events/DAGRecoveredEvent.java b/tez-dag/src/main/java/org/apache/tez/dag/history/events/DAGRecoveredEvent.java index 7109756..2bfa43b 100644 --- a/tez-dag/src/main/java/org/apache/tez/dag/history/events/DAGRecoveredEvent.java +++ b/tez-dag/src/main/java/org/apache/tez/dag/history/events/DAGRecoveredEvent.java @@ -39,11 +39,12 @@ public class DAGRecoveredEvent implements HistoryEvent { private final String user; private boolean historyLoggingEnabled = true; + private String containerLogs; public DAGRecoveredEvent(ApplicationAttemptId applicationAttemptId, TezDAGID dagId, String dagName, String user, long recoveredTime, DAGState recoveredState, - String recoveryFailureReason) { + String recoveryFailureReason, String containerLogs) { this.applicationAttemptId = applicationAttemptId; this.dagID = dagId; this.dagName = dagName; @@ -51,11 +52,12 @@ public class DAGRecoveredEvent implements HistoryEvent { this.recoveredTime = recoveredTime; this.recoveredDagState = recoveredState; this.recoveryFailureReason = recoveryFailureReason; + this.containerLogs = containerLogs; } public DAGRecoveredEvent(ApplicationAttemptId applicationAttemptId, - TezDAGID dagId, String dagName, String user, long recoveredTime) { - this(applicationAttemptId, dagId, dagName, user, recoveredTime, null, null); + TezDAGID dagId, String dagName, String user, long recoveredTime, String containerLogs) { + this(applicationAttemptId, dagId, dagName, user, recoveredTime, null, null, containerLogs); } @Override @@ -121,6 +123,10 @@ public class DAGRecoveredEvent implements HistoryEvent { this.historyLoggingEnabled = historyLoggingEnabled; } + public String getContainerLogs() { + return containerLogs; + } + @Override public String toString() { return "applicationAttemptId=" http://git-wip-us.apache.org/repos/asf/tez/blob/548e12c2/tez-dag/src/main/java/org/apache/tez/dag/history/events/DAGSubmittedEvent.java ---------------------------------------------------------------------- diff --git a/tez-dag/src/main/java/org/apache/tez/dag/history/events/DAGSubmittedEvent.java b/tez-dag/src/main/java/org/apache/tez/dag/history/events/DAGSubmittedEvent.java index ecd1384..381aea6 100644 --- a/tez-dag/src/main/java/org/apache/tez/dag/history/events/DAGSubmittedEvent.java +++ b/tez-dag/src/main/java/org/apache/tez/dag/history/events/DAGSubmittedEvent.java @@ -55,8 +55,8 @@ public class DAGSubmittedEvent implements HistoryEvent, SummaryEvent { private String user; private Map<String, LocalResource> cumulativeAdditionalLocalResources; private boolean historyLoggingEnabled = true; - private Configuration conf; + private String containerLogs; public DAGSubmittedEvent() { } @@ -64,7 +64,7 @@ public class DAGSubmittedEvent implements HistoryEvent, SummaryEvent { public DAGSubmittedEvent(TezDAGID dagID, long submitTime, DAGProtos.DAGPlan dagPlan, ApplicationAttemptId applicationAttemptId, Map<String, LocalResource> cumulativeAdditionalLocalResources, - String user, Configuration conf) { + String user, Configuration conf, String containerLogs) { this.dagID = dagID; this.dagName = dagPlan.getName(); this.submitTime = submitTime; @@ -73,6 +73,7 @@ public class DAGSubmittedEvent implements HistoryEvent, SummaryEvent { this.cumulativeAdditionalLocalResources = cumulativeAdditionalLocalResources; this.user = user; this.conf = conf; + this.containerLogs = containerLogs; } @Override @@ -198,4 +199,8 @@ public class DAGSubmittedEvent implements HistoryEvent, SummaryEvent { public boolean isHistoryLoggingEnabled() { return historyLoggingEnabled; } + + public String getContainerLogs() { + return containerLogs; + } } http://git-wip-us.apache.org/repos/asf/tez/blob/548e12c2/tez-dag/src/test/java/org/apache/tez/dag/app/TestRecoveryParser.java ---------------------------------------------------------------------- diff --git a/tez-dag/src/test/java/org/apache/tez/dag/app/TestRecoveryParser.java b/tez-dag/src/test/java/org/apache/tez/dag/app/TestRecoveryParser.java index 3fd30c5..a503b0a 100644 --- a/tez-dag/src/test/java/org/apache/tez/dag/app/TestRecoveryParser.java +++ b/tez-dag/src/test/java/org/apache/tez/dag/app/TestRecoveryParser.java @@ -137,7 +137,7 @@ public class TestRecoveryParser { rService.start(); rService.handle(new DAGHistoryEvent(dagID, new DAGSubmittedEvent(dagID, 1L, dagPlan, ApplicationAttemptId.newInstance(appId, 1), - null, "user", new Configuration()))); + null, "user", new Configuration(), null))); rService.handle(new DAGHistoryEvent(dagID, new DAGInitializedEvent(dagID, 1L, "user", dagPlan.getName(), null))); // only for testing, DAGCommitStartedEvent is not supposed to happen at this time. @@ -183,7 +183,7 @@ public class TestRecoveryParser { rService.start(); rService.handle(new DAGHistoryEvent(dagID, new DAGSubmittedEvent(dagID, 1L, dagPlan, ApplicationAttemptId.newInstance(appId, 1), - null, "user", new Configuration()))); + null, "user", new Configuration(), null))); rService.handle(new DAGHistoryEvent(dagID, new DAGInitializedEvent(dagID, 1L, "user", dagPlan.getName(), null))); rService.handle(new DAGHistoryEvent(dagID, @@ -230,7 +230,7 @@ public class TestRecoveryParser { rService.start(); rService.handle(new DAGHistoryEvent(dagID, new DAGSubmittedEvent(dagID, 1L, dagPlan, ApplicationAttemptId.newInstance(appId, 1), - null, "user", new Configuration()))); + null, "user", new Configuration(), null))); // wait until DAGSubmittedEvent is handled in the RecoveryEventHandling thread rService.await(); rService.outputStreamMap.get(dagID).writeUTF("INVALID_DATA"); @@ -276,7 +276,7 @@ public class TestRecoveryParser { // write a DAGSubmittedEvent first to initialize summaryStream rService.handle(new DAGHistoryEvent(dagID, new DAGSubmittedEvent(dagID, 1L, dagPlan, ApplicationAttemptId.newInstance(appId, 1), - null, "user", new Configuration()))); + null, "user", new Configuration(), null))); // write an corrupted SummaryEvent rService.summaryStream.writeChars("INVALID_DATA"); rService.stop(); http://git-wip-us.apache.org/repos/asf/tez/blob/548e12c2/tez-dag/src/test/java/org/apache/tez/dag/history/events/TestHistoryEventsProtoConversion.java ---------------------------------------------------------------------- diff --git a/tez-dag/src/test/java/org/apache/tez/dag/history/events/TestHistoryEventsProtoConversion.java b/tez-dag/src/test/java/org/apache/tez/dag/history/events/TestHistoryEventsProtoConversion.java index 5194e54..07eb09b 100644 --- a/tez-dag/src/test/java/org/apache/tez/dag/history/events/TestHistoryEventsProtoConversion.java +++ b/tez-dag/src/test/java/org/apache/tez/dag/history/events/TestHistoryEventsProtoConversion.java @@ -168,7 +168,7 @@ public class TestHistoryEventsProtoConversion { ApplicationId.newInstance(0, 1), 1), 1001l, DAGPlan.newBuilder().setName("foo").build(), ApplicationAttemptId.newInstance( - ApplicationId.newInstance(0, 1), 1), null, "", null); + ApplicationId.newInstance(0, 1), 1), null, "", null, null); DAGSubmittedEvent deserializedEvent = (DAGSubmittedEvent) testProtoConversion(event); Assert.assertEquals(event.getApplicationAttemptId(), @@ -733,7 +733,7 @@ public class TestHistoryEventsProtoConversion { DAGRecoveredEvent dagRecoveredEvent = new DAGRecoveredEvent( ApplicationAttemptId.newInstance(ApplicationId.newInstance(0, 1), 1), TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), - "mockDagname", "mockuser", 100334l); + "mockDagname", "mockuser", 100334l, null); try { testProtoConversion(dagRecoveredEvent); Assert.fail("Proto conversion should have failed"); http://git-wip-us.apache.org/repos/asf/tez/blob/548e12c2/tez-dag/src/test/java/org/apache/tez/dag/history/logging/impl/TestHistoryEventJsonConversion.java ---------------------------------------------------------------------- diff --git a/tez-dag/src/test/java/org/apache/tez/dag/history/logging/impl/TestHistoryEventJsonConversion.java b/tez-dag/src/test/java/org/apache/tez/dag/history/logging/impl/TestHistoryEventJsonConversion.java index 0beda20..a889957 100644 --- a/tez-dag/src/test/java/org/apache/tez/dag/history/logging/impl/TestHistoryEventJsonConversion.java +++ b/tez-dag/src/test/java/org/apache/tez/dag/history/logging/impl/TestHistoryEventJsonConversion.java @@ -118,7 +118,7 @@ public class TestHistoryEventJsonConversion { break; case DAG_SUBMITTED: event = new DAGSubmittedEvent(tezDAGID, random.nextInt(), dagPlan, applicationAttemptId, - null, user, null); + null, user, null, null); break; case DAG_INITIALIZED: event = new DAGInitializedEvent(tezDAGID, random.nextInt(), user, dagPlan.getName(), null); @@ -184,7 +184,7 @@ public class TestHistoryEventJsonConversion { break; case DAG_RECOVERED: event = new DAGRecoveredEvent(applicationAttemptId, tezDAGID, dagPlan.getName(), user, - 1l); + 1l, null); break; case DAG_KILL_REQUEST: event = new DAGKillRequestEvent(); http://git-wip-us.apache.org/repos/asf/tez/blob/548e12c2/tez-plugins/tez-yarn-timeline-history-with-acls/src/test/java/org/apache/tez/dag/history/ats/acls/TestATSHistoryWithACLs.java ---------------------------------------------------------------------- diff --git a/tez-plugins/tez-yarn-timeline-history-with-acls/src/test/java/org/apache/tez/dag/history/ats/acls/TestATSHistoryWithACLs.java b/tez-plugins/tez-yarn-timeline-history-with-acls/src/test/java/org/apache/tez/dag/history/ats/acls/TestATSHistoryWithACLs.java index 6387106..0a5b866 100644 --- a/tez-plugins/tez-yarn-timeline-history-with-acls/src/test/java/org/apache/tez/dag/history/ats/acls/TestATSHistoryWithACLs.java +++ b/tez-plugins/tez-yarn-timeline-history-with-acls/src/test/java/org/apache/tez/dag/history/ats/acls/TestATSHistoryWithACLs.java @@ -574,7 +574,7 @@ public class TestATSHistoryWithACLs { DAGPlan dagPlan = DAGPlan.newBuilder().setName("DAGPlanMock").build(); DAGSubmittedEvent submittedEvent = new DAGSubmittedEvent(tezDAGID, 1, dagPlan, appAttemptId, null, - "usr", tezConf); + "usr", tezConf, null); submittedEvent.setHistoryLoggingEnabled(false); DAGHistoryEvent event = new DAGHistoryEvent(tezDAGID, submittedEvent); historyLoggingService.handle(new DAGHistoryEvent(tezDAGID, submittedEvent)); @@ -616,7 +616,7 @@ public class TestATSHistoryWithACLs { DAGPlan dagPlan = DAGPlan.newBuilder().setName("DAGPlanMock").build(); DAGSubmittedEvent submittedEvent = new DAGSubmittedEvent(tezDAGID, 1, dagPlan, appAttemptId, null, - "usr", tezConf); + "usr", tezConf, null); submittedEvent.setHistoryLoggingEnabled(true); DAGHistoryEvent event = new DAGHistoryEvent(tezDAGID, submittedEvent); historyLoggingService.handle(new DAGHistoryEvent(tezDAGID, submittedEvent)); http://git-wip-us.apache.org/repos/asf/tez/blob/548e12c2/tez-plugins/tez-yarn-timeline-history/src/main/java/org/apache/tez/dag/history/logging/ats/HistoryEventTimelineConversion.java ---------------------------------------------------------------------- diff --git a/tez-plugins/tez-yarn-timeline-history/src/main/java/org/apache/tez/dag/history/logging/ats/HistoryEventTimelineConversion.java b/tez-plugins/tez-yarn-timeline-history/src/main/java/org/apache/tez/dag/history/logging/ats/HistoryEventTimelineConversion.java index 2002f53..4c53337 100644 --- a/tez-plugins/tez-yarn-timeline-history/src/main/java/org/apache/tez/dag/history/logging/ats/HistoryEventTimelineConversion.java +++ b/tez-plugins/tez-yarn-timeline-history/src/main/java/org/apache/tez/dag/history/logging/ats/HistoryEventTimelineConversion.java @@ -158,6 +158,8 @@ public class HistoryEventTimelineConversion { atsEntity.addPrimaryFilter(ATSConstants.APPLICATION_ID, event.getApplicationAttemptId().getApplicationId().toString()); atsEntity.addPrimaryFilter(ATSConstants.DAG_NAME, event.getDagName()); + atsEntity.addOtherInfo(ATSConstants.IN_PROGRESS_LOGS_URL + "_" + + event.getApplicationAttemptId().getAttemptId(), event.getContainerLogs()); return atsEntity; } @@ -398,6 +400,8 @@ public class HistoryEventTimelineConversion { atsEntity.addOtherInfo(ATSConstants.APPLICATION_ATTEMPT_ID, event.getApplicationAttemptId().toString()); atsEntity.addOtherInfo(ATSConstants.USER, event.getUser()); + atsEntity.addOtherInfo(ATSConstants.IN_PROGRESS_LOGS_URL + "_" + + event.getApplicationAttemptId().getAttemptId(), event.getContainerLogs()); return atsEntity; } http://git-wip-us.apache.org/repos/asf/tez/blob/548e12c2/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestHistoryEventTimelineConversion.java ---------------------------------------------------------------------- diff --git a/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestHistoryEventTimelineConversion.java b/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestHistoryEventTimelineConversion.java index a6f5f84..436d103 100644 --- a/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestHistoryEventTimelineConversion.java +++ b/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestHistoryEventTimelineConversion.java @@ -91,6 +91,7 @@ public class TestHistoryEventTimelineConversion { private DAGPlan dagPlan; private ContainerId containerId; private NodeId nodeId; + private String containerLogs = "containerLogs"; @Before public void setup() { @@ -123,7 +124,7 @@ public class TestHistoryEventTimelineConversion { break; case DAG_SUBMITTED: event = new DAGSubmittedEvent(tezDAGID, random.nextInt(), dagPlan, applicationAttemptId, - null, user, null); + null, user, null, containerLogs); break; case DAG_INITIALIZED: event = new DAGInitializedEvent(tezDAGID, random.nextInt(), user, dagPlan.getName(), null); @@ -189,7 +190,7 @@ public class TestHistoryEventTimelineConversion { break; case DAG_RECOVERED: event = new DAGRecoveredEvent(applicationAttemptId, tezDAGID, dagPlan.getName(), - user, random.nextLong()); + user, random.nextLong(), containerLogs); break; case DAG_KILL_REQUEST: event = new DAGKillRequestEvent(); @@ -390,7 +391,7 @@ public class TestHistoryEventTimelineConversion { long submitTime = random.nextLong(); DAGSubmittedEvent event = new DAGSubmittedEvent(tezDAGID, submitTime, dagPlan, - applicationAttemptId, null, user, null); + applicationAttemptId, null, user, null, containerLogs); TimelineEntity timelineEntity = HistoryEventTimelineConversion.convertToTimelineEntity(event); Assert.assertEquals(EntityTypes.TEZ_DAG_ID.name(), timelineEntity.getEntityType()); @@ -422,6 +423,7 @@ public class TestHistoryEventTimelineConversion { Assert.assertTrue( timelineEntity.getPrimaryFilters().get(ATSConstants.USER).contains(user)); + Assert.assertEquals(5, timelineEntity.getOtherInfo().size()); Assert.assertTrue(timelineEntity.getOtherInfo().containsKey(ATSConstants.DAG_PLAN)); Assert.assertEquals(applicationId.toString(), timelineEntity.getOtherInfo().get(ATSConstants.APPLICATION_ID)); @@ -431,6 +433,9 @@ public class TestHistoryEventTimelineConversion { timelineEntity.getOtherInfo().get(ATSConstants.APPLICATION_ID)); Assert.assertEquals(user, timelineEntity.getOtherInfo().get(ATSConstants.USER)); + Assert.assertEquals(containerLogs, + timelineEntity.getOtherInfo().get(ATSConstants.IN_PROGRESS_LOGS_URL + "_" + + applicationAttemptId.getAttemptId())); } @Test(timeout = 5000) @@ -852,7 +857,7 @@ public class TestHistoryEventTimelineConversion { long recoverTime = random.nextLong(); DAGRecoveredEvent event = new DAGRecoveredEvent(applicationAttemptId, tezDAGID, - dagPlan.getName(), user, recoverTime); + dagPlan.getName(), user, recoverTime, containerLogs); TimelineEntity timelineEntity = HistoryEventTimelineConversion.convertToTimelineEntity(event); Assert.assertEquals(EntityTypes.TEZ_DAG_ID.name(), timelineEntity.getEntityType()); @@ -877,6 +882,9 @@ public class TestHistoryEventTimelineConversion { timelineEntity.getPrimaryFilters().get(ATSConstants.DAG_NAME).contains("DAGPlanMock")); Assert.assertTrue( timelineEntity.getPrimaryFilters().get(ATSConstants.USER).contains(user)); + Assert.assertEquals(containerLogs, + timelineEntity.getOtherInfo().get(ATSConstants.IN_PROGRESS_LOGS_URL + "_" + + applicationAttemptId.getAttemptId())); } @Test(timeout = 5000) @@ -884,7 +892,7 @@ public class TestHistoryEventTimelineConversion { long recoverTime = random.nextLong(); DAGRecoveredEvent event = new DAGRecoveredEvent(applicationAttemptId, tezDAGID, - dagPlan.getName(), user, recoverTime, DAGState.ERROR, "mock reason"); + dagPlan.getName(), user, recoverTime, DAGState.ERROR, "mock reason", containerLogs); TimelineEntity timelineEntity = HistoryEventTimelineConversion.convertToTimelineEntity(event); @@ -914,7 +922,10 @@ public class TestHistoryEventTimelineConversion { timelineEntity.getPrimaryFilters().get(ATSConstants.DAG_NAME).contains("DAGPlanMock")); Assert.assertTrue( timelineEntity.getPrimaryFilters().get(ATSConstants.USER).contains(user)); + Assert.assertEquals(containerLogs, + timelineEntity.getOtherInfo().get(ATSConstants.IN_PROGRESS_LOGS_URL + "_" + + applicationAttemptId.getAttemptId())); } -} \ No newline at end of file +}
