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

    https://github.com/apache/spark/pull/9287#discussion_r44051387
  
    --- Diff: core/src/main/scala/org/apache/spark/deploy/master/Master.scala 
---
    @@ -126,27 +131,92 @@ private[deploy] class Master(
       }
     
       // Alternative application submission gateway that is stable across 
Spark versions
    -  private val restServerEnabled = 
conf.getBoolean("spark.master.rest.enabled", true)
    -  private var restServer: Option[StandaloneRestServer] = None
    -  private var restServerBoundPort: Option[Int] = None
    +  private val restSubmissionServerEnabled = 
conf.getBoolean("spark.master.rest.enabled", true)
    +  private var restSubmissionServer: Option[StandaloneRestServer] = None
    +  private var restSubmissionServerBoundPort: Option[Int] = None
    +
    +  private var rpcSubmissionEndpointRef: Option[RpcEndpointRef] = None
    +
    +  object RPCSubmissionEndpoint extends ThreadSafeRpcEndpoint {
    +    override val rpcEnv = rpcSubmissionEnv
    +
    +    private implicit val executionContext = 
scala.concurrent.ExecutionContext.global
    +
    +    override def receive: PartialFunction[Any, Unit] = {
    +      case msg @ RegisterApplication(description, driver) =>
    +        master.self.send(msg)
    +
    +      case msg @ ExecutorStateChanged(appId, execId, executorState, 
message, exitStatus) =>
    +        master.self.send(msg)
    +
    +      case msg @ MasterChangeAcknowledged(appId) =>
    +        master.self.send(msg)
    +
    +      case msg @ UnregisterApplication(applicationId) =>
    +        master.self.send(msg)
    +    }
    +
    +    override def receiveAndReply(context: RpcCallContext): 
PartialFunction[Any, Unit] = {
    +      case msg @ RequestSubmitDriver(description) =>
    --- End diff --
    
    since you're not really using any of the arguments, can you just say `case 
msg: RequestSubmitDriver =>` here? I'm not sure Scala allows that for case 
classes but that would be much cleaner.
    
    If you can't, then you can just use placeholders (`_`) for the arguments.


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