{"action":"created","comment":{"url":"https://api.github.com/repos/apache/spark/pulls/comments/31982518","id":31982518,"diff_hunk":"@@ -79,7 +93,7 @@ private[streaming] class BlockManagerBasedBlockHandler(\n       throw new SparkException(\n         s\"Could not store $blockId to block manager with storage level $storageLevel\")\n     }\n-    BlockManagerBasedStoreResult(blockId)\n+    BlockManagerBasedStoreResult(blockId, numRecords)","path":"streaming/src/main/scala/org/apache/spark/streaming/receiver/ReceivedBlockHandler.scala","position":51,"original_position":51,"commit_id":"fceac725d8e8fe37146b78e8ae5de32ec52d400f","original_commit_id":"0153e7e21ead817959102c38c49b7f6567b510f4","user":{"login":"dibbhatt","id":4491803,"avatar_url":"https://avatars.githubusercontent.com/u/4491803?v=3","gravatar_id":"","url":"https://api.github.com/users/dibbhatt","html_url":"https://github.com/dibbhatt","followers_url":"https://api.github.com/users/dibbhatt/followers","following_url":"https://api.github.com/users/dibbhatt/following{/other_user}","gists_url":"https://api.github.com/users/dibbhatt/gists{/gist_id}","starred_url":"https://api.github.com/users/dibbhatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dibbhatt/subscriptions","organizations_url":"https://api.github.com/users/dibbhatt/orgs","repos_url":"https://api.github.com/users/dibbhatt/repos","events_url":"https://api.github.com/users/dibbhatt/events{/privacy}","received_events_url":"https://api.github.com/users/dibbhatt/received_events","type":"User","site_admin":false},"body":"@tdas @zsxwing what you think ? Is it fine to count ByteBufferBlock as 1 count ?","created_at":"2015-06-09T04:48:41Z","updated_at":"2015-06-09T04:48:41Z","html_url":"https://github.com/apache/spark/pull/6707#discussion_r31982518","pull_request_url":"https://api.github.com/repos/apache/spark/pulls/6707","_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/comments/31982518"},"html":{"href":"https://github.com/apache/spark/pull/6707#discussion_r31982518"},"pull_request":{"href":"https://api.github.com/repos/apache/spark/pulls/6707"}}},"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/6707","id":37163779,"html_url":"https://github.com/apache/spark/pull/6707","diff_url":"https://github.com/apache/spark/pull/6707.diff","patch_url":"https://github.com/apache/spark/pull/6707.patch","issue_url":"https://api.github.com/repos/apache/spark/issues/6707","number":6707,"state":"open","locked":false,"title":"[SPARK-8080][STREAMING] Receiver.store with Iterator does not give correct count at Spark UI","user":{"login":"dibbhatt","id":4491803,"avatar_url":"https://avatars.githubusercontent.com/u/4491803?v=3","gravatar_id":"","url":"https://api.github.com/users/dibbhatt","html_url":"https://github.com/dibbhatt","followers_url":"https://api.github.com/users/dibbhatt/followers","following_url":"https://api.github.com/users/dibbhatt/following{/other_user}","gists_url":"https://api.github.com/users/dibbhatt/gists{/gist_id}","starred_url":"https://api.github.com/users/dibbhatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dibbhatt/subscriptions","organizations_url":"https://api.github.com/users/dibbhatt/orgs","repos_url":"https://api.github.com/users/dibbhatt/repos","events_url":"https://api.github.com/users/dibbhatt/events{/privacy}","received_events_url":"https://api.github.com/users/dibbhatt/received_events","type":"User","site_admin":false},"body":"@tdas  @zsxwing this is the new PR for Spark-8080\r\n\r\nI have merged https://github.com/apache/spark/pull/6659\r\n\r\nAlso to mention , for MEMORY_ONLY settings , when Block is not able to unrollSafely to memory if enough space is not there, BlockManager won't try to put the block and ReceivedBlockHandler will throw SparkException as it could not find the block id in PutResult. Thus number of records in block won't be counted if Block failed to unroll in memory. Which is fine. \r\n\r\nFor MEMORY_DISK settings , if BlockManager not able to unroll block to memory, block will still get deseralized to Disk. Same for WAL based store. So for those cases ( storage level = memory + disk )  number of records will be counted even though the block not able to unroll to memory.\r\n\r\nthus I added the isFullyConsumed in the CountingIterator but have not used it as such case will never happen that block not fully consumed and ReceivedBlockHandler still get the block ID.\r\n\r\nI have added few test cases to cover those block unrolling scenarios also.","created_at":"2015-06-08T15:14:53Z","updated_at":"2015-06-09T04:48:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8b36afdf784a5259d6342b3f6ab76cb2b523af12","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/spark/pulls/6707/commits","review_comments_url":"https://api.github.com/repos/apache/spark/pulls/6707/comments","review_comment_url":"https://api.github.com/repos/apache/spark/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/spark/issues/6707/comments","statuses_url":"https://api.github.com/repos/apache/spark/statuses/fceac725d8e8fe37146b78e8ae5de32ec52d400f","head":{"label":"dibbhatt:master","ref":"master","sha":"fceac725d8e8fe37146b78e8ae5de32ec52d400f","user":{"login":"dibbhatt","id":4491803,"avatar_url":"https://avatars.githubusercontent.com/u/4491803?v=3","gravatar_id":"","url":"https://api.github.com/users/dibbhatt","html_url":"https://github.com/dibbhatt","followers_url":"https://api.github.com/users/dibbhatt/followers","following_url":"https://api.github.com/users/dibbhatt/following{/other_user}","gists_url":"https://api.github.com/users/dibbhatt/gists{/gist_id}","starred_url":"https://api.github.com/users/dibbhatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dibbhatt/subscriptions","organizations_url":"https://api.github.com/users/dibbhatt/orgs","repos_url":"https://api.github.com/users/dibbhatt/repos","events_url":"https://api.github.com/users/dibbhatt/events{/privacy}","received_events_url":"https://api.github.com/users/dibbhatt/received_events","type":"User","site_admin":false},"repo":{"id":36807693,"name":"spark","full_name":"dibbhatt/spark","owner":{"login":"dibbhatt","id":4491803,"avatar_url":"https://avatars.githubusercontent.com/u/4491803?v=3","gravatar_id":"","url":"https://api.github.com/users/dibbhatt","html_url":"https://github.com/dibbhatt","followers_url":"https://api.github.com/users/dibbhatt/followers","following_url":"https://api.github.com/users/dibbhatt/following{/other_user}","gists_url":"https://api.github.com/users/dibbhatt/gists{/gist_id}","starred_url":"https://api.github.com/users/dibbhatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dibbhatt/subscriptions","organizations_url":"https://api.github.com/users/dibbhatt/orgs","repos_url":"https://api.github.com/users/dibbhatt/repos","events_url":"https://api.github.com/users/dibbhatt/events{/privacy}","received_events_url":"https://api.github.com/users/dibbhatt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dibbhatt/spark","description":"Mirror of Apache Spark","fork":true,"url":"https://api.github.com/repos/dibbhatt/spark","forks_url":"https://api.github.com/repos/dibbhatt/spark/forks","keys_url":"https://api.github.com/repos/dibbhatt/spark/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dibbhatt/spark/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dibbhatt/spark/teams","hooks_url":"https://api.github.com/repos/dibbhatt/spark/hooks","issue_events_url":"https://api.github.com/repos/dibbhatt/spark/issues/events{/number}","events_url":"https://api.github.com/repos/dibbhatt/spark/events","assignees_url":"https://api.github.com/repos/dibbhatt/spark/assignees{/user}","branches_url":"https://api.github.com/repos/dibbhatt/spark/branches{/branch}","tags_url":"https://api.github.com/repos/dibbhatt/spark/tags","blobs_url":"https://api.github.com/repos/dibbhatt/spark/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dibbhatt/spark/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dibbhatt/spark/git/refs{/sha}","trees_url":"https://api.github.com/repos/dibbhatt/spark/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dibbhatt/spark/statuses/{sha}","languages_url":"https://api.github.com/repos/dibbhatt/spark/languages","stargazers_url":"https://api.github.com/repos/dibbhatt/spark/stargazers","contributors_url":"https://api.github.com/repos/dibbhatt/spark/contributors","subscribers_url":"https://api.github.com/repos/dibbhatt/spark/subscribers","subscription_url":"https://api.github.com/repos/dibbhatt/spark/subscription","commits_url":"https://api.github.com/repos/dibbhatt/spark/commits{/sha}","git_commits_url":"https://api.github.com/repos/dibbhatt/spark/git/commits{/sha}","comments_url":"https://api.github.com/repos/dibbhatt/spark/comments{/number}","issue_comment_url":"https://api.github.com/repos/dibbhatt/spark/issues/comments{/number}","contents_url":"https://api.github.com/repos/dibbhatt/spark/contents/{+path}","compare_url":"https://api.github.com/repos/dibbhatt/spark/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dibbhatt/spark/merges","archive_url":"https://api.github.com/repos/dibbhatt/spark/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dibbhatt/spark/downloads","issues_url":"https://api.github.com/repos/dibbhatt/spark/issues{/number}","pulls_url":"https://api.github.com/repos/dibbhatt/spark/pulls{/number}","milestones_url":"https://api.github.com/repos/dibbhatt/spark/milestones{/number}","notifications_url":"https://api.github.com/repos/dibbhatt/spark/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dibbhatt/spark/labels{/name}","releases_url":"https://api.github.com/repos/dibbhatt/spark/releases{/id}","created_at":"2015-06-03T14:06:06Z","updated_at":"2015-06-08T11:47:30Z","pushed_at":"2015-06-09T04:43:27Z","git_url":"git://github.com/dibbhatt/spark.git","ssh_url":"git@github.com:dibbhatt/spark.git","clone_url":"https://github.com/dibbhatt/spark.git","svn_url":"https://github.com/dibbhatt/spark","homepage":null,"size":107547,"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":"e3e9c70384028cc0c322ccea14f19d3b6d6b39eb","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-06-09T04:29:40Z","pushed_at":"2015-06-09T04:43:39Z","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":1427852,"stargazers_count":4264,"watchers_count":4264,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3744,"mirror_url":"git://git.apache.org/spark.git","open_issues_count":335,"forks":3744,"open_issues":335,"watchers":4264,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/spark/pulls/6707"},"html":{"href":"https://github.com/apache/spark/pull/6707"},"issue":{"href":"https://api.github.com/repos/apache/spark/issues/6707"},"comments":{"href":"https://api.github.com/repos/apache/spark/issues/6707/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/spark/pulls/6707/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/spark/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/spark/pulls/6707/commits"},"statuses":{"href":"https://api.github.com/repos/apache/spark/statuses/fceac725d8e8fe37146b78e8ae5de32ec52d400f"}}}}