tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jeag...@apache.org
Subject tez git commit: TEZ-3830. HistoryEventTimelineConversion should not hard code the Task state. (Kuhu Shukla via jeagles)
Date Mon, 02 Oct 2017 16:36:10 GMT
Repository: tez
Updated Branches:
  refs/heads/master 14cc28275 -> 4d6690ae1


TEZ-3830. HistoryEventTimelineConversion should not hard code the Task state. (Kuhu Shukla
via jeagles)


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

Branch: refs/heads/master
Commit: 4d6690ae17a07b6f87efda2851524f2e9cc18cec
Parents: 14cc282
Author: Jonathan Eagles <jeagles@yahoo-inc.com>
Authored: Mon Oct 2 11:36:06 2017 -0500
Committer: Jonathan Eagles <jeagles@yahoo-inc.com>
Committed: Mon Oct 2 11:36:06 2017 -0500

----------------------------------------------------------------------
 .../apache/tez/dag/history/events/TaskStartedEvent.java  | 11 +++++++++++
 .../logging/ats/HistoryEventTimelineConversion.java      |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/4d6690ae/tez-dag/src/main/java/org/apache/tez/dag/history/events/TaskStartedEvent.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/history/events/TaskStartedEvent.java
b/tez-dag/src/main/java/org/apache/tez/dag/history/events/TaskStartedEvent.java
index 7516090..07dc2f9 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/history/events/TaskStartedEvent.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/history/events/TaskStartedEvent.java
@@ -22,6 +22,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 
+import org.apache.tez.dag.api.oldrecords.TaskState;
 import org.apache.tez.dag.history.HistoryEvent;
 import org.apache.tez.dag.history.HistoryEventType;
 import org.apache.tez.dag.records.TezTaskID;
@@ -33,13 +34,20 @@ public class TaskStartedEvent implements HistoryEvent {
   private String vertexName;
   private long scheduledTime;
   private long startTime;
+  private TaskState state;
 
   public TaskStartedEvent(TezTaskID taskId,
       String vertexName, long scheduledTime, long startTime) {
+    this(taskId, vertexName, scheduledTime, startTime, TaskState.SCHEDULED);
+  }
+
+  public TaskStartedEvent(TezTaskID taskId,
+      String vertexName, long scheduledTime, long startTime, TaskState state) {
     this.vertexName = vertexName;
     this.taskID = taskId;
     this.scheduledTime = scheduledTime;
     this.startTime = startTime;
+    this.state = state;
   }
 
   public TaskStartedEvent() {
@@ -108,4 +116,7 @@ public class TaskStartedEvent implements HistoryEvent {
     return startTime;
   }
 
+  public TaskState getState() {
+    return state;
+  }
 }

http://git-wip-us.apache.org/repos/asf/tez/blob/4d6690ae/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 874be1d..c40d3a8 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
@@ -632,7 +632,7 @@ public class HistoryEventTimelineConversion {
 
     atsEntity.addOtherInfo(ATSConstants.START_TIME, event.getStartTime());
     atsEntity.addOtherInfo(ATSConstants.SCHEDULED_TIME, event.getScheduledTime());
-    atsEntity.addOtherInfo(ATSConstants.STATUS, TaskState.SCHEDULED.name());
+    atsEntity.addOtherInfo(ATSConstants.STATUS, event.getState().name());
 
     return atsEntity;
   }


Mime
View raw message