Return-Path: X-Original-To: apmail-tez-commits-archive@minotaur.apache.org Delivered-To: apmail-tez-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B8EEE1779C for ; Wed, 9 Sep 2015 03:18:06 +0000 (UTC) Received: (qmail 92921 invoked by uid 500); 9 Sep 2015 03:18:06 -0000 Delivered-To: apmail-tez-commits-archive@tez.apache.org Received: (qmail 92880 invoked by uid 500); 9 Sep 2015 03:18:06 -0000 Mailing-List: contact commits-help@tez.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tez.apache.org Delivered-To: mailing list commits@tez.apache.org Received: (qmail 92864 invoked by uid 99); 9 Sep 2015 03:18:06 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Sep 2015 03:18:06 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4608AE03C2; Wed, 9 Sep 2015 03:18:06 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: rbalamohan@apache.org To: commits@tez.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: tez git commit: TEZ-2784. optimize TaskImpl.isFinished() (rbalamohan) Date: Wed, 9 Sep 2015 03:18:06 +0000 (UTC) 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 Authored: Wed Sep 9 08:52:23 2015 +0530 Committer: Rajesh Balamohan 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 { @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