{"action":"created","comment":{"url":"https://api.github.com/repos/apache/kafka/pulls/comments/56174165","id":56174165,"diff_hunk":"@@ -335,12 +335,23 @@\n \n     /**\n      * Count number of messages of this stream by key without a window basis, and hence\n+     * return a ever updating counting table.","path":"streams/src/main/java/org/apache/kafka/streams/kstream/KStream.java","position":4,"original_position":4,"commit_id":"f9350c6068010901e538052d8c039eaeccdf229a","original_commit_id":"f9350c6068010901e538052d8c039eaeccdf229a","user":{"login":"miguno","id":294849,"avatar_url":"https://avatars.githubusercontent.com/u/294849?v=3","gravatar_id":"","url":"https://api.github.com/users/miguno","html_url":"https://github.com/miguno","followers_url":"https://api.github.com/users/miguno/followers","following_url":"https://api.github.com/users/miguno/following{/other_user}","gists_url":"https://api.github.com/users/miguno/gists{/gist_id}","starred_url":"https://api.github.com/users/miguno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miguno/subscriptions","organizations_url":"https://api.github.com/users/miguno/orgs","repos_url":"https://api.github.com/users/miguno/repos","events_url":"https://api.github.com/users/miguno/events{/privacy}","received_events_url":"https://api.github.com/users/miguno/received_events","type":"User","site_admin":false},"body":"While we're at it, I'd strongly suggest to clarify the behavior of `count()` for both KTable and KStream.\r\n\r\nMy argument is that most users would consider a `count()` function to accept a predicate and return a single number, like Scala's `count()`:\r\n\r\n```scala\r\nscala> \"kafka\".count(_ == 'k')\r\nres1: Int = 2\r\n```\r\n\r\nIn the DSL however, we are returning a `KTable<K, Long>`.  My recommendation would be to 1. add 1-2 clarifying sentences to the docstring and, if it makes sense, 2. add a simple example to the docstring.  (And do this for both KTable and KStream)\r\n\r\nWhat do you think, @ijuma?","created_at":"2016-03-15T14:43:27Z","updated_at":"2016-03-15T14:43:27Z","html_url":"https://github.com/apache/kafka/pull/1065#discussion_r56174165","pull_request_url":"https://api.github.com/repos/apache/kafka/pulls/1065","_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments/56174165"},"html":{"href":"https://github.com/apache/kafka/pull/1065#discussion_r56174165"},"pull_request":{"href":"https://api.github.com/repos/apache/kafka/pulls/1065"}}},"pull_request":{"url":"https://api.github.com/repos/apache/kafka/pulls/1065","id":62827442,"html_url":"https://github.com/apache/kafka/pull/1065","diff_url":"https://github.com/apache/kafka/pull/1065.diff","patch_url":"https://github.com/apache/kafka/pull/1065.patch","issue_url":"https://api.github.com/repos/apache/kafka/issues/1065","number":1065,"state":"open","locked":false,"title":"MINOR: kstream/ktable counting method with default long serdes","user":{"login":"ymatsuda","id":169548,"avatar_url":"https://avatars.githubusercontent.com/u/169548?v=3","gravatar_id":"","url":"https://api.github.com/users/ymatsuda","html_url":"https://github.com/ymatsuda","followers_url":"https://api.github.com/users/ymatsuda/followers","following_url":"https://api.github.com/users/ymatsuda/following{/other_user}","gists_url":"https://api.github.com/users/ymatsuda/gists{/gist_id}","starred_url":"https://api.github.com/users/ymatsuda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ymatsuda/subscriptions","organizations_url":"https://api.github.com/users/ymatsuda/orgs","repos_url":"https://api.github.com/users/ymatsuda/repos","events_url":"https://api.github.com/users/ymatsuda/events{/privacy}","received_events_url":"https://api.github.com/users/ymatsuda/received_events","type":"User","site_admin":false},"body":"@guozhangwang @miguno ","created_at":"2016-03-14T22:25:20Z","updated_at":"2016-03-15T14:43:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"af064312204b599c11edc00bb3aefcfbdb4c1a91","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/kafka/pulls/1065/commits","review_comments_url":"https://api.github.com/repos/apache/kafka/pulls/1065/comments","review_comment_url":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/kafka/issues/1065/comments","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/f9350c6068010901e538052d8c039eaeccdf229a","head":{"label":"ymatsuda:count_serdes","ref":"count_serdes","sha":"f9350c6068010901e538052d8c039eaeccdf229a","user":{"login":"ymatsuda","id":169548,"avatar_url":"https://avatars.githubusercontent.com/u/169548?v=3","gravatar_id":"","url":"https://api.github.com/users/ymatsuda","html_url":"https://github.com/ymatsuda","followers_url":"https://api.github.com/users/ymatsuda/followers","following_url":"https://api.github.com/users/ymatsuda/following{/other_user}","gists_url":"https://api.github.com/users/ymatsuda/gists{/gist_id}","starred_url":"https://api.github.com/users/ymatsuda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ymatsuda/subscriptions","organizations_url":"https://api.github.com/users/ymatsuda/orgs","repos_url":"https://api.github.com/users/ymatsuda/repos","events_url":"https://api.github.com/users/ymatsuda/events{/privacy}","received_events_url":"https://api.github.com/users/ymatsuda/received_events","type":"User","site_admin":false},"repo":{"id":30946235,"name":"kafka","full_name":"ymatsuda/kafka","owner":{"login":"ymatsuda","id":169548,"avatar_url":"https://avatars.githubusercontent.com/u/169548?v=3","gravatar_id":"","url":"https://api.github.com/users/ymatsuda","html_url":"https://github.com/ymatsuda","followers_url":"https://api.github.com/users/ymatsuda/followers","following_url":"https://api.github.com/users/ymatsuda/following{/other_user}","gists_url":"https://api.github.com/users/ymatsuda/gists{/gist_id}","starred_url":"https://api.github.com/users/ymatsuda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ymatsuda/subscriptions","organizations_url":"https://api.github.com/users/ymatsuda/orgs","repos_url":"https://api.github.com/users/ymatsuda/repos","events_url":"https://api.github.com/users/ymatsuda/events{/privacy}","received_events_url":"https://api.github.com/users/ymatsuda/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ymatsuda/kafka","description":"Mirror of Apache Kafka","fork":true,"url":"https://api.github.com/repos/ymatsuda/kafka","forks_url":"https://api.github.com/repos/ymatsuda/kafka/forks","keys_url":"https://api.github.com/repos/ymatsuda/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ymatsuda/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ymatsuda/kafka/teams","hooks_url":"https://api.github.com/repos/ymatsuda/kafka/hooks","issue_events_url":"https://api.github.com/repos/ymatsuda/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/ymatsuda/kafka/events","assignees_url":"https://api.github.com/repos/ymatsuda/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/ymatsuda/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/ymatsuda/kafka/tags","blobs_url":"https://api.github.com/repos/ymatsuda/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ymatsuda/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ymatsuda/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/ymatsuda/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ymatsuda/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/ymatsuda/kafka/languages","stargazers_url":"https://api.github.com/repos/ymatsuda/kafka/stargazers","contributors_url":"https://api.github.com/repos/ymatsuda/kafka/contributors","subscribers_url":"https://api.github.com/repos/ymatsuda/kafka/subscribers","subscription_url":"https://api.github.com/repos/ymatsuda/kafka/subscription","commits_url":"https://api.github.com/repos/ymatsuda/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/ymatsuda/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/ymatsuda/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/ymatsuda/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/ymatsuda/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/ymatsuda/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ymatsuda/kafka/merges","archive_url":"https://api.github.com/repos/ymatsuda/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ymatsuda/kafka/downloads","issues_url":"https://api.github.com/repos/ymatsuda/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/ymatsuda/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/ymatsuda/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/ymatsuda/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ymatsuda/kafka/labels{/name}","releases_url":"https://api.github.com/repos/ymatsuda/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/ymatsuda/kafka/deployments","created_at":"2015-02-18T00:56:44Z","updated_at":"2015-02-18T00:56:46Z","pushed_at":"2016-03-14T22:24:23Z","git_url":"git://github.com/ymatsuda/kafka.git","ssh_url":"git@github.com:ymatsuda/kafka.git","clone_url":"https://github.com/ymatsuda/kafka.git","svn_url":"https://github.com/ymatsuda/kafka","homepage":null,"size":27963,"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":"0.8.2"}},"base":{"label":"apache:trunk","ref":"trunk","sha":"cf40acc2b17cf6d32cee712dad6c88a851ae0715","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":2211243,"name":"kafka","full_name":"apache/kafka","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/kafka","description":"Mirror of Apache Kafka","fork":false,"url":"https://api.github.com/repos/apache/kafka","forks_url":"https://api.github.com/repos/apache/kafka/forks","keys_url":"https://api.github.com/repos/apache/kafka/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/kafka/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/kafka/teams","hooks_url":"https://api.github.com/repos/apache/kafka/hooks","issue_events_url":"https://api.github.com/repos/apache/kafka/issues/events{/number}","events_url":"https://api.github.com/repos/apache/kafka/events","assignees_url":"https://api.github.com/repos/apache/kafka/assignees{/user}","branches_url":"https://api.github.com/repos/apache/kafka/branches{/branch}","tags_url":"https://api.github.com/repos/apache/kafka/tags","blobs_url":"https://api.github.com/repos/apache/kafka/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/kafka/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/kafka/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/kafka/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/kafka/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/kafka/languages","stargazers_url":"https://api.github.com/repos/apache/kafka/stargazers","contributors_url":"https://api.github.com/repos/apache/kafka/contributors","subscribers_url":"https://api.github.com/repos/apache/kafka/subscribers","subscription_url":"https://api.github.com/repos/apache/kafka/subscription","commits_url":"https://api.github.com/repos/apache/kafka/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/kafka/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/kafka/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/kafka/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/kafka/contents/{+path}","compare_url":"https://api.github.com/repos/apache/kafka/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/kafka/merges","archive_url":"https://api.github.com/repos/apache/kafka/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/kafka/downloads","issues_url":"https://api.github.com/repos/apache/kafka/issues{/number}","pulls_url":"https://api.github.com/repos/apache/kafka/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/kafka/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/kafka/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/kafka/labels{/name}","releases_url":"https://api.github.com/repos/apache/kafka/releases{/id}","deployments_url":"https://api.github.com/repos/apache/kafka/deployments","created_at":"2011-08-15T18:06:16Z","updated_at":"2016-03-15T13:55:11Z","pushed_at":"2016-03-15T14:13:17Z","git_url":"git://github.com/apache/kafka.git","ssh_url":"git@github.com:apache/kafka.git","clone_url":"https://github.com/apache/kafka.git","svn_url":"https://github.com/apache/kafka","homepage":null,"size":36453,"stargazers_count":2769,"watchers_count":2769,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1675,"mirror_url":"git://git.apache.org/kafka.git","open_issues_count":158,"forks":1675,"open_issues":158,"watchers":2769,"default_branch":"trunk"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/kafka/pulls/1065"},"html":{"href":"https://github.com/apache/kafka/pull/1065"},"issue":{"href":"https://api.github.com/repos/apache/kafka/issues/1065"},"comments":{"href":"https://api.github.com/repos/apache/kafka/issues/1065/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/kafka/pulls/1065/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/kafka/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/kafka/pulls/1065/commits"},"statuses":{"href":"https://api.github.com/repos/apache/kafka/statuses/f9350c6068010901e538052d8c039eaeccdf229a"}}}}