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

    https://github.com/apache/spark/pull/5377#discussion_r28489592
  
    --- Diff: 
core/src/main/scala/org/apache/spark/network/netty/NettyBlockTransferService.scala
 ---
    @@ -49,18 +49,21 @@ class NettyBlockTransferService(conf: SparkConf, 
securityManager: SecurityManage
       private[this] var appId: String = _
     
       override def init(blockDataManager: BlockDataManager): Unit = {
    -    val (rpcHandler: RpcHandler, bootstrap: 
Option[TransportClientBootstrap]) = {
    -      val nettyRpcHandler = new NettyBlockRpcServer(serializer, 
blockDataManager)
    -      if (!authEnabled) {
    -        (nettyRpcHandler, None)
    +    val rpcHandler = new NettyBlockRpcServer(serializer, blockDataManager)
    +    val (serverBootstrap: Option[TransportServerBootstrap],
    --- End diff --
    
    nit: This syntax gets unwieldy with more code in here, I'd advise switching 
to something like
    ```scala
    var serverBootstrap: Option[TransportServerBootstrap] = None
    var clientBootstrap: Option[TransportClientBootstrap] = None
    if (authEnabled) {
      serverBootstrap = Some(new SaslServerBootstrap(transportConf, 
securityManager)
      clientBootstrap = Some(new SaslClientBootstrap(transportConf, 
conf.getAppId, securityManager,
        securityManager.isSaslEncryptionEnabled()))
    }
    ```
    
    uses the dreaded `var` but I think it may be less syntactically cumbersome.


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