tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prak...@apache.org
Subject tez git commit: TEZ-2541. DAGClientImpl enable TimelineClient check is wrong. (pramachandran)
Date Fri, 05 Jun 2015 17:10:17 GMT
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 <pramachandran@hortonworks.com>
Authored: Fri Jun 5 22:13:24 2015 +0530
Committer: Prakash Ramachandran <pramachandran@hortonworks.com>
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<String, VertexStatus> cachedVertexStatus = new HashMap<String, VertexStatus>();
 
@@ -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;
+    }
+
+  }
+
 }


Mime
View raw message