Repository: tez Updated Branches: refs/heads/master ede0e645a -> c570a0e12
TEZ-1722. DAG should be related to Application Id in ATS data. (hitesh) Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/c570a0e1 Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/c570a0e1 Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/c570a0e1 Branch: refs/heads/master Commit: c570a0e12921fff5787877ceb5612b08115d77a4 Parents: ede0e64 Author: Hitesh Shah <[email protected]> Authored: Thu Oct 30 16:23:27 2014 -0700 Committer: Hitesh Shah <[email protected]> Committed: Thu Oct 30 16:23:27 2014 -0700 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../dag/history/logging/impl/HistoryEventJsonConversion.java | 8 +++++++- .../history/logging/ats/HistoryEventTimelineConversion.java | 2 ++ .../logging/ats/TestHistoryEventTimelineConversion.java | 5 ++++- 4 files changed, 14 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/c570a0e1/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 5d6ebf5..68d4838 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -90,6 +90,7 @@ ALL CHANGES: TEZ-1700. Replace containerId from TaskLocationHint with [TaskIndex+Vertex] based affinity TEZ-1716. Additional ATS data for UI. + TEZ-1722. DAG should be related to Application Id in ATS data. Release 0.5.1: 2014-10-02 http://git-wip-us.apache.org/repos/asf/tez/blob/c570a0e1/tez-dag/src/main/java/org/apache/tez/dag/history/logging/impl/HistoryEventJsonConversion.java ---------------------------------------------------------------------- diff --git a/tez-dag/src/main/java/org/apache/tez/dag/history/logging/impl/HistoryEventJsonConversion.java b/tez-dag/src/main/java/org/apache/tez/dag/history/logging/impl/HistoryEventJsonConversion.java index 0b6f9d2..8560359 100644 --- a/tez-dag/src/main/java/org/apache/tez/dag/history/logging/impl/HistoryEventJsonConversion.java +++ b/tez-dag/src/main/java/org/apache/tez/dag/history/logging/impl/HistoryEventJsonConversion.java @@ -409,8 +409,13 @@ public class HistoryEventJsonConversion { JSONArray relatedEntities = new JSONArray(); JSONObject tezAppEntity = new JSONObject(); tezAppEntity.put(ATSConstants.ENTITY, - "tez_" + event.getApplicationAttemptId().toString()); + "tez_" + event.getApplicationAttemptId().getApplicationId().toString()); tezAppEntity.put(ATSConstants.ENTITY_TYPE, + EntityTypes.TEZ_APPLICATION.name()); + JSONObject tezAppAttemptEntity = new JSONObject(); + tezAppAttemptEntity.put(ATSConstants.ENTITY, + "tez_" + event.getApplicationAttemptId().toString()); + tezAppAttemptEntity.put(ATSConstants.ENTITY_TYPE, EntityTypes.TEZ_APPLICATION_ATTEMPT.name()); JSONObject appEntity = new JSONObject(); appEntity.put(ATSConstants.ENTITY, @@ -429,6 +434,7 @@ public class HistoryEventJsonConversion { ATSConstants.USER); relatedEntities.put(tezAppEntity); + relatedEntities.put(tezAppAttemptEntity); relatedEntities.put(appEntity); relatedEntities.put(appAttemptEntity); relatedEntities.put(userEntity); http://git-wip-us.apache.org/repos/asf/tez/blob/c570a0e1/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 a492408..865915e 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 @@ -318,6 +318,8 @@ public class HistoryEventTimelineConversion { atsEntity.setEntityId(event.getDagID().toString()); atsEntity.setEntityType(EntityTypes.TEZ_DAG_ID.name()); + atsEntity.addRelatedEntity(EntityTypes.TEZ_APPLICATION.name(), + "tez_" + event.getApplicationAttemptId().getApplicationId().toString()); atsEntity.addRelatedEntity(EntityTypes.TEZ_APPLICATION_ATTEMPT.name(), "tez_" + event.getApplicationAttemptId().toString()); atsEntity.addRelatedEntity(ATSConstants.APPLICATION_ID, http://git-wip-us.apache.org/repos/asf/tez/blob/c570a0e1/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 ba71d46..2fed18b 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 @@ -267,7 +267,10 @@ public class TestHistoryEventTimelineConversion { Assert.assertEquals(EntityTypes.TEZ_DAG_ID.name(), timelineEntity.getEntityType()); Assert.assertEquals(tezDAGID.toString(), timelineEntity.getEntityId()); - Assert.assertEquals(4, timelineEntity.getRelatedEntities().size()); + Assert.assertEquals(5, timelineEntity.getRelatedEntities().size()); + Assert.assertTrue( + timelineEntity.getRelatedEntities().get(EntityTypes.TEZ_APPLICATION.name()).contains( + "tez_" + applicationId.toString())); Assert.assertTrue( timelineEntity.getRelatedEntities().get(EntityTypes.TEZ_APPLICATION_ATTEMPT.name()).contains( "tez_" + applicationAttemptId.toString()));
