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

    https://github.com/apache/spark/pull/4960#discussion_r33731782
  
    --- Diff: 
core/src/main/scala/org/apache/spark/scheduler/cluster/mesos/MesosSchedulerUtils.scala
 ---
    @@ -38,14 +41,51 @@ private[mesos] trait MesosSchedulerUtils extends 
Logging {
       // Driver for talking to Mesos
       protected var mesosDriver: MesosSchedulerDriver = null
     
    +  protected def createSchedulerDriver(
    +      masterUrl: String,
    +      scheduler: Scheduler,
    +      sparkUser: String,
    +      appName: String,
    +      conf: SparkConf,
    +      webuiUrl: Option[String] = None,
    +      checkpoint: Option[Boolean] = None,
    +      failoverTimeout: Option[Double] = None,
    +      frameworkId: Option[String] = None): MesosSchedulerDriver = {
    +    val fwInfoBuilder = 
FrameworkInfo.newBuilder().setUser(sparkUser).setName(appName)
    +    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(ByteString.copyFromUtf8(secret))
    +    }
    +    if (credBuilder.hasSecret && !fwInfoBuilder.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())
    +    } else {
    +      new MesosSchedulerDriver(scheduler, fwInfoBuilder.build(), masterUrl)
    +    }
    +  }
    +
       /**
        * Starts the MesosSchedulerDriver with the provided information. This 
method returns
        * only after the scheduler has registered with Mesos.
    --- End diff --
    
    This needs to be updated to say something like "set our mesos driver to the 
one provided" or something.


---
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