{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/126306207","pull_request_review_id":48778757,"id":126306207,"diff_hunk":"@@ -58,29 +59,41 @@\n   private final BlockFetchingListener listener;\n   private final ChunkReceivedCallback chunkCallback;\n   private TransportConf transportConf = null;\n-  private File[] shuffleFiles = null;\n+  private Boolean toDisk;\n+  private Supplier<File> tmpFileCreater;\n+  private Supplier<Boolean> shuffleBlockFetcherIteratorIsZombie;\n \n   private StreamHandle streamHandle = null;\n \n   public OneForOneBlockFetcher(\n+    TransportClient client,\n+    String appId,\n+    String execId,\n+    String[] blockIds,\n+    BlockFetchingListener listener,\n+    TransportConf transportConf) {\n+    this(client, appId, execId, blockIds, listener, transportConf, false, null, null);\n+  }\n+\n+  public OneForOneBlockFetcher(\n       TransportClient client,\n       String appId,\n       String execId,\n       String[] blockIds,\n       BlockFetchingListener listener,\n       TransportConf transportConf,\n-      File[] shuffleFiles) {\n+      Boolean toDisk,\n+      Supplier<File> tmpFileCreater,\n+      Supplier<Boolean> shuffleBlockFetcherIteratorIsZombie) {","path":"common/network-shuffle/src/main/java/org/apache/spark/network/shuffle/OneForOneBlockFetcher.java","position":null,"original_position":39,"commit_id":"5d2f98c93d8caca67a53877dc6a3f539b3ee1cc3","original_commit_id":"d489ba25bc1b92d2dbc6100ad789e5b512fb13b1","user":{"login":"jinxing64","id":4058918,"avatar_url":"https://avatars3.githubusercontent.com/u/4058918?v=3","gravatar_id":"","url":"https://api.github.com/users/jinxing64","html_url":"https://github.com/jinxing64","followers_url":"https://api.github.com/users/jinxing64/followers","following_url":"https://api.github.com/users/jinxing64/following{/other_user}","gists_url":"https://api.github.com/users/jinxing64/gists{/gist_id}","starred_url":"https://api.github.com/users/jinxing64/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jinxing64/subscriptions","organizations_url":"https://api.github.com/users/jinxing64/orgs","repos_url":"https://api.github.com/users/jinxing64/repos","events_url":"https://api.github.com/users/jinxing64/events{/privacy}","received_events_url":"https://api.github.com/users/jinxing64/received_events","type":"User","site_admin":false},"body":"I will refine.","created_at":"2017-07-09T14:31:22Z","updated_at":"2017-07-09T14:31:22Z","html_url":"https://github.com/apache/spark/pull/18565#discussion_r126306207","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/18565","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/126306207"},"html":{"href":"https://github.com/apache/spark/pull/18565#discussion_r126306207"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/18565"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/18565","id":129431900,"html_url":"https://github.com/apache/spark/pull/18565","diff_url":"https://github.com/apache/spark/pull/18565.diff","patch_url":"https://github.com/apache/spark/pull/18565.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/18565","number":18565,"state":"open","locked":false,"title":"[SPARK-21342] Fix DownloadCallback to work well with RetryingBlockFetcher.","user":{"login":"jinxing64","id":4058918,"avatar_url":"https://avatars3.githubusercontent.com/u/4058918?v=3","gravatar_id":"","url":"https://api.github.com/users/jinxing64","html_url":"https://github.com/jinxing64","followers_url":"https://api.github.com/users/jinxing64/followers","following_url":"https://api.github.com/users/jinxing64/following{/other_user}","gists_url":"https://api.github.com/users/jinxing64/gists{/gist_id}","starred_url":"https://api.github.com/users/jinxing64/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jinxing64/subscriptions","organizations_url":"https://api.github.com/users/jinxing64/orgs","repos_url":"https://api.github.com/users/jinxing64/repos","events_url":"https://api.github.com/users/jinxing64/events{/privacy}","received_events_url":"https://api.github.com/users/jinxing64/received_events","type":"User","site_admin":false},"body":"## What changes were proposed in this pull request?\r\n\r\nWhen `RetryingBlockFetcher` retries fetching blocks. There could be two `DownloadCallback`s download the same content to the same target file. It could cause `ShuffleBlockFetcherIterator` reading a partial result.\r\n\r\nThis pr proposes to create and delete the tmp files in `OneForOneBlockFetcher`","created_at":"2017-07-07T15:38:03Z","updated_at":"2017-07-09T14:31:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"286665aa8c439ade3df4f80d3cb4d5dd1fea96d5","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/18565/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/18565/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/18565/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/5d2f98c93d8caca67a53877dc6a3f539b3ee1cc3","head":{"label":"jinxing64:SPARK-21342","ref":"SPARK-21342","sha":"5d2f98c93d8caca67a53877dc6a3f539b3ee1cc3","user":{"login":"jinxing64","id":4058918,"avatar_url":"https://avatars3.githubusercontent.com/u/4058918?v=3","gravatar_id":"","url":"https://api.github.com/users/jinxing64","html_url":"https://github.com/jinxing64","followers_url":"https://api.github.com/users/jinxing64/followers","following_url":"https://api.github.com/users/jinxing64/following{/other_user}","gists_url":"https://api.github.com/users/jinxing64/gists{/gist_id}","starred_url":"https://api.github.com/users/jinxing64/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jinxing64/subscriptions","organizations_url":"https://api.github.com/users/jinxing64/orgs","repos_url":"https://api.github.com/users/jinxing64/repos","events_url":"https://api.github.com/users/jinxing64/events{/privacy}","received_events_url":"https://api.github.com/users/jinxing64/received_events","type":"User","site_admin":false},"repo":{"id":78330400,"name":"spark","full_name":"jinxing64/spark","owner":{"login":"jinxing64","id":4058918,"avatar_url":"https://avatars3.githubusercontent.com/u/4058918?v=3","gravatar_id":"","url":"https://api.github.com/users/jinxing64","html_url":"https://github.com/jinxing64","followers_url":"https://api.github.com/users/jinxing64/followers","following_url":"https://api.github.com/users/jinxing64/following{/other_user}","gists_url":"https://api.github.com/users/jinxing64/gists{/gist_id}","starred_url":"https://api.github.com/users/jinxing64/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jinxing64/subscriptions","organizations_url":"https://api.github.com/users/jinxing64/orgs","repos_url":"https://api.github.com/users/jinxing64/repos","events_url":"https://api.github.com/users/jinxing64/events{/privacy}","received_events_url":"https://api.github.com/users/jinxing64/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jinxing64/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/jinxing64/spark","forks_url":"https://api.github.com/repos/jinxing64/spark/forks","keys_url":"https://api.github.com/repos/jinxing64/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jinxing64/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jinxing64/spark/teams","hooks_url":"https://api.github.com/repos/jinxing64/spark/hooks","issue_events_url":"https://api.github.com/repos/jinxing64/spark/issues/events{/number}","events_url":"https://api.github.com/repos/jinxing64/spark/events","assignees_url":"https://api.github.com/repos/jinxing64/spark/assignees{/user}","branches_url":"https://api.github.com/repos/jinxing64/spark/branches{/branch}","tags_url":"https://api.github.com/repos/jinxing64/spark/tags","blobs_url":"https://api.github.com/repos/jinxing64/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jinxing64/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jinxing64/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/jinxing64/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jinxing64/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/jinxing64/spark/languages","stargazers_url":"https://api.github.com/repos/jinxing64/spark/stargazers","contributors_url":"https://api.github.com/repos/jinxing64/spark/contributors","subscribers_url":"https://api.github.com/repos/jinxing64/spark/subscribers","subscription_url":"https://api.github.com/repos/jinxing64/spark/subscription","commits_url":"https://api.github.com/repos/jinxing64/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/jinxing64/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/jinxing64/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/jinxing64/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/jinxing64/spark/contents/{+path}","compare_url":"https://api.github.com/repos/jinxing64/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jinxing64/spark/merges","archive_url":"https://api.github.com/repos/jinxing64/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jinxing64/spark/downloads","issues_url":"https://api.github.com/repos/jinxing64/spark/issues{/number}","pulls_url":"https://api.github.com/repos/jinxing64/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/jinxing64/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/jinxing64/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jinxing64/spark/labels{/name}","releases_url":"https://api.github.com/repos/jinxing64/spark/releases{/id}","deployments_url":"https://api.github.com/repos/jinxing64/spark/deployments","created_at":"2017-01-08T08:21:45Z","updated_at":"2017-01-08T08:22:09Z","pushed_at":"2017-07-09T14:30:49Z","git_url":"git://github.com/jinxing64/spark.git","ssh_url":"git@github.com:jinxing64/spark.git","clone_url":"https://github.com/jinxing64/spark.git","svn_url":"https://github.com/jinxing64/spark","homepage":null,"size":254061,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"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":"08e0d033b40946b4ef5741a7aa1e7ba0bd48c6fb","user":{"login":"apache","id":47359,"avatar_url":"https://avatars3.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://avatars3.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}","deployments_url":"https://api.github.com/repos/apache/spark/deployments","created_at":"2014-02-25T08:00:08Z","updated_at":"2017-07-09T14:23:17Z","pushed_at":"2017-07-09T14:30:59Z","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":255811,"stargazers_count":13443,"watchers_count":13443,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":12682,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":390,"forks":12682,"open_issues":390,"watchers":13443,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/18565"},"html":{"href":"https://github.com/apache/spark/pull/18565"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/18565"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/18565/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/18565/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/18565/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/5d2f98c93d8caca67a53877dc6a3f539b3ee1cc3"}}}}
{"actor":{"display_login":"jinxing64"}}