Github user tnachen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14936#discussion_r82430755
  
    --- Diff: 
mesos/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerUtils.scala
 ---
    @@ -69,38 +68,51 @@ trait MesosSchedulerUtils extends Logging {
           conf: SparkConf,
           webuiUrl: Option[String] = None,
           checkpoint: Option[Boolean] = None,
    -      failoverTimeout: Option[Double] = None,
           frameworkId: Option[String] = None): SchedulerDriver = {
    -    val fwInfoBuilder = 
FrameworkInfo.newBuilder().setUser(sparkUser).setName(appName)
    +    val fwInfo = createFrameworkInfo(sparkUser, appName, conf, webuiUrl, 
checkpoint, frameworkId)
         val credBuilder = Credential.newBuilder()
    -    webuiUrl.foreach { url => fwInfoBuilder.setWebuiUrl(url) }
    -    checkpoint.foreach { checkpoint => 
fwInfoBuilder.setCheckpoint(checkpoint) }
    -    failoverTimeout.foreach { timeout => 
fwInfoBuilder.setFailoverTimeout(timeout) }
    -    frameworkId.foreach { id =>
    -      fwInfoBuilder.setId(FrameworkID.newBuilder().setValue(id).build())
    -    }
         conf.getOption("spark.mesos.principal").foreach { principal =>
    -      fwInfoBuilder.setPrincipal(principal)
           credBuilder.setPrincipal(principal)
         }
         conf.getOption("spark.mesos.secret").foreach { secret =>
           credBuilder.setSecret(secret)
         }
    -    if (credBuilder.hasSecret && !fwInfoBuilder.hasPrincipal) {
    +    if (credBuilder.hasSecret && !fwInfo.hasPrincipal) {
           throw new SparkException(
             "spark.mesos.principal must be configured when spark.mesos.secret 
is set")
         }
    -    conf.getOption("spark.mesos.role").foreach { role =>
    -      fwInfoBuilder.setRole(role)
    -    }
         if (credBuilder.hasPrincipal) {
           new MesosSchedulerDriver(
    -        scheduler, fwInfoBuilder.build(), masterUrl, credBuilder.build())
    +        scheduler, fwInfo, masterUrl, credBuilder.build())
         } else {
    -      new MesosSchedulerDriver(scheduler, fwInfoBuilder.build(), masterUrl)
    +      new MesosSchedulerDriver(scheduler, fwInfo, masterUrl)
         }
       }
     
    +  def createFrameworkInfo(
    +    sparkUser: String,
    +    appName: String,
    +    conf: SparkConf,
    +    webuiUrl: Option[String] = None,
    +    checkpoint: Option[Boolean] = None,
    +    frameworkId: Option[String] = None): FrameworkInfo = {
    +    val fwInfoBuilder = 
FrameworkInfo.newBuilder().setUser(sparkUser).setName(appName)
    +    webuiUrl.foreach { url => fwInfoBuilder.setWebuiUrl(url) }
    +    checkpoint.foreach { checkpoint => 
fwInfoBuilder.setCheckpoint(checkpoint) }
    +    
fwInfoBuilder.setFailoverTimeout(conf.getDouble("spark.mesos.failoverTimeout", 
10))
    --- End diff --
    
    This new flag needs to get added to the documentation as well


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to