hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From heyongqi...@apache.org
Subject svn commit: r1078344 - /hive/trunk/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java
Date Sat, 05 Mar 2011 20:30:24 GMT
Author: heyongqiang
Date: Sat Mar  5 20:30:24 2011
New Revision: 1078344

URL: http://svn.apache.org/viewvc?rev=1078344&view=rev
Log:
HIVE-2018 avoid loading Hive aux jars in CLI remote mode (Ning Zhang via He Yongqiang)

Modified:
    hive/trunk/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java

Modified: hive/trunk/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java
URL: http://svn.apache.org/viewvc/hive/trunk/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java?rev=1078344&r1=1078343&r2=1078344&view=diff
==============================================================================
--- hive/trunk/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java (original)
+++ hive/trunk/cli/src/java/org/apache/hadoop/hive/cli/CliDriver.java Sat Mar  5 20:30:24
2011
@@ -447,19 +447,6 @@ public class CliDriver {
       conf.set((String) item.getKey(), (String) item.getValue());
     }
 
-    if (!ShimLoader.getHadoopShims().usesJobShell()) {
-      // hadoop-20 and above - we need to augment classpath using hiveconf
-      // components
-      // see also: code in ExecDriver.java
-      ClassLoader loader = conf.getClassLoader();
-      String auxJars = HiveConf.getVar(conf, HiveConf.ConfVars.HIVEAUXJARS);
-      if (StringUtils.isNotBlank(auxJars)) {
-        loader = Utilities.addToClassPath(loader, StringUtils.split(auxJars, ","));
-      }
-      conf.setClassLoader(loader);
-      Thread.currentThread().setContextClassLoader(loader);
-    }
-
     SessionState.start(ss);
 
     // connect to Hive Server
@@ -473,6 +460,20 @@ public class CliDriver {
       }
     }
 
+    // CLI remote mode is a thin client: only load auxJars in local mode
+    if (!ss.isRemoteMode() && !ShimLoader.getHadoopShims().usesJobShell()) {
+      // hadoop-20 and above - we need to augment classpath using hiveconf
+      // components
+      // see also: code in ExecDriver.java
+      ClassLoader loader = conf.getClassLoader();
+      String auxJars = HiveConf.getVar(conf, HiveConf.ConfVars.HIVEAUXJARS);
+      if (StringUtils.isNotBlank(auxJars)) {
+        loader = Utilities.addToClassPath(loader, StringUtils.split(auxJars, ","));
+      }
+      conf.setClassLoader(loader);
+      Thread.currentThread().setContextClassLoader(loader);
+    }
+
     CliDriver cli = new CliDriver();
 
     // Execute -i init files (always in silent mode)



Mime
View raw message