spark-instrumented-optimizer/sql/hive
Michael Armbrust daa70bf135 [SPARK-6907] [SQL] Isolated client for HiveMetastore
This PR adds initial support for loading multiple versions of Hive in a single JVM and provides a common interface for extracting metadata from the `HiveMetastoreClient` for a given version.  This is accomplished by creating an isolated `ClassLoader` that operates according to the following rules:

 - __Shared Classes__: Java, Scala, logging, and Spark classes are delegated to `baseClassLoader`
  allowing the results of calls to the `ClientInterface` to be visible externally.
 - __Hive Classes__: new instances are loaded from `execJars`.  These classes are not
  accessible externally due to their custom loading.
 - __Barrier Classes__: Classes such as `ClientWrapper` are defined in Spark but must link to a specific version of Hive.  As a result, the bytecode is acquired from the Spark `ClassLoader` but a new copy is created for each instance of `IsolatedClientLoader`.
  This new instance is able to see a specific version of hive without using reflection where ever hive is consistent across versions. Since
  this is a unique instance, it is not visible externally other than as a generic
  `ClientInterface`, unless `isolationOn` is set to `false`.

In addition to the unit tests, I have also tested this locally against mysql instances of the Hive Metastore.  I've also successfully ported Spark SQL to run with this client, but due to the size of the changes, that will come in a follow-up PR.

By default, Hive jars are currently downloaded from Maven automatically for a given version to ease packaging and testing.  However, there is also support for specifying their location manually for deployments without internet.

Author: Michael Armbrust <michael@databricks.com>

Closes #5851 from marmbrus/isolatedClient and squashes the following commits:

c72f6ac [Michael Armbrust] rxins comments
1e271fa [Michael Armbrust] [SPARK-6907][SQL] Isolated client for HiveMetastore
2015-05-03 13:12:50 -07:00
..
compatibility/src/test/scala/org/apache/spark/sql/hive/execution [SPARK-2213] [SQL] sort merge join for spark sql 2015-04-15 14:06:10 -07:00
src [SPARK-6907] [SQL] Isolated client for HiveMetastore 2015-05-03 13:12:50 -07:00
v0.12.0/src/main/scala/org/apache/spark/sql/hive [SPARK-6638] [SQL] Improve performance of StringType in SQL 2015-04-15 13:06:38 -07:00
v0.13.1/src/main/scala/org/apache/spark/sql/hive [SPARK-6505] [SQL] Remove the reflection call in HiveFunctionWrapper 2015-04-27 14:08:05 +08:00
pom.xml [SPARK-7168] [BUILD] Update plugin versions in Maven build and centralize versions 2015-04-28 07:48:34 -04:00