Skip to content

Commit

Permalink
[SPARK-5176] The thrift server does not support cluster mode
Browse files Browse the repository at this point in the history
Output an error message if the thrift server is started in cluster mode.

Author: Tom Panning <tom.panning@nextcentury.com>

Closes apache#4137 from tpanningnextcen/spark-5176-thrift-cluster-mode-error and squashes the following commits:

f5c0509 [Tom Panning] [SPARK-5176] The thrift server does not support cluster mode
  • Loading branch information
tpanningnextcen authored and Andrew Or committed Feb 2, 2015
1 parent c80194b commit 1ca0a10
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ object SparkSubmit {
printErrorAndExit("Cluster deploy mode is not applicable to Spark shells.")
case (_, CLUSTER) if isSqlShell(args.mainClass) =>
printErrorAndExit("Cluster deploy mode is not applicable to Spark SQL shell.")
case (_, CLUSTER) if isThriftServer(args.mainClass) =>
printErrorAndExit("Cluster deploy mode is not applicable to Spark Thrift server.")
case _ =>
}

Expand Down Expand Up @@ -408,6 +410,13 @@ object SparkSubmit {
mainClass == "org.apache.spark.sql.hive.thriftserver.SparkSQLCLIDriver"
}

/**
* Return whether the given main class represents a thrift server.
*/
private[spark] def isThriftServer(mainClass: String): Boolean = {
mainClass == "org.apache.spark.sql.hive.thriftserver.HiveThriftServer2"
}

/**
* Return whether the given primary resource requires running python.
*/
Expand Down
2 changes: 2 additions & 0 deletions sbin/start-thriftserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ set -o posix
# Figure out where Spark is installed
FWDIR="$(cd "`dirname "$0"`"/..; pwd)"

# NOTE: This exact class name is matched downstream by SparkSubmit.
# Any changes need to be reflected there.
CLASS="org.apache.spark.sql.hive.thriftserver.HiveThriftServer2"

function usage {
Expand Down

0 comments on commit 1ca0a10

Please sign in to comment.