Repository: tez
Updated Branches:
  refs/heads/master 09a6d1a0d -> 42ef63665


TEZ-2997. Tez UI: Support searches by CallerContext ID for DAGs (sree)


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

Branch: refs/heads/master
Commit: 42ef63665644c80110fd542e832d8b1e2bb1404e
Parents: 09a6d1a
Author: Sreenath Somarajapuram <[email protected]>
Authored: Tue Dec 15 17:34:44 2015 +0530
Committer: Sreenath Somarajapuram <[email protected]>
Committed: Tue Dec 15 17:34:44 2015 +0530

----------------------------------------------------------------------
 CHANGES.txt                                     |  1 +
 .../apache/tez/dag/app/dag/impl/DAGImpl.java    |  5 +++--
 .../dag/history/events/DAGFinishedEvent.java    |  8 ++++++-
 .../apache/tez/dag/app/TestRecoveryParser.java  |  4 ++--
 .../TestHistoryEventsProtoConversion.java       |  5 +++--
 .../impl/TestHistoryEventJsonConversion.java    |  2 +-
 .../history/recovery/TestRecoveryService.java   |  8 +++----
 .../ats/HistoryEventTimelineConversion.java     |  5 +++++
 .../ats/TestHistoryEventTimelineConversion.java |  9 +++++---
 .../java/org/apache/tez/test/TestRecovery.java  |  4 ++--
 .../app/scripts/controllers/dags_controller.js  | 23 +++++++++++++++-----
 .../controllers/tez-app-dags-controller.js      |  6 +++++
 .../app/scripts/models/TimelineRestAdapter.js   |  3 ++-
 .../src/main/webapp/app/scripts/models/dag.js   |  4 +++-
 tez-ui/src/main/webapp/app/templates/dags.hbs   | 10 +++++++++
 15 files changed, 73 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/42ef6366/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 808bef6..0236084 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -10,6 +10,7 @@ INCOMPATIBLE CHANGES
   TEZ-604. Revert temporary changes made in TEZ-603 to kill the provided tez 
session, if running a MapReduce job.
 
 ALL CHANGES:
+  TEZ-2997. Tez UI: Support searches by CallerContext ID for DAGs
   TEZ-2996. TestAnalyzer fails in trunk after recovery redesign
   TEZ-2987. TestVertexImpl.testTez2684 fails
   TEZ-2995. Timeline primary filter should only be on callerId and not type.

http://git-wip-us.apache.org/repos/asf/tez/blob/42ef6366/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/DAGImpl.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/DAGImpl.java 
b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/DAGImpl.java
index 3d4539d..698f9d6 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/DAGImpl.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/DAGImpl.java
@@ -1222,7 +1222,8 @@ public class DAGImpl implements 
org.apache.tez.dag.app.dag.DAG,
       Map<String, Integer> taskStats = constructTaskStats(getDAGProgress());
       DAGFinishedEvent finishEvt = new DAGFinishedEvent(dagId, startTime,
           finishTime, DAGState.SUCCEEDED, "", counters,
-          this.userName, this.dagName, taskStats, 
this.appContext.getApplicationAttemptId());
+          this.userName, this.dagName, taskStats, 
this.appContext.getApplicationAttemptId(),
+          this.jobPlan);
       this.appContext.getHistoryHandler().handleCriticalEvent(
           new DAGHistoryEvent(dagId, finishEvt));
     }
@@ -1237,7 +1238,7 @@ public class DAGImpl implements 
org.apache.tez.dag.app.dag.DAG,
           clock.getTime(), state,
           StringUtils.join(getDiagnostics(), LINE_SEPARATOR),
           counters, this.userName, this.dagName, taskStats,
-          this.appContext.getApplicationAttemptId());
+          this.appContext.getApplicationAttemptId(), this.jobPlan);
       this.appContext.getHistoryHandler().handleCriticalEvent(
           new DAGHistoryEvent(dagId, finishEvt));
     }

http://git-wip-us.apache.org/repos/asf/tez/blob/42ef6366/tez-dag/src/main/java/org/apache/tez/dag/history/events/DAGFinishedEvent.java
----------------------------------------------------------------------
diff --git 
a/tez-dag/src/main/java/org/apache/tez/dag/history/events/DAGFinishedEvent.java 
b/tez-dag/src/main/java/org/apache/tez/dag/history/events/DAGFinishedEvent.java
index 2f173a9..c395297 100644
--- 
a/tez-dag/src/main/java/org/apache/tez/dag/history/events/DAGFinishedEvent.java
+++ 
b/tez-dag/src/main/java/org/apache/tez/dag/history/events/DAGFinishedEvent.java
@@ -26,6 +26,7 @@ import java.util.Map;
 import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
 import org.apache.tez.common.counters.TezCounters;
 import org.apache.tez.dag.api.DagTypeConverters;
+import org.apache.tez.dag.api.records.DAGProtos.DAGPlan;
 import org.apache.tez.dag.app.dag.DAGState;
 import org.apache.tez.dag.history.HistoryEvent;
 import org.apache.tez.dag.history.HistoryEventType;
@@ -49,6 +50,7 @@ public class DAGFinishedEvent implements HistoryEvent, 
SummaryEvent {
   private String user;
   private String dagName;
   Map<String, Integer> dagTaskStats;
+  private DAGPlan dagPlan;
 
   private ApplicationAttemptId applicationAttemptId;
 
@@ -59,7 +61,7 @@ public class DAGFinishedEvent implements HistoryEvent, 
SummaryEvent {
       long finishTime, DAGState state,
       String diagnostics, TezCounters counters,
       String user, String dagName, Map<String, Integer> dagTaskStats,
-      ApplicationAttemptId applicationAttemptId) {
+      ApplicationAttemptId applicationAttemptId, DAGPlan dagPlan) {
     this.dagID = dagId;
     this.startTime = startTime;
     this.finishTime = finishTime;
@@ -70,6 +72,7 @@ public class DAGFinishedEvent implements HistoryEvent, 
SummaryEvent {
     this.dagName = dagName;
     this.dagTaskStats = dagTaskStats;
     this.applicationAttemptId = applicationAttemptId;
+    this.dagPlan = dagPlan;
   }
 
   @Override
@@ -207,4 +210,7 @@ public class DAGFinishedEvent implements HistoryEvent, 
SummaryEvent {
     return applicationAttemptId;
   }
 
+  public DAGPlan getDAGPlan() {
+    return dagPlan;
+  }
 }

http://git-wip-us.apache.org/repos/asf/tez/blob/42ef6366/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 579bdba..9c688b6 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
@@ -220,7 +220,7 @@ public class TestRecoveryParser {
         new DAGInitializedEvent(dagID, 1L, "user", dagPlan.getName(), null)));
     rService.handle(new DAGHistoryEvent(dagID,
         new DAGFinishedEvent(dagID, 1L, 2L, DAGState.FAILED, "diag", null, 
"user", "dag1", null,
-            appAttemptId)));
+            appAttemptId, dagPlan)));
     rService.handle(new DAGHistoryEvent(dagID, new DAGStartedEvent(dagID, 1L, 
"user", "dag1")));
     rService.stop();
 
@@ -380,7 +380,7 @@ public class TestRecoveryParser {
         new DAGCommitStartedEvent(dagID, 0L)));
     rService.handle(new DAGHistoryEvent(dagID,
         new DAGFinishedEvent(dagID, 1L, 2L, DAGState.FAILED, "diag", null, 
"user", "dag1", null,
-            appAttemptId)));
+            appAttemptId, dagPlan)));
     rService.stop();
 
     DAGRecoveryData dagData = parser.parseRecoveryData();

http://git-wip-us.apache.org/repos/asf/tez/blob/42ef6366/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 14aed3d..d3bd7b8 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
@@ -236,7 +236,8 @@ public class TestHistoryEventsProtoConversion {
     {
       DAGFinishedEvent event = new DAGFinishedEvent(
           TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 1000l, 
20000l,
-          DAGState.FAILED, null, null, "user", "dagName", null, null);
+          DAGState.FAILED, null, null, "user", "dagName", null, null,
+          DAGPlan.newBuilder().setName("dagName").build());
       DAGFinishedEvent deserializedEvent = (DAGFinishedEvent)
           testProtoConversion(event);
       Assert.assertEquals(
@@ -257,7 +258,7 @@ public class TestHistoryEventsProtoConversion {
       DAGFinishedEvent event = new DAGFinishedEvent(
           TezDAGID.getInstance(ApplicationId.newInstance(0, 1), 1), 1000l, 
20000l,
           DAGState.FAILED, "bad diagnostics", tezCounters,
-          "user", "dagName", null, null);
+          "user", "dagName", null, null, 
DAGPlan.newBuilder().setName("dagName").build());
       DAGFinishedEvent deserializedEvent = (DAGFinishedEvent)
           testProtoConversion(event);
       Assert.assertEquals(

http://git-wip-us.apache.org/repos/asf/tez/blob/42ef6366/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 606fb85..b285196 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
@@ -134,7 +134,7 @@ public class TestHistoryEventJsonConversion {
           break;
         case DAG_FINISHED:
           event = new DAGFinishedEvent(tezDAGID, random.nextInt(), 
random.nextInt(), DAGState.ERROR,
-              null, null, user, dagPlan.getName(), null, applicationAttemptId);
+              null, null, user, dagPlan.getName(), null, applicationAttemptId, 
dagPlan);
           break;
         case VERTEX_INITIALIZED:
           event = new VertexInitializedEvent(tezVertexID, "v1", 
random.nextInt(), random.nextInt(),

http://git-wip-us.apache.org/repos/asf/tez/blob/42ef6366/tez-dag/src/test/java/org/apache/tez/dag/history/recovery/TestRecoveryService.java
----------------------------------------------------------------------
diff --git 
a/tez-dag/src/test/java/org/apache/tez/dag/history/recovery/TestRecoveryService.java
 
b/tez-dag/src/test/java/org/apache/tez/dag/history/recovery/TestRecoveryService.java
index 040b407..99094c6 100644
--- 
a/tez-dag/src/test/java/org/apache/tez/dag/history/recovery/TestRecoveryService.java
+++ 
b/tez-dag/src/test/java/org/apache/tez/dag/history/recovery/TestRecoveryService.java
@@ -101,12 +101,12 @@ public class TestRecoveryService {
     // 2 DAGFinishedEvent
     recoveryService.handle(new DAGHistoryEvent(dagId,
         new DAGFinishedEvent(dagId, 1L, 2L, DAGState.FAILED, "diag", null, 
"user", "dag1", null,
-            appAttemptId)));
+            appAttemptId, null)));
     // outputStream removed
     assertFalse(recoveryService.outputStreamMap.containsKey(dagId));
     recoveryService.handle(new DAGHistoryEvent(dagId,
         new DAGFinishedEvent(dagId, 1L, 2L, DAGState.ERROR, "diag", null, 
"user", "dag1", null,
-            appAttemptId)));
+            appAttemptId, null)));
     // no new outputStream opened
     assertEquals(recoveryService.outputStreamMap.size(), 0);
     assertFalse(recoveryService.outputStreamMap.containsKey(dagId));
@@ -132,12 +132,12 @@ public class TestRecoveryService {
     assertFalse(recoveryService.hasRecoveryFailed());
     recoveryService.handle(new DAGHistoryEvent(dagId,
         new DAGFinishedEvent(dagId, 1L, 2L, DAGState.ERROR, "diag", null, 
"user", "dag1", null,
-            appAttemptId)));
+            appAttemptId, null)));
     assertTrue(recoveryService.hasRecoveryFailed());
     // be able to handle event after fatal error
     recoveryService.handle(new DAGHistoryEvent(dagId,
         new DAGFinishedEvent(dagId, 1L, 2L, DAGState.ERROR, "diag", null, 
"user", "dag1", null,
-            appAttemptId)));
+            appAttemptId, null)));
   }
 
   @Test(timeout = 5000)

http://git-wip-us.apache.org/repos/asf/tez/blob/42ef6366/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 afb7650..d6b518b 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
@@ -298,6 +298,11 @@ public class HistoryEventTimelineConversion {
         event.getDagID().getApplicationId().toString());
     atsEntity.addPrimaryFilter(ATSConstants.DAG_NAME, event.getDagName());
     atsEntity.addPrimaryFilter(ATSConstants.STATUS, event.getState().name());
+    if (event.getDAGPlan().hasCallerContext()
+        && event.getDAGPlan().getCallerContext().hasCallerId()) {
+      atsEntity.addPrimaryFilter(ATSConstants.CALLER_CONTEXT_ID,
+          event.getDAGPlan().getCallerContext().getCallerId());
+    }
 
     atsEntity.addOtherInfo(ATSConstants.START_TIME, event.getStartTime());
     atsEntity.addOtherInfo(ATSConstants.FINISH_TIME, event.getFinishTime());

http://git-wip-us.apache.org/repos/asf/tez/blob/42ef6366/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 2350bf0..49b6f9f 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
@@ -153,7 +153,7 @@ public class TestHistoryEventTimelineConversion {
           break;
         case DAG_FINISHED:
           event = new DAGFinishedEvent(tezDAGID, random.nextInt(), 
random.nextInt(), DAGState.ERROR,
-              null, null, user, dagPlan.getName(), null, applicationAttemptId);
+              null, null, user, dagPlan.getName(), null, applicationAttemptId, 
dagPlan);
           break;
         case VERTEX_INITIALIZED:
           event = new VertexInitializedEvent(tezVertexID, "v1", 
random.nextInt(), random.nextInt(),
@@ -611,7 +611,7 @@ public class TestHistoryEventTimelineConversion {
     taskStats.put("BAR", 200);
 
     DAGFinishedEvent event = new DAGFinishedEvent(tezDAGID, startTime, 
finishTime, DAGState.ERROR,
-        "diagnostics", null, user, dagPlan.getName(), taskStats, 
applicationAttemptId);
+        "diagnostics", null, user, dagPlan.getName(), taskStats, 
applicationAttemptId, dagPlan);
 
     TimelineEntity timelineEntity = 
HistoryEventTimelineConversion.convertToTimelineEntity(event);
     Assert.assertEquals(EntityTypes.TEZ_DAG_ID.name(), 
timelineEntity.getEntityType());
@@ -624,7 +624,7 @@ public class TestHistoryEventTimelineConversion {
     Assert.assertEquals(HistoryEventType.DAG_FINISHED.name(), 
timelineEvent.getEventType());
     Assert.assertEquals(finishTime, timelineEvent.getTimestamp());
 
-    Assert.assertEquals(4, timelineEntity.getPrimaryFilters().size());
+    Assert.assertEquals(5, timelineEntity.getPrimaryFilters().size());
     Assert.assertTrue(
         
timelineEntity.getPrimaryFilters().get(ATSConstants.APPLICATION_ID).contains(
             applicationId.toString()));
@@ -635,6 +635,9 @@ public class TestHistoryEventTimelineConversion {
     Assert.assertTrue(
         timelineEntity.getPrimaryFilters().get(ATSConstants.STATUS).contains(
             DAGState.ERROR.name()));
+    Assert.assertTrue(
+        
timelineEntity.getPrimaryFilters().get(ATSConstants.CALLER_CONTEXT_ID).contains(
+            dagPlan.getCallerContext().getCallerId()));
 
     Assert.assertEquals(startTime,
         ((Long) 
timelineEntity.getOtherInfo().get(ATSConstants.START_TIME)).longValue());

http://git-wip-us.apache.org/repos/asf/tez/blob/42ef6366/tez-tests/src/test/java/org/apache/tez/test/TestRecovery.java
----------------------------------------------------------------------
diff --git a/tez-tests/src/test/java/org/apache/tez/test/TestRecovery.java 
b/tez-tests/src/test/java/org/apache/tez/test/TestRecovery.java
index d13298f..4f5ef1a 100644
--- a/tez-tests/src/test/java/org/apache/tez/test/TestRecovery.java
+++ b/tez-tests/src/test/java/org/apache/tez/test/TestRecovery.java
@@ -160,7 +160,7 @@ public class TestRecovery {
             new SimpleShutdownCondition(TIMING.POST, new DAGFinishedEvent(
                 dagId, 0L, 0L, DAGState.SUCCEEDED, "", new TezCounters(),
                 "username", "dagName", new HashMap<String, Integer>(),
-                ApplicationAttemptId.newInstance(appId, 1))),
+                ApplicationAttemptId.newInstance(appId, 1), null)),
             new SimpleShutdownCondition(TIMING.POST,
                 new VertexInitializedEvent(vertexId0, "Tokenizer", 0L, 0L, 0,
                     "", null, initGeneratedEvents)),
@@ -315,7 +315,7 @@ public class TestRecovery {
         new SimpleShutdownCondition(TIMING.POST, new DAGFinishedEvent(dagId,
             0L, 0L, DAGState.SUCCEEDED, "", new TezCounters(), "username",
             "dagName", new HashMap<String, Integer>(), ApplicationAttemptId
-                .newInstance(appId, 1))),
+                .newInstance(appId, 1), null)),
         new SimpleShutdownCondition(TIMING.POST, new VertexInitializedEvent(
             vertexId0, "hashSide", 0L, 0L, 0, "", null, initGeneratedEvents)),
         new SimpleShutdownCondition(TIMING.POST, new VertexInitializedEvent(

http://git-wip-us.apache.org/repos/asf/tez/blob/42ef6366/tez-ui/src/main/webapp/app/scripts/controllers/dags_controller.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/controllers/dags_controller.js 
b/tez-ui/src/main/webapp/app/scripts/controllers/dags_controller.js
index 7a52837..f4d036c 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/dags_controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/dags_controller.js
@@ -34,7 +34,8 @@ App.DagsController = 
Em.ObjectController.extend(App.PaginatedContentMixin, App.C
     user_filter: 'user',
     appId_filter: 'appid',
     id_filter: 'id',
-    dagName_filter: 'dag_name'
+    dagName_filter: 'dag_name',
+    callerId_filter: 'caller_id'
   },
 
   _loadedAllData: false,
@@ -46,6 +47,7 @@ App.DagsController = 
Em.ObjectController.extend(App.PaginatedContentMixin, App.C
   appId_filter: null,
   id_filter: null,
   dagName_filter: null,
+  callerId_filter: null,
 
   boundFilterValues: Em.Object.create({
     status: null
@@ -63,9 +65,11 @@ App.DagsController = 
Em.ObjectController.extend(App.PaginatedContentMixin, App.C
       user: this.get('user_filter'),
       appId: this.get('appId_filter'),
       id: this.get('id_filter'),
-      dagName: this.get('dagName_filter')
+      dagName: this.get('dagName_filter'),
+      callerId: this.get('callerId_filter')
     }));
-  }.observes('status_filter', 'user_filter', 'appId_filter', 'dagName_filter', 
'id_filter'),
+  }.observes('status_filter', 'user_filter', 'appId_filter', 'dagName_filter', 
'id_filter',
+      'callerId_filter'),
 
   _otherInfoFieldsVisible: function () {
     var visibleColumns = this.get('visibleColumnIds') || {},
@@ -101,7 +105,8 @@ App.DagsController = 
Em.ObjectController.extend(App.PaginatedContentMixin, App.C
       primary: {
         dagName: this.dagName_filter,
         applicationId: this.appId_filter,
-        user: this.user_filter
+        user: this.user_filter,
+        callerId: this.callerId_filter
       },
       secondary: {
       }
@@ -147,7 +152,8 @@ App.DagsController = 
Em.ObjectController.extend(App.PaginatedContentMixin, App.C
           (that.dagName_filter && entity.get('name') != that.dagName_filter) ||
           (that.appId_filter && entity.get('applicationId') != 
that.appId_filter) ||
           (that.user_filter && entity.get('user') != that.user_filter) ||
-          (that.status_filter && entity.get('status') != that.status_filter)
+          (that.status_filter && entity.get('status') != that.status_filter) ||
+          (that.callerId_filter && entity.get('callerId') != 
that.callerId_filter)
         ) ? [] : [entity];
 
         return setEntities(entities);
@@ -227,6 +233,7 @@ App.DagsController = 
Em.ObjectController.extend(App.PaginatedContentMixin, App.C
         appId_filter: filterValues.get('appId') || null,
         id_filter: filterValues.get('id') || null,
         dagName_filter: filterValues.get('dagName') || null,
+        callerId_filter: filterValues.get('callerId') || null
       });
       this.loadData();
     }
@@ -338,6 +345,12 @@ App.DagsController = 
Em.ObjectController.extend(App.PaginatedContentMixin, App.C
         }
       },
       {
+        id: 'callerId',
+        headerCellName: 'Context ID',
+        enableFilter: true,
+        contentPath: 'callerId'
+      },
+      {
         id: 'logs',
         headerCellName: 'Logs',
         templateName: 'components/basic-table/multi-logs-cell',

http://git-wip-us.apache.org/repos/asf/tez/blob/42ef6366/tez-ui/src/main/webapp/app/scripts/controllers/tez-app-dags-controller.js
----------------------------------------------------------------------
diff --git 
a/tez-ui/src/main/webapp/app/scripts/controllers/tez-app-dags-controller.js 
b/tez-ui/src/main/webapp/app/scripts/controllers/tez-app-dags-controller.js
index af9da7d..1caca20 100644
--- a/tez-ui/src/main/webapp/app/scripts/controllers/tez-app-dags-controller.js
+++ b/tez-ui/src/main/webapp/app/scripts/controllers/tez-app-dags-controller.js
@@ -158,6 +158,12 @@ App.TezAppDagsController = App.TablePageController.extend({
         getSearchValue: function(row) {
           return App.Helpers.date.timingFormat(row.get('duration'), 1);
         },
+      },
+      {
+        id: 'callerId',
+        headerCellName: 'Context ID',
+        filterID: 'callerId_filter',
+        contentPath: 'callerId'
       }
     ];
   }.property(),

http://git-wip-us.apache.org/repos/asf/tez/blob/42ef6366/tez-ui/src/main/webapp/app/scripts/models/TimelineRestAdapter.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/models/TimelineRestAdapter.js 
b/tez-ui/src/main/webapp/app/scripts/models/TimelineRestAdapter.js
index 71f96df..984dffc 100644
--- a/tez-ui/src/main/webapp/app/scripts/models/TimelineRestAdapter.js
+++ b/tez-ui/src/main/webapp/app/scripts/models/TimelineRestAdapter.js
@@ -135,6 +135,7 @@ var timelineJsonToDagMap = {
 
   name: 'primaryfilters.dagName.0',
   user: 'primaryfilters.user.0',
+  callerId: 'primaryfilters.callerId.0',
 
   status: {
     custom: getStatus
@@ -719,4 +720,4 @@ App.ClusterAppSerializer = App.TimelineSerializer.extend({
   normalize: function(type, hash, prop) {
     return Em.JsonMapper.map(hash, this.get('map'));
   }
-});
\ No newline at end of file
+});

http://git-wip-us.apache.org/repos/asf/tez/blob/42ef6366/tez-ui/src/main/webapp/app/scripts/models/dag.js
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/scripts/models/dag.js 
b/tez-ui/src/main/webapp/app/scripts/models/dag.js
index 3ea76d2..4f9bfa5 100644
--- a/tez-ui/src/main/webapp/app/scripts/models/dag.js
+++ b/tez-ui/src/main/webapp/app/scripts/models/dag.js
@@ -66,7 +66,7 @@ App.Dag = App.AbstractEntity.extend({
   // diagnostics info if any.
   diagnostics: DS.attr('string'),
 
-  // Dag plan reated data
+  // Dag plan related data
   planName: DS.attr('string'),
   planVersion: DS.attr('number'),
   appContextInfo: DS.attr('object'),
@@ -78,6 +78,8 @@ App.Dag = App.AbstractEntity.extend({
   counterGroups: DS.attr('array'),
   amWebServiceVersion: DS.attr('string'),
   containerLogs: DS.attr('array'),
+
+  callerId: DS.attr('string')
 });
 
 App.CounterGroup = DS.Model.extend({

http://git-wip-us.apache.org/repos/asf/tez/blob/42ef6366/tez-ui/src/main/webapp/app/templates/dags.hbs
----------------------------------------------------------------------
diff --git a/tez-ui/src/main/webapp/app/templates/dags.hbs 
b/tez-ui/src/main/webapp/app/templates/dags.hbs
index 350a688..373ac0e 100644
--- a/tez-ui/src/main/webapp/app/templates/dags.hbs
+++ b/tez-ui/src/main/webapp/app/templates/dags.hbs
@@ -82,6 +82,16 @@
             }}
           </div>
         {{/if}}
+        {{#if visibleFilters.callerId}}
+          <div class='filter-elements'>
+            <div>Context ID (Hive Query ID or Pig Script ID)</div>
+            {{input
+              action="filterUpdated"
+              value=boundFilterValues.callerId
+              placeholder="Search..."
+            }}
+          </div>
+        {{/if}}
       </div><div class="align-children-right">
         {{view App.BasicTableComponent.PaginationView
           pageNum=page

Reply via email to