hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gop...@apache.org
Subject svn commit: r1664615 - /hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionState.java
Date Fri, 06 Mar 2015 13:26:03 GMT
Author: gopalv
Date: Fri Mar  6 13:26:02 2015
New Revision: 1664615

URL: http://svn.apache.org/r1664615
Log:
HIVE-9884: LLAP : Add llap-daemon jars to the Tez session if the execution mode is LLAP

Modified:
    hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionState.java

Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionState.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionState.java?rev=1664615&r1=1664614&r2=1664615&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionState.java
(original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/exec/tez/TezSessionState.java
Fri Mar  6 13:26:02 2015
@@ -18,6 +18,7 @@
 package org.apache.hadoop.hive.ql.exec.tez;
 
 
+import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.InputStream;
@@ -44,6 +45,9 @@ import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.permission.FsPermission;
 import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
+import org.apache.hadoop.hive.ql.exec.Utilities;
+import org.apache.hadoop.hive.ql.metadata.HiveException;
+import org.apache.hadoop.hive.ql.optimizer.physical.LlapDecider.LlapMode;
 import org.apache.hadoop.hive.ql.session.SessionState;
 import org.apache.hadoop.hive.shims.ShimLoader;
 import org.apache.hadoop.hive.shims.Utils;
@@ -173,6 +177,22 @@ public class TezSessionState {
       commonLocalResources.put(utils.getBaseName(lr), lr);
     }
 
+    if("llap".equals(HiveConf.getVar(conf, HiveConf.ConfVars.HIVE_EXECUTION_MODE))) {
+      // add configs for llap-daemon-site.xml + localize llap jars
+      // they cannot be referred to directly as it would be a circular depedency
+      conf.addResource("llap-daemon-site.xml");
+      try {
+        final File daemonJar =
+            new File(Utilities.jarFinderGetJar(Class
+                .forName("org.apache.hadoop.hive.llap.io.api.impl.LlapInputFormat")));
+        final LocalResource daemonLr =
+            createJarLocalResource(daemonJar.toURI().toURL().toExternalForm());
+        commonLocalResources.put(utils.getBaseName(daemonLr), daemonLr);
+      } catch (ClassNotFoundException ce) {
+        throw new IOException("Cannot find LlapInputFormat in the classpath", ce);
+      }
+    }
+
     // Create environment for AM.
     Map<String, String> amEnv = new HashMap<String, String>();
     MRHelpers.updateEnvBasedOnMRAMEnv(conf, amEnv);



Mime
View raw message