You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by sa...@apache.org on 2019/06/12 09:14:46 UTC
[hive] branch master updated: HIVE-16906: Hive ATSHook should check
for yarn.timeline-service.enabled before connecting to ATS (Naresh P R
reviewed by Thejas M Nair, Sankar Hariappan)
This is an automated email from the ASF dual-hosted git repository.
sankarh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git
The following commit(s) were added to refs/heads/master by this push:
new 1a649cd HIVE-16906: Hive ATSHook should check for yarn.timeline-service.enabled before connecting to ATS (Naresh P R reviewed by Thejas M Nair, Sankar Hariappan)
1a649cd is described below
commit 1a649cde5d1620560eec7363338f8c91307d24ac
Author: Naresh P R <pr...@gmail.com>
AuthorDate: Fri May 24 23:17:51 2019 +0530
HIVE-16906: Hive ATSHook should check for yarn.timeline-service.enabled before connecting to ATS (Naresh P R reviewed by Thejas M Nair, Sankar Hariappan)
Signed-off-by: Sankar Hariappan <sa...@apache.org>
---
ql/src/java/org/apache/hadoop/hive/ql/hooks/ATSHook.java | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/hooks/ATSHook.java b/ql/src/java/org/apache/hadoop/hive/ql/hooks/ATSHook.java
index 9cb4d8c..0632f6e 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/hooks/ATSHook.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/hooks/ATSHook.java
@@ -68,6 +68,7 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder;
public class ATSHook implements ExecuteWithHookContext {
private static final Logger LOG = LoggerFactory.getLogger(ATSHook.class.getName());
+ private boolean isATSEnabled = false;
private static final Object LOCK = new Object();
private static final int VERSION = 2;
private static ExecutorService executor;
@@ -143,7 +144,15 @@ public class ATSHook implements ExecuteWithHookContext {
}
public ATSHook() {
- LOG.info("Created ATS Hook");
+ YarnConfiguration yarnConf = new YarnConfiguration();
+ if (yarnConf.getBoolean(YarnConfiguration.TIMELINE_SERVICE_ENABLED,
+ YarnConfiguration.DEFAULT_TIMELINE_SERVICE_ENABLED)) {
+ isATSEnabled = true;
+ LOG.info("Created ATS Hook");
+ } else {
+ isATSEnabled = false;
+ LOG.warn("ATSHook is disabled due to Timeline Service being disabled");
+ }
}
private void createTimelineDomain(String domainId, String readers, String writers) throws Exception {
@@ -219,6 +228,9 @@ public class ATSHook implements ExecuteWithHookContext {
}
@Override
public void run(final HookContext hookContext) throws Exception {
+ if (!isATSEnabled) {
+ return;
+ }
final long currentTime = System.currentTimeMillis();
final HiveConf conf = new HiveConf(hookContext.getConf());