You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by rx...@apache.org on 2014/09/27 07:30:16 UTC

git commit: [SPARK-3675][SQL] Allow starting a JDBC server on an existing context

Repository: spark
Updated Branches:
  refs/heads/master f0eea76d9 -> d8a9d1d44


[SPARK-3675][SQL] Allow starting a JDBC server on an existing context

Author: Michael Armbrust <mi...@databricks.com>

Closes #2515 from marmbrus/jdbcExistingContext and squashes the following commits:

7866fad [Michael Armbrust] Allows starting a JDBC server on an existing context.


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/d8a9d1d4
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/d8a9d1d4
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/d8a9d1d4

Branch: refs/heads/master
Commit: d8a9d1d442dd5612f82edaf2a780579c4d43dcfd
Parents: f0eea76
Author: Michael Armbrust <mi...@databricks.com>
Authored: Fri Sep 26 22:30:12 2014 -0700
Committer: Reynold Xin <rx...@apache.org>
Committed: Fri Sep 26 22:30:12 2014 -0700

----------------------------------------------------------------------
 .../sql/hive/thriftserver/HiveThriftServer2.scala    | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/d8a9d1d4/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2.scala
----------------------------------------------------------------------
diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2.scala
index cadf7aa..3d468d8 100644
--- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2.scala
+++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2.scala
@@ -26,6 +26,7 @@ import org.apache.hive.service.cli.thrift.ThriftBinaryCLIService
 import org.apache.hive.service.server.{HiveServer2, ServerOptionsProcessor}
 
 import org.apache.spark.Logging
+import org.apache.spark.annotation.DeveloperApi
 import org.apache.spark.sql.hive.HiveContext
 import org.apache.spark.sql.hive.thriftserver.ReflectionUtils._
 
@@ -33,9 +34,21 @@ import org.apache.spark.sql.hive.thriftserver.ReflectionUtils._
  * The main entry point for the Spark SQL port of HiveServer2.  Starts up a `SparkSQLContext` and a
  * `HiveThriftServer2` thrift server.
  */
-private[hive] object HiveThriftServer2 extends Logging {
+object HiveThriftServer2 extends Logging {
   var LOG = LogFactory.getLog(classOf[HiveServer2])
 
+  /**
+   * :: DeveloperApi ::
+   * Starts a new thrift server with the given context.
+   */
+  @DeveloperApi
+  def startWithContext(sqlContext: HiveContext): Unit = {
+    val server = new HiveThriftServer2(sqlContext)
+    server.init(sqlContext.hiveconf)
+    server.start()
+  }
+
+
   def main(args: Array[String]) {
     val optionsProcessor = new ServerOptionsProcessor("HiveThriftServer2")
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org