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

    https://github.com/apache/spark/pull/1241#discussion_r14696298
  
    --- Diff: core/src/main/scala/org/apache/spark/storage/BlockManager.scala 
---
    @@ -72,23 +74,48 @@ private[spark] class BlockManager(
       // Actual storage of where blocks are kept
       private var tachyonInitialized = false
       private[storage] val memoryStore = new MemoryStore(this, maxMemory)
    -  private[storage] val diskStore = new DiskStore(this, diskBlockManager)
    +  private[spark] val diskStore = new DiskStore(this, diskBlockManager)
       private[storage] lazy val tachyonStore: TachyonStore = {
         val storeDir = conf.get("spark.tachyonStore.baseDir", 
"/tmp_spark_tachyon")
         val appFolderName = conf.get("spark.tachyonStore.folderName")
         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)
       }
     
    +  val shuffleManager = {
    +    val name = conf.get("spark.shuffle.manager",
    +      "org.apache.spark.shuffle.hash.HashShuffleManager")
    +    val clazz = Class.forName(name, true, 
Utils.getContextOrSparkClassLoader)
    +    try {
    +      
clazz.getConstructor(classOf[SparkConf]).newInstance(conf).asInstanceOf[ShuffleManager]
    +    } catch {
    +      case _: NoSuchMethodException =>
    +        clazz.getConstructor().newInstance().asInstanceOf[ShuffleManager]
    +    }
    +  }
    +
    +  private var nettyShuffleSender : ShuffleSender = null
       // If we use Netty for shuffle, start a new Netty-based shuffle sender 
service.
       private val nettyPort: Int = {
         val useNetty = conf.getBoolean("spark.shuffle.use.netty", false)
         val nettyPortConfig = conf.getInt("spark.shuffle.sender.port", 0)
    -    if (useNetty) 
diskBlockManager.startShuffleBlockSender(nettyPortConfig) else 0
    +    // At present, only HashShuffleBlockManager support the 
getBlockLocation method.
    +    if (useNetty && shuffleManager.isInstanceOf[HashShuffleManager]) {
    --- End diff --
    
    right now we have two comm implementations in Spark: netty and a custom nio 
implementation. After 1.1, we should look into the two and consolidate them. We 
should pick one and make sure that is robust, instead of having two that 
complicate things. 


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to