Repository: tez Updated Branches: refs/heads/branch-0.5 9fef9a0b5 -> 5a2ff8fce
TEZ-1722. DAG should be related to Application Id in ATS data. (hitesh) (cherry picked from commit c570a0e12921fff5787877ceb5612b08115d77a4) Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/5a2ff8fc Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/5a2ff8fc Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/5a2ff8fc Branch: refs/heads/branch-0.5 Commit: 5a2ff8fce45f95846cb5e843450f7637d65485e4 Parents: 9fef9a0 Author: Hitesh Shah <[email protected]> Authored: Thu Oct 30 16:23:27 2014 -0700 Committer: Hitesh Shah <[email protected]> Committed: Thu Oct 30 16:25:42 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/5a2ff8fc/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 225d572..4c90303 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -83,6 +83,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/5a2ff8fc/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/5a2ff8fc/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/5a2ff8fc/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()));
