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

    https://github.com/apache/spark/pull/1241#discussion_r16759256
  
    --- Diff: core/src/main/scala/org/apache/spark/storage/BlockManager.scala 
---
    @@ -85,18 +87,62 @@ private[spark] class BlockManager(
         val tachyonStorePath = s"$storeDir/$appFolderName/${this.executorId}"
         val tachyonMaster = conf.get("spark.tachyonStore.url",  
"tachyon://localhost:19998")
         val tachyonBlockManager =
    -      new TachyonBlockManager(shuffleBlockManager, tachyonStorePath, 
tachyonMaster)
    +      new TachyonBlockManager(this, tachyonStorePath, tachyonMaster)
         tachyonInitialized = true
         new TachyonStore(this, tachyonBlockManager)
       }
     
    -  private val useNetty = conf.getBoolean("spark.shuffle.use.netty", false)
    +  val shuffleManager = {
    +    // Let the user specify short names for shuffle managers
    +    val shortShuffleMgrNames = Map(
    +      "hash" -> "org.apache.spark.shuffle.hash.HashShuffleManager",
    +      "sort" -> "org.apache.spark.shuffle.sort.SortShuffleManager")
    +    val shuffleMgrName = conf.get("spark.shuffle.manager", "hash")
    +    val shuffleMgrClass = 
shortShuffleMgrNames.getOrElse(shuffleMgrName.toLowerCase, shuffleMgrName)
    +
    +    val clazz = Class.forName(shuffleMgrClass, true, 
Utils.getContextOrSparkClassLoader)
    +    try {
    +      
clazz.getConstructor(classOf[SparkConf]).newInstance(conf).asInstanceOf[ShuffleManager]
    +    } catch {
    +      case _: NoSuchMethodException =>
    +        clazz.getConstructor().newInstance().asInstanceOf[ShuffleManager]
    +    }
    +  }
    +
    +  var shuffleBlockPathResolver: PathResolver = null
    +  private val useNetty = {
    +    val userConfigNetty = conf.getBoolean("spark.shuffle.use.netty", false)
    +
    +    if (userConfigNetty && (shuffleManager.isInstanceOf[HashShuffleManager]
    +      || shuffleManager.isInstanceOf[SortShuffleManager])) {
    +      shuffleBlockPathResolver = 
shuffleManager.shuffleBlockManager.asInstanceOf[PathResolver]
    +      true
    +    } else {
    +      false
    +    }
    +  }
     
       // If we use Netty for shuffle, start a new Netty-based shuffle sender 
service.
       private[storage] val nettyBlockClientFactory: BlockFetchingClientFactory 
= {
         if (useNetty) new BlockFetchingClientFactory(conf) else null
       }
     
    +  /*
    --- End diff --
    
    u can remove this code


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