tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rbalamo...@apache.org
Subject tez git commit: TEZ-2784. optimize TaskImpl.isFinished() (rbalamohan)
Date Wed, 09 Sep 2015 03:18:06 GMT
Repository: tez
Updated Branches:
  refs/heads/master 56f7847d2 -> 9aa3ae61e


TEZ-2784. optimize TaskImpl.isFinished() (rbalamohan)


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

Branch: refs/heads/master
Commit: 9aa3ae61e97491849ca9dede0bdfe5e8485b688e
Parents: 56f7847
Author: Rajesh Balamohan <rbalamohan@apache.org>
Authored: Wed Sep 9 08:52:23 2015 +0530
Committer: Rajesh Balamohan <rbalamohan@apache.org>
Committed: Wed Sep 9 08:52:51 2015 +0530

----------------------------------------------------------------------
 CHANGES.txt                                           |  1 +
 .../org/apache/tez/dag/app/dag/impl/TaskImpl.java     | 14 +++++---------
 2 files changed, 6 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/9aa3ae61/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 77535b1..ee11006 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -7,6 +7,7 @@ Release 0.8.1: Unreleased
 INCOMPATIBLE CHANGES
 
 ALL CHANGES:
+  TEZ-2784. optimize TaskImpl.isFinished()
   TEZ-2788. Allow TezAnalyzerBase to parse SimpleHistory logs
   TEZ-2782. VertexInfo.getAvgExecutionTimeInterval throws NPE when task does not have any
valid attempts info
   TEZ-2778. Improvements to handle multiple read errors with complex DAGs

http://git-wip-us.apache.org/repos/asf/tez/blob/9aa3ae61/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/TaskImpl.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/TaskImpl.java b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/TaskImpl.java
index ea14483..4d449d4 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/TaskImpl.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/TaskImpl.java
@@ -412,15 +412,11 @@ public class TaskImpl implements Task, EventHandler<TaskEvent>
{
 
   @Override
   public boolean isFinished() {
-    readLock.lock();
-    try {
-      return (getInternalState() == TaskStateInternal.SUCCEEDED ||
-              getInternalState() == TaskStateInternal.FAILED ||
-              getInternalState() == TaskStateInternal.KILLED ||
-              getInternalState() == TaskStateInternal.KILL_WAIT);
-    } finally {
-      readLock.unlock();
-    }
+    TaskStateInternal internalState = getInternalState();
+    return (internalState == TaskStateInternal.SUCCEEDED ||
+        internalState == TaskStateInternal.FAILED ||
+        internalState == TaskStateInternal.KILLED ||
+        internalState == TaskStateInternal.KILL_WAIT);
   }
 
   @Override


Mime
View raw message