Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package org.apache.spark.deploy.mesos
import java.util.concurrent.CountDownLatch

import org.apache.spark.{SecurityManager, SparkConf}
import org.apache.spark.deploy.mesos.config._
import org.apache.spark.deploy.mesos.ui.MesosClusterUI
import org.apache.spark.deploy.rest.mesos.MesosRestServer
import org.apache.spark.internal.Logging
Expand Down Expand Up @@ -51,7 +52,7 @@ private[mesos] class MesosClusterDispatcher(
extends Logging {

private val publicAddress = Option(conf.getenv("SPARK_PUBLIC_DNS")).getOrElse(args.host)
private val recoveryMode = conf.get("spark.deploy.recoveryMode", "NONE").toUpperCase()
private val recoveryMode = conf.get(RECOVERY_MODE).toUpperCase()
logInfo("Recovery mode in Mesos dispatcher set to: " + recoveryMode)

private val engineFactory = recoveryMode match {
Expand All @@ -74,7 +75,7 @@ private[mesos] class MesosClusterDispatcher(

def start(): Unit = {
webUi.bind()
scheduler.frameworkUrl = conf.get("spark.mesos.dispatcher.webui.url", webUi.activeWebUiUrl)
scheduler.frameworkUrl = conf.get(DISPATCHER_WEBUI_URL).getOrElse(webUi.activeWebUiUrl)
scheduler.start()
server.start()
}
Expand All @@ -99,8 +100,8 @@ private[mesos] object MesosClusterDispatcher extends Logging {
conf.setMaster(dispatcherArgs.masterUrl)
conf.setAppName(dispatcherArgs.name)
dispatcherArgs.zookeeperUrl.foreach { z =>
conf.set("spark.deploy.recoveryMode", "ZOOKEEPER")
conf.set("spark.deploy.zookeeper.url", z)
conf.set(RECOVERY_MODE, "ZOOKEEPER")
conf.set(ZOOKEEPER_URL, z)
}
val dispatcher = new MesosClusterDispatcher(dispatcherArgs, conf)
dispatcher.start()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import scala.collection.JavaConverters._

import org.apache.spark.{SecurityManager, SparkConf}
import org.apache.spark.deploy.ExternalShuffleService
import org.apache.spark.deploy.mesos.config._
import org.apache.spark.internal.Logging
import org.apache.spark.network.client.{RpcResponseCallback, TransportClient}
import org.apache.spark.network.shuffle.ExternalShuffleBlockHandler
Expand Down Expand Up @@ -114,7 +115,7 @@ private[mesos] class MesosExternalShuffleService(conf: SparkConf, securityManage

protected override def newShuffleBlockHandler(
conf: TransportConf): ExternalShuffleBlockHandler = {
val cleanerIntervalS = this.conf.getTimeAsSeconds("spark.shuffle.cleaner.interval", "30s")
val cleanerIntervalS = this.conf.get(SHUFFLE_CLEANER_INTERVAL_S)
new MesosExternalShuffleBlockHandler(conf, cleanerIntervalS)
}
}
Expand Down
59 changes: 59 additions & 0 deletions mesos/src/main/scala/org/apache/spark/deploy/mesos/config.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.spark.deploy.mesos

import java.util.concurrent.TimeUnit

import org.apache.spark.internal.config.ConfigBuilder

package object config {

/* Common app configuration. */

private[spark] val SHUFFLE_CLEANER_INTERVAL_S =
ConfigBuilder("spark.shuffle.cleaner.interval")
.timeConf(TimeUnit.SECONDS)
.createWithDefaultString("30s")

private[spark] val RECOVERY_MODE =
ConfigBuilder("spark.deploy.recoveryMode")
.stringConf
.createWithDefault("NONE")

private[spark] val DISPATCHER_WEBUI_URL =
ConfigBuilder("spark.mesos.dispatcher.webui.url")
.doc("Set the Spark Mesos dispatcher webui_url for interacting with the " +
"framework. If unset it will point to Spark's internal web UI.")
.stringConf
.createOptional

private[spark] val ZOOKEEPER_URL =
ConfigBuilder("spark.deploy.zookeeper.url")
.doc("When `spark.deploy.recoveryMode` is set to ZOOKEEPER, this " +
"configuration is used to set the zookeeper URL to connect to.")
.stringConf
.createOptional

private[spark] val HISTORY_SERVER_URL =
ConfigBuilder("spark.mesos.dispatcher.historyServer.url")
.doc("Set the URL of the history server. The dispatcher will then " +
"link each driver to its entry in the history server.")
.stringConf
.createOptional

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ import scala.xml.Node

import org.apache.mesos.Protos.TaskStatus

import org.apache.spark.deploy.mesos.config._
import org.apache.spark.deploy.mesos.MesosDriverDescription
import org.apache.spark.scheduler.cluster.mesos.MesosClusterSubmissionState
import org.apache.spark.ui.{UIUtils, WebUIPage}

private[mesos] class MesosClusterPage(parent: MesosClusterUI) extends WebUIPage("") {
private val historyServerURL = parent.conf.getOption("spark.mesos.dispatcher.historyServer.url")
private val historyServerURL = parent.conf.get(HISTORY_SERVER_URL)

def render(request: HttpServletRequest): Seq[Node] = {
val state = parent.scheduler.getSchedulerState()
Expand Down