{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/27193887","id":27193887,"diff_hunk":"@@ -181,68 +181,100 @@ final class ShuffleBlockFetcherIterator(\n     // at most maxBytesInFlight in order to limit the amount of data in flight.\n     val remoteRequests = new ArrayBuffer[FetchRequest]\n \n+    val shuffleMgrName = SparkEnv.get.conf.get(\"spark.shuffle.manager\", \"sort\")\n+\n     // Tracks total number of blocks (including zero sized blocks)\n     var totalBlocks = 0\n-    for ((address, blockInfos) <- blocksByAddress) {\n-      totalBlocks += blockInfos.size\n-      if (address.executorId == blockManager.blockManagerId.executorId) {\n-        // Filter out zero-sized blocks\n-        localBlocks ++= blockInfos.filter(_._2 != 0).map(_._1)\n-        numBlocksToFetch += localBlocks.size\n-      } else {\n-        val iterator = blockInfos.iterator\n-        var curRequestSize = 0L\n-        var curBlocks = new ArrayBuffer[(BlockId, Long)]\n-        while (iterator.hasNext) {\n-          val (blockId, size) = iterator.next()\n-          // Skip empty blocks\n-          if (size > 0) {\n-            curBlocks += ((blockId, size))\n-            remoteBlocks += blockId\n-            numBlocksToFetch += 1\n-            curRequestSize += size\n-          } else if (size < 0) {\n-            throw new BlockException(blockId, \"Negative block size \" + size)\n-          }\n-          if (curRequestSize >= targetRequestSize) {\n-            // Add this FetchRequest\n-            remoteRequests += new FetchRequest(address, curBlocks)\n-            curBlocks = new ArrayBuffer[(BlockId, Long)]\n-            logDebug(s\"Creating fetch request of $curRequestSize at $address\")\n-            curRequestSize = 0\n-          }\n+    if(shuffleMgrName == \"hash\") {","path":"core/src/main/scala/org/apache/spark/storage/ShuffleBlockFetcherIterator.scala","position":58,"original_position":58,"commit_id":"0eaf1afdc0c082fde53f3edcbc45ee75425ea98b","original_commit_id":"5b766ca3f02d2e9b213e39908aec9c6b5804b623","user":{"login":"viper-kun","id":6460155,"avatar_url":"https://avatars.githubusercontent.com/u/6460155?v=3","gravatar_id":"","url":"https://api.github.com/users/viper-kun","html_url":"https://github.com/viper-kun","followers_url":"https://api.github.com/users/viper-kun/followers","following_url":"https://api.github.com/users/viper-kun/following{/other_user}","gists_url":"https://api.github.com/users/viper-kun/gists{/gist_id}","starred_url":"https://api.github.com/users/viper-kun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viper-kun/subscriptions","organizations_url":"https://api.github.com/users/viper-kun/orgs","repos_url":"https://api.github.com/users/viper-kun/repos","events_url":"https://api.github.com/users/viper-kun/events{/privacy}","received_events_url":"https://api.github.com/users/viper-kun/received_events","type":"User","site_admin":false},"body":"what are you means？how to specify the full path？","created_at":"2015-03-26T08:01:42Z","updated_at":"2015-03-26T08:01:42Z","html_url":"https://github.com/apache/spark/pull/5178#discussion_r27193887","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/5178","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/27193887"},"html":{"href":"https://github.com/apache/spark/pull/5178#discussion_r27193887"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/5178"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/5178","id":31889855,"html_url":"https://github.com/apache/spark/pull/5178","diff_url":"https://github.com/apache/spark/pull/5178.diff","patch_url":"https://github.com/apache/spark/pull/5178.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/5178","number":5178,"state":"open","locked":false,"title":"[SPARK-6521][Core]executors in the same node read local shuffle file","user":{"login":"viper-kun","id":6460155,"avatar_url":"https://avatars.githubusercontent.com/u/6460155?v=3","gravatar_id":"","url":"https://api.github.com/users/viper-kun","html_url":"https://github.com/viper-kun","followers_url":"https://api.github.com/users/viper-kun/followers","following_url":"https://api.github.com/users/viper-kun/following{/other_user}","gists_url":"https://api.github.com/users/viper-kun/gists{/gist_id}","starred_url":"https://api.github.com/users/viper-kun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viper-kun/subscriptions","organizations_url":"https://api.github.com/users/viper-kun/orgs","repos_url":"https://api.github.com/users/viper-kun/repos","events_url":"https://api.github.com/users/viper-kun/events{/privacy}","received_events_url":"https://api.github.com/users/viper-kun/received_events","type":"User","site_admin":false},"body":"In the past, executor read other executor's shuffle file in the same node by net. This pr make that executors in the same node read local shuffle file In sort-based Shuffle. It will reduce net transport.","created_at":"2015-03-25T03:08:28Z","updated_at":"2015-03-26T08:01:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fa161d6a643676cdd038b44b56a350506e240f47","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/5178/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/5178/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/5178/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/0eaf1afdc0c082fde53f3edcbc45ee75425ea98b","head":{"label":"viper-kun:readlocal","ref":"readlocal","sha":"0eaf1afdc0c082fde53f3edcbc45ee75425ea98b","user":{"login":"viper-kun","id":6460155,"avatar_url":"https://avatars.githubusercontent.com/u/6460155?v=3","gravatar_id":"","url":"https://api.github.com/users/viper-kun","html_url":"https://github.com/viper-kun","followers_url":"https://api.github.com/users/viper-kun/followers","following_url":"https://api.github.com/users/viper-kun/following{/other_user}","gists_url":"https://api.github.com/users/viper-kun/gists{/gist_id}","starred_url":"https://api.github.com/users/viper-kun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viper-kun/subscriptions","organizations_url":"https://api.github.com/users/viper-kun/orgs","repos_url":"https://api.github.com/users/viper-kun/repos","events_url":"https://api.github.com/users/viper-kun/events{/privacy}","received_events_url":"https://api.github.com/users/viper-kun/received_events","type":"User","site_admin":false},"repo":{"id":28477082,"name":"spark","full_name":"viper-kun/spark","owner":{"login":"viper-kun","id":6460155,"avatar_url":"https://avatars.githubusercontent.com/u/6460155?v=3","gravatar_id":"","url":"https://api.github.com/users/viper-kun","html_url":"https://github.com/viper-kun","followers_url":"https://api.github.com/users/viper-kun/followers","following_url":"https://api.github.com/users/viper-kun/following{/other_user}","gists_url":"https://api.github.com/users/viper-kun/gists{/gist_id}","starred_url":"https://api.github.com/users/viper-kun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viper-kun/subscriptions","organizations_url":"https://api.github.com/users/viper-kun/orgs","repos_url":"https://api.github.com/users/viper-kun/repos","events_url":"https://api.github.com/users/viper-kun/events{/privacy}","received_events_url":"https://api.github.com/users/viper-kun/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/viper-kun/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/viper-kun/spark","forks_url":"https://api.github.com/repos/viper-kun/spark/forks","keys_url":"https://api.github.com/repos/viper-kun/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/viper-kun/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/viper-kun/spark/teams","hooks_url":"https://api.github.com/repos/viper-kun/spark/hooks","issue_events_url":"https://api.github.com/repos/viper-kun/spark/issues/events{/number}","events_url":"https://api.github.com/repos/viper-kun/spark/events","assignees_url":"https://api.github.com/repos/viper-kun/spark/assignees{/user}","branches_url":"https://api.github.com/repos/viper-kun/spark/branches{/branch}","tags_url":"https://api.github.com/repos/viper-kun/spark/tags","blobs_url":"https://api.github.com/repos/viper-kun/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/viper-kun/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/viper-kun/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/viper-kun/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/viper-kun/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/viper-kun/spark/languages","stargazers_url":"https://api.github.com/repos/viper-kun/spark/stargazers","contributors_url":"https://api.github.com/repos/viper-kun/spark/contributors","subscribers_url":"https://api.github.com/repos/viper-kun/spark/subscribers","subscription_url":"https://api.github.com/repos/viper-kun/spark/subscription","commits_url":"https://api.github.com/repos/viper-kun/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/viper-kun/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/viper-kun/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/viper-kun/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/viper-kun/spark/contents/{+path}","compare_url":"https://api.github.com/repos/viper-kun/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/viper-kun/spark/merges","archive_url":"https://api.github.com/repos/viper-kun/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/viper-kun/spark/downloads","issues_url":"https://api.github.com/repos/viper-kun/spark/issues{/number}","pulls_url":"https://api.github.com/repos/viper-kun/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/viper-kun/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/viper-kun/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/viper-kun/spark/labels{/name}","releases_url":"https://api.github.com/repos/viper-kun/spark/releases{/id}","created_at":"2014-12-25T09:12:09Z","updated_at":"2014-12-25T09:14:48Z","pushed_at":"2015-03-26T07:54:27Z","git_url":"git://github.com/viper-kun/spark.git","ssh_url":"git@github.com:viper-kun/spark.git","clone_url":"https://github.com/viper-kun/spark.git","svn_url":"https://github.com/viper-kun/spark","homepage":null,"size":95570,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"c14ddd97ed662a8429b9b9078bd7c1a5a1dd3d6c","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":17165658,"name":"spark","full_name":"apache/spark","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/spark","description":"Mirror of Apache Spark","fork":false,"url":"https://api.github.com/repos/apache/spark","forks_url":"https://api.github.com/repos/apache/spark/forks","keys_url":"https://api.github.com/repos/apache/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/spark/teams","hooks_url":"https://api.github.com/repos/apache/spark/hooks","issue_events_url":"https://api.github.com/repos/apache/spark/issues/events{/number}","events_url":"https://api.github.com/repos/apache/spark/events","assignees_url":"https://api.github.com/repos/apache/spark/assignees{/user}","branches_url":"https://api.github.com/repos/apache/spark/branches{/branch}","tags_url":"https://api.github.com/repos/apache/spark/tags","blobs_url":"https://api.github.com/repos/apache/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/spark/languages","stargazers_url":"https://api.github.com/repos/apache/spark/stargazers","contributors_url":"https://api.github.com/repos/apache/spark/contributors","subscribers_url":"https://api.github.com/repos/apache/spark/subscribers","subscription_url":"https://api.github.com/repos/apache/spark/subscription","commits_url":"https://api.github.com/repos/apache/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/spark/contents/{+path}","compare_url":"https://api.github.com/repos/apache/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/spark/merges","archive_url":"https://api.github.com/repos/apache/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/spark/downloads","issues_url":"https://api.github.com/repos/apache/spark/issues{/number}","pulls_url":"https://api.github.com/repos/apache/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/spark/labels{/name}","releases_url":"https://api.github.com/repos/apache/spark/releases{/id}","created_at":"2014-02-25T08:00:08Z","updated_at":"2015-03-26T07:25:22Z","pushed_at":"2015-03-26T07:55:55Z","git_url":"git://github.com/apache/spark.git","ssh_url":"git@github.com:apache/spark.git","clone_url":"https://github.com/apache/spark.git","svn_url":"https://github.com/apache/spark","homepage":null,"size":1440354,"stargazers_count":3367,"watchers_count":3367,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2906,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":287,"forks":2906,"open_issues":287,"watchers":3367,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/5178"},"html":{"href":"https://github.com/apache/spark/pull/5178"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/5178"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/5178/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/5178/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/5178/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/0eaf1afdc0c082fde53f3edcbc45ee75425ea98b"}}}}