Skip to content

Commit

Permalink
Make HiveThriftServer2 play well with spark-submit
Browse files Browse the repository at this point in the history
  • Loading branch information
liancheng committed Jul 24, 2014
1 parent 61f39f4 commit a5310d1
Showing 1 changed file with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,8 @@ object SparkSQLEnv extends Logging {

def init() {
if (hiveContext == null) {
val jobName: String = "SparkSQL::" + java.net.InetAddress.getLocalHost.getHostName
val master: String = System.getenv("MASTER")

sparkContext = {
val sparkConf = new SparkConf()
.setMaster(Option(master).getOrElse("local"))
.setAppName(jobName)

Option(System.getenv("SPARK_HOME")).foreach(sparkConf.setSparkHome)
new SparkContext(sparkConf, Map[String, Set[SplitInfo]]())
}
sparkContext = new SparkContext(new SparkConf()
.setAppName(s"SparkSQL::${java.net.InetAddress.getLocalHost.getHostName}"))

sparkContext.addSparkListener(new StatsReportListener())

Expand Down

0 comments on commit a5310d1

Please sign in to comment.