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 54F7D18926 for ; Fri, 5 Jun 2015 17:10:17 +0000 (UTC) Received: (qmail 84715 invoked by uid 500); 5 Jun 2015 17:10:17 -0000 Delivered-To: apmail-tez-commits-archive@tez.apache.org Received: (qmail 84680 invoked by uid 500); 5 Jun 2015 17:10:17 -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 84671 invoked by uid 99); 5 Jun 2015 17:10:17 -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; Fri, 05 Jun 2015 17:10:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 1CB94E04E6; Fri, 5 Jun 2015 17:10:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: prakash@apache.org To: commits@tez.apache.org Message-Id: <59b00970572f4f3cb43ecf557bd4bc74@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: tez git commit: TEZ-2541. DAGClientImpl enable TimelineClient check is wrong. (pramachandran) Date: Fri, 5 Jun 2015 17:10:17 +0000 (UTC) Repository: tez Updated Branches: refs/heads/branch-0.6 9538b0ff4 -> 72da6b8b4 TEZ-2541. DAGClientImpl enable TimelineClient check is wrong. (pramachandran) (cherry picked from commit 5e58309d91ba56b7acb51247d3e7948ae4ddb71e) Conflicts: CHANGES.txt tez-api/src/test/java/org/apache/tez/dag/api/client/rpc/TestDAGClient.java Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/72da6b8b Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/72da6b8b Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/72da6b8b Branch: refs/heads/branch-0.6 Commit: 72da6b8b4dbbcee53acce9019b16fec0e6aba1be Parents: 9538b0f Author: Prakash Ramachandran Authored: Fri Jun 5 22:13:24 2015 +0530 Committer: Prakash Ramachandran Committed: Fri Jun 5 22:39:46 2015 +0530 ---------------------------------------------------------------------- CHANGES.txt | 1 + .../tez/dag/api/client/DAGClientImpl.java | 8 ++-- .../tez/dag/api/client/rpc/TestDAGClient.java | 43 +++++++++++++++++++- 3 files changed, 47 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/72da6b8b/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index 652e9e9..b7a7010 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -6,6 +6,7 @@ Release 0.6.2: Unreleased INCOMPATIBLE CHANGES ALL CHANGES: + TEZ-2541. DAGClientImpl enable TimelineClient check is wrong. TEZ-2489. Disable warn log for Timeline ACL error when tez.allow.disabled.timeline-domains set to true. TEZ-2509. YarnTaskSchedulerService should not try to allocate containers if AM is shutting down. TEZ-1529. ATS and TezClient integration in secure kerberos enabled cluster http://git-wip-us.apache.org/repos/asf/tez/blob/72da6b8b/tez-api/src/main/java/org/apache/tez/dag/api/client/DAGClientImpl.java ---------------------------------------------------------------------- diff --git a/tez-api/src/main/java/org/apache/tez/dag/api/client/DAGClientImpl.java b/tez-api/src/main/java/org/apache/tez/dag/api/client/DAGClientImpl.java index 1360e2d..f07180a 100644 --- a/tez-api/src/main/java/org/apache/tez/dag/api/client/DAGClientImpl.java +++ b/tez-api/src/main/java/org/apache/tez/dag/api/client/DAGClientImpl.java @@ -57,7 +57,8 @@ public class DAGClientImpl extends DAGClient { @VisibleForTesting protected DAGClient realClient; private boolean dagCompleted = false; - private boolean isATSEnabled = false; + @VisibleForTesting + protected boolean isATSEnabled = false; private DAGStatus cachedDagStatus = null; Map cachedVertexStatus = new HashMap(); @@ -87,9 +88,8 @@ public class DAGClientImpl extends DAGClient { conf.getBoolean(TezConfiguration.TEZ_DAG_HISTORY_LOGGING_ENABLED, TezConfiguration.TEZ_DAG_HISTORY_LOGGING_ENABLED_DEFAULT) && conf.getBoolean(TezConfiguration.TEZ_AM_HISTORY_LOGGING_ENABLED, - TezConfiguration.TEZ_AM_HISTORY_LOGGING_ENABLED_DEFAULT); - - isATSEnabled = DAGClientTimelineImpl.isSupported(); + TezConfiguration.TEZ_AM_HISTORY_LOGGING_ENABLED_DEFAULT) && + DAGClientTimelineImpl.isSupported(); realClient = new DAGClientRPCImpl(appId, dagId, conf, this.frameworkClient); } http://git-wip-us.apache.org/repos/asf/tez/blob/72da6b8b/tez-api/src/test/java/org/apache/tez/dag/api/client/rpc/TestDAGClient.java ---------------------------------------------------------------------- diff --git a/tez-api/src/test/java/org/apache/tez/dag/api/client/rpc/TestDAGClient.java b/tez-api/src/test/java/org/apache/tez/dag/api/client/rpc/TestDAGClient.java index bad0d2e..86ea914 100644 --- a/tez-api/src/test/java/org/apache/tez/dag/api/client/rpc/TestDAGClient.java +++ b/tez-api/src/test/java/org/apache/tez/dag/api/client/rpc/TestDAGClient.java @@ -31,10 +31,12 @@ import java.io.IOException; import org.apache.hadoop.yarn.api.records.ApplicationId; import org.apache.hadoop.yarn.api.records.ApplicationReport; import org.apache.hadoop.yarn.exceptions.YarnException; +import org.apache.tez.client.FrameworkClient; import org.apache.tez.dag.api.TezConfiguration; import org.apache.tez.dag.api.TezException; import org.apache.tez.dag.api.client.DAGClient; import org.apache.tez.dag.api.client.DAGClientImpl; +import org.apache.tez.dag.api.client.DAGClientTimelineImpl; import org.apache.tez.dag.api.client.DAGStatus; import org.apache.tez.dag.api.client.StatusGetOpts; import org.apache.tez.dag.api.client.VertexStatus; @@ -284,5 +286,44 @@ public class TestDAGClient { verify(mockProxy, times(3)).getDAGStatus(null, GetDAGStatusRequestProto.newBuilder() .setDagId(dagIdStr).addStatusOptions(StatusGetOptsProto.GET_COUNTERS).build()); } - + + @Test(timeout = 5000) + public void testDagClientTimelineEnabledCondition() { + String historyLoggingClass = "org.apache.tez.dag.history.logging.ats.ATSHistoryLoggingService"; + + testAtsEnabled(mockAppId, dagIdStr, false, "", true, true); + testAtsEnabled(mockAppId, dagIdStr, false, historyLoggingClass, false, true); + testAtsEnabled(mockAppId, dagIdStr, false, historyLoggingClass, true, false); + testAtsEnabled(mockAppId, dagIdStr, DAGClientTimelineImpl.isSupported(), historyLoggingClass, + true, true); + } + + private static void testAtsEnabled(ApplicationId appId, String dagIdStr, boolean expected, + String loggingClass, boolean amHistoryLoggingEnabled, + boolean dagHistoryLoggingEnabled) { + TezConfiguration tezConf = new TezConfiguration(); + + tezConf.set(TezConfiguration.TEZ_HISTORY_LOGGING_SERVICE_CLASS, loggingClass); + tezConf.setBoolean(TezConfiguration.TEZ_AM_HISTORY_LOGGING_ENABLED, amHistoryLoggingEnabled); + tezConf.setBoolean(TezConfiguration.TEZ_DAG_HISTORY_LOGGING_ENABLED, dagHistoryLoggingEnabled); + + DAGClientImplForTest dagClient = new DAGClientImplForTest(appId, dagIdStr, tezConf, null); + assertEquals(expected, dagClient.getIsATSEnabled()); + } + + private static class DAGClientImplForTest extends DAGClientImpl { + + public DAGClientImplForTest(ApplicationId appId, String dagId, + TezConfiguration conf, + FrameworkClient frameworkClient) { + super(appId, dagId, conf, frameworkClient); + } + + + public boolean getIsATSEnabled() { + return isATSEnabled; + } + + } + }