tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hit...@apache.org
Subject git commit: TEZ-635. Progress resets to 0 after a dag completes even in non-session mode. (hitesh)
Date Thu, 21 Nov 2013 23:08:07 GMT
Updated Branches:
  refs/heads/master 5ef639b1e -> c3b736fcd


TEZ-635. Progress resets to 0 after a dag completes even in non-session mode. (hitesh)


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

Branch: refs/heads/master
Commit: c3b736fcd7891b5942f53accea3a4a992f8aba08
Parents: 5ef639b
Author: Hitesh Shah <hitesh@apache.org>
Authored: Thu Nov 21 15:07:45 2013 -0800
Committer: Hitesh Shah <hitesh@apache.org>
Committed: Thu Nov 21 15:07:45 2013 -0800

----------------------------------------------------------------------
 .../org/apache/tez/dag/app/DAGAppMaster.java    | 22 +++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tez/blob/c3b736fc/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java b/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
index eb6c16c..e5ade3d 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
@@ -622,10 +622,26 @@ public class DAGAppMaster extends AbstractService {
   }
 
   public float getProgress() {
-    if(currentDAG != null && currentDAG.getState() == DAGState.RUNNING) {
-      return currentDAG.getProgress();
+    if (isSession && state.equals(DAGAppMasterState.IDLE)) {
+      return 0.0f;
     }
-    return 0;
+    if(currentDAG != null) {
+      DAGState state = currentDAG.getState();
+      switch (state) {
+        case NEW:
+        case INITED:
+          return 0.0f;
+        case RUNNING:
+          return currentDAG.getProgress();
+        case SUCCEEDED:
+        case TERMINATING:
+        case ERROR:
+        case FAILED:
+        case KILLED:
+          return 1.0f;
+      }
+    }
+    return 0.0f;
   }
 
   private synchronized void setStateOnDAGCompletion() {


Mime
View raw message