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

    https://github.com/apache/spark/pull/5178#discussion_r27781900
  
    --- Diff: 
core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala 
---
    @@ -181,68 +181,102 @@ final class ShuffleBlockFetcherIterator(
         // at most maxBytesInFlight in order to limit the amount of data in 
flight.
         val remoteRequests = new ArrayBuffer[FetchRequest]
     
    +    val shuffleMgrName = blockManager.conf.get("spark.shuffle.manager", 
"sort")
    +    val externalShuffleServiceEnabled =
    +      blockManager.conf.getBoolean("spark.shuffle.service.enabled", false)
    +
         // Tracks total number of blocks (including zero sized blocks)
         var totalBlocks = 0
    -    for ((address, blockInfos) <- blocksByAddress) {
    -      totalBlocks += blockInfos.size
    -      if (address.executorId == blockManager.blockManagerId.executorId) {
    -        // Filter out zero-sized blocks
    -        localBlocks ++= blockInfos.filter(_._2 != 0).map(_._1)
    -        numBlocksToFetch += localBlocks.size
    -      } else {
    -        val iterator = blockInfos.iterator
    -        var curRequestSize = 0L
    -        var curBlocks = new ArrayBuffer[(BlockId, Long)]
    -        while (iterator.hasNext) {
    -          val (blockId, size) = iterator.next()
    -          // Skip empty blocks
    -          if (size > 0) {
    -            curBlocks += ((blockId, size))
    -            remoteBlocks += blockId
    -            numBlocksToFetch += 1
    -            curRequestSize += size
    -          } else if (size < 0) {
    -            throw new BlockException(blockId, "Negative block size " + 
size)
    -          }
    -          if (curRequestSize >= targetRequestSize) {
    -            // Add this FetchRequest
    -            remoteRequests += new FetchRequest(address, curBlocks)
    -            curBlocks = new ArrayBuffer[(BlockId, Long)]
    -            logDebug(s"Creating fetch request of $curRequestSize at 
$address")
    -            curRequestSize = 0
    -          }
    +    if (shuffleMgrName.toLowerCase == "hash" || 
externalShuffleServiceEnabled) {
    +      for ((address, blockInfos) <- blocksByAddress) {
    --- End diff --
    
    We should check if SortShuffleManager is used because this patch only 
supports it. This logic fails when new shuffle managers will be implemented.


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

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to