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

    https://github.com/apache/spark/pull/3082#discussion_r19788284
  
    --- Diff: core/src/main/scala/org/apache/spark/storage/BlockManager.scala 
---
    @@ -92,7 +93,19 @@ private[spark] class BlockManager(
     
       private[spark]
       val externalShuffleServiceEnabled = 
conf.getBoolean("spark.shuffle.service.enabled", false)
    -  private val externalShuffleServicePort = 
conf.getInt("spark.shuffle.service.port", 7337)
    +
    +  // In Yarn, the shuffle service port maybe set through the Hadoop config
    +  private val shuffleServicePortKey = "spark.shuffle.service.port"
    +  private val externalShuffleServicePort = {
    --- End diff --
    
    I would rather not put YARN-related logic directly in the BlockManager 
itself. Can we extract this type of logic out to a utility function somewhere 
like
    `SparkHadoopUtil.get.getYarnOrSparkConf("spark.shuffle.service.port", 
"7337").toInt`
    
    It doesn't save many characters in here, but at least it hides the checking 
for YARN and constructing a Hadoop Configuration.


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