FAQ
Author: gunther
Date: Sat Nov 8 01:12:52 2014
New Revision: 1637497

URL: http://svn.apache.org/r1637497
Log:
HIVE-8760: Pass a copy of HiveConf to hooks (Gunther Hagleitner, reviewed by Gopal V)

Modified:
     hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/hooks/ATSHook.java

Modified: hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/hooks/ATSHook.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/hooks/ATSHook.java?rev=1637497&r1=1637496&r2=1637497&view=diff
==============================================================================
--- hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/hooks/ATSHook.java (original)
+++ hive/branches/branch-0.14/ql/src/java/org/apache/hadoop/hive/ql/hooks/ATSHook.java Sat Nov 8 01:12:52 2014
@@ -27,6 +27,7 @@ import java.util.concurrent.TimeUnit;
  import org.apache.commons.logging.Log;
  import org.apache.commons.logging.LogFactory;
  import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hive.conf.HiveConf;
  import org.apache.hadoop.hive.ql.QueryPlan;
  import org.apache.hadoop.hive.ql.exec.ExplainTask;
  import org.apache.hadoop.hive.ql.exec.Task;
@@ -89,6 +90,8 @@ public class ATSHook implements ExecuteW
    @Override
    public void run(final HookContext hookContext) throws Exception {
      final long currentTime = System.currentTimeMillis();
+ final HiveConf conf = new HiveConf(hookContext.getConf());
+
      executor.submit(new Runnable() {
          @Override
          public void run() {
@@ -110,19 +113,19 @@ public class ATSHook implements ExecuteW
              switch(hookContext.getHookType()) {
              case PRE_EXEC_HOOK:
                ExplainTask explain = new ExplainTask();
- explain.initialize(hookContext.getConf(), plan, null);
+ explain.initialize(conf, plan, null);
                String query = plan.getQueryStr();
                List<Task<?>> rootTasks = plan.getRootTasks();
                JSONObject explainPlan = explain.getJSONPlan(null, null, rootTasks,
                     plan.getFetchTask(), true, false, false);
- fireAndForget(hookContext.getConf(), createPreHookEvent(queryId, query,
+ fireAndForget(conf, createPreHookEvent(queryId, query,
                     explainPlan, queryStartTime, user, numMrJobs, numTezJobs));
                break;
              case POST_EXEC_HOOK:
- fireAndForget(hookContext.getConf(), createPostHookEvent(queryId, currentTime, user, true));
+ fireAndForget(conf, createPostHookEvent(queryId, currentTime, user, true));
                break;
              case ON_FAILURE_HOOK:
- fireAndForget(hookContext.getConf(), createPostHookEvent(queryId, currentTime, user, false));
+ fireAndForget(conf, createPostHookEvent(queryId, currentTime, user, false));
                break;
              default:
                //ignore

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categorieshive, hadoop
postedNov 8, '14 at 1:15a
activeNov 8, '14 at 1:15a
posts1
users1
websitehive.apache.org

1 user in discussion

Gunther: 1 post

People

Translate

site design / logo © 2021 Grokbase