tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hit...@apache.org
Subject tez git commit: TEZ-1670. Add tests for all converter functions in HistoryEventTimelineConversion. (Tatsuya Nishiyama via hitesh)
Date Wed, 11 Nov 2015 19:34:17 GMT
Repository: tez
Updated Branches:
  refs/heads/master 4de112b68 -> 6562a9d88


TEZ-1670. Add tests for all converter functions in HistoryEventTimelineConversion. (Tatsuya
Nishiyama via hitesh)


Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/6562a9d8
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/6562a9d8
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/6562a9d8

Branch: refs/heads/master
Commit: 6562a9d882fc455f511dd9d93af1d159d3e3e71b
Parents: 4de112b
Author: Hitesh Shah <hitesh@apache.org>
Authored: Wed Nov 11 11:33:21 2015 -0800
Committer: Hitesh Shah <hitesh@apache.org>
Committed: Wed Nov 11 11:33:21 2015 -0800

----------------------------------------------------------------------
 CHANGES.txt                                     |  2 +
 .../ats/TestHistoryEventTimelineConversion.java | 61 ++++++++++++++++++++
 2 files changed, 63 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/6562a9d8/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index fd77c0b..fad9154 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -7,6 +7,7 @@ INCOMPATIBLE CHANGES
   TEZ-2679. Admin forms of launch env settings
 
 ALL CHANGES:
+  TEZ-1670. Add tests for all converter functions in HistoryEventTimelineConversion.
   TEZ-2929. Tez UI: Dag details page displays vertices to be running even when dag have completed
   TEZ-1976. Findbug warning: Unread field:
   org.apache.hadoop.mapreduce.split.TezGroupedSplitsInputFormat$SplitHolder.split
@@ -245,6 +246,7 @@ INCOMPATIBLE CHANGES
   TEZ-2679. Admin forms of launch env settings
 
 ALL CHANGES
+  TEZ-1670. Add tests for all converter functions in HistoryEventTimelineConversion.
   TEZ-2922. Tez Live UI gives access denied for admins
   TEZ-2828. Fix typo in "Shuffle assigned " log statement in shuffle.orderedgrouped.Shuffle.
   TEZ-2900. Ignore V_INPUT_DATA_INFORMATION when vertex is in Failed/Killed/Error

http://git-wip-us.apache.org/repos/asf/tez/blob/6562a9d8/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 97d0b64..8e589d2 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
@@ -319,6 +319,33 @@ public class TestHistoryEventTimelineConversion {
   }
 
   @Test(timeout = 5000)
+  public void testConvertAMStartedEvent() {
+    long startTime = random.nextLong();
+
+    AMStartedEvent event = new AMStartedEvent(applicationAttemptId, startTime, user);
+
+    TimelineEntity timelineEntity = HistoryEventTimelineConversion.convertToTimelineEntity(event);
+
+    Assert.assertEquals("tez_" + applicationAttemptId.toString(), timelineEntity.getEntityId());
+    Assert.assertEquals(EntityTypes.TEZ_APPLICATION_ATTEMPT.name(), timelineEntity.getEntityType());
+
+    final Map<String, Set<String>> relatedEntities = timelineEntity.getRelatedEntities();
+    Assert.assertEquals(0, relatedEntities.size());
+
+    final Map<String, Set<Object>> primaryFilters = timelineEntity.getPrimaryFilters();
+    Assert.assertEquals(2, primaryFilters.size());
+    Assert.assertTrue(primaryFilters.get(ATSConstants.USER).contains(user));
+    Assert.assertTrue(primaryFilters.get(ATSConstants.APPLICATION_ID)
+            .contains(applicationId.toString()));
+
+    Assert.assertEquals(1, timelineEntity.getEvents().size());
+    TimelineEvent evt = timelineEntity.getEvents().get(0);
+    Assert.assertEquals(HistoryEventType.AM_STARTED.name(), evt.getEventType());
+    Assert.assertEquals(startTime, evt.getTimestamp());
+
+  }
+
+  @Test(timeout = 5000)
   public void testConvertContainerLaunchedEvent() {
     long launchTime = random.nextLong();
     ContainerLaunchedEvent event = new ContainerLaunchedEvent(containerId, launchTime,
@@ -681,6 +708,40 @@ public class TestHistoryEventTimelineConversion {
   }
 
   @Test(timeout = 5000)
+  public void testConvertVertexStartedEvent() {
+    long startRequestedTime = random.nextLong();
+    long startTime = random.nextLong();
+
+    VertexStartedEvent event = new VertexStartedEvent(tezVertexID, startRequestedTime, startTime);
+
+    TimelineEntity timelineEntity = HistoryEventTimelineConversion.convertToTimelineEntity(event);
+    Assert.assertEquals(EntityTypes.TEZ_VERTEX_ID.name(), timelineEntity.getEntityType());
+    Assert.assertEquals(tezVertexID.toString(), timelineEntity.getEntityId());
+
+    Assert.assertEquals(0, timelineEntity.getRelatedEntities().size());
+
+    Assert.assertEquals(2, timelineEntity.getPrimaryFilters().size());
+    Assert.assertTrue(timelineEntity.getPrimaryFilters().get(ATSConstants.APPLICATION_ID)
+            .contains(applicationId.toString()));
+    Assert.assertTrue(
+            timelineEntity.getPrimaryFilters().get(EntityTypes.TEZ_DAG_ID.name()).contains(
+                    tezDAGID.toString()));
+
+    Assert.assertEquals(1, timelineEntity.getEvents().size());
+    TimelineEvent timelineEvent = timelineEntity.getEvents().get(0);
+    Assert.assertEquals(HistoryEventType.VERTEX_STARTED.name(), timelineEvent.getEventType());
+    Assert.assertEquals(startTime, timelineEvent.getTimestamp());
+
+    Assert.assertEquals(3, timelineEntity.getOtherInfo().size());
+    Assert.assertEquals(startRequestedTime,
+            ((Long) timelineEntity.getOtherInfo().get(ATSConstants.START_REQUESTED_TIME)).longValue());
+    Assert.assertEquals(startTime,
+            ((Long) timelineEntity.getOtherInfo().get(ATSConstants.START_TIME)).longValue());
+    Assert.assertEquals(VertexState.RUNNING.name(),
+            timelineEntity.getOtherInfo().get(ATSConstants.STATUS));
+  }
+
+  @Test(timeout = 5000)
   public void testConvertVertexFinishedEvent() {
     long initRequestedTime = random.nextLong();
     long initedTime = random.nextLong();


Mime
View raw message