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

    https://github.com/apache/spark/pull/9481#discussion_r45157472
  
    --- Diff: 
core/src/main/scala/org/apache/spark/network/netty/SparkTransportConf.scala ---
    @@ -40,23 +40,26 @@ object SparkTransportConf {
     
       /**
        * Utility for creating a [[TransportConf]] from a [[SparkConf]].
    +   * @param _conf the [[SparkConf]]
    +   * @param module the module name
        * @param numUsableCores if nonzero, this will restrict the server and 
client threads to only
        *                       use the given number of cores, rather than all 
of the machine's cores.
        *                       This restriction will only occur if these 
properties are not already set.
        */
    -  def fromSparkConf(_conf: SparkConf, numUsableCores: Int = 0): 
TransportConf = {
    +  def fromSparkConf(_conf: SparkConf, module: String, numUsableCores: Int 
= 0):
    +    TransportConf = {
         val conf = _conf.clone
     
         // Specify thread configuration based on our JVM's allocation of cores 
(rather than necessarily
         // assuming we have all the machine's cores).
         // NB: Only set if serverThreads/clientThreads not already set.
         val numThreads = defaultNumThreads(numUsableCores)
    -    conf.set("spark.shuffle.io.serverThreads",
    -      conf.get("spark.shuffle.io.serverThreads", numThreads.toString))
    -    conf.set("spark.shuffle.io.clientThreads",
    -      conf.get("spark.shuffle.io.clientThreads", numThreads.toString))
    +    conf.set("spark." + module + ".io.serverThreads",
    --- End diff --
    
    Not your fault, but this could be `setIfMissing`, no? Also, interpolation 
would look a little better.


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