{"action":"created","comment":{"url":"https://api.github.com/repos/twitter/algebird/pulls/comments/36267214","id":36267214,"diff_hunk":"@@ -1045,14 +1017,83 @@ object TopNCMS {\n /**\n  * An Aggregator for [[TopNCMS]].  Can be created using [[TopNCMS.aggregator]].\n  */\n-case class TopNCMSAggregator[K](cmsMonoid: TopNCMSMonoid[K])\n-  extends MonoidAggregator[K, TopCMS[K], TopCMS[K]] {\n+case class TopNCMSAggregator[K](cmsMonoid: TopNCMSMonoid[K]) extends TopCMSAggregator(cmsMonoid)\n \n-  val monoid = cmsMonoid\n+case class ScopedTopNLogic[K1, K2](heavyHittersN: Int) extends HeavyHittersLogic[(K1, K2)] {","path":"algebird-core/src/main/scala/com/twitter/algebird/CountMinSketch.scala","position":171,"original_position":171,"commit_id":"75a7ad1564f14156411a6707453133cf4b94d732","original_commit_id":"75a7ad1564f14156411a6707453133cf4b94d732","user":{"login":"johnynek","id":67958,"avatar_url":"https://avatars.githubusercontent.com/u/67958?v=3","gravatar_id":"","url":"https://api.github.com/users/johnynek","html_url":"https://github.com/johnynek","followers_url":"https://api.github.com/users/johnynek/followers","following_url":"https://api.github.com/users/johnynek/following{/other_user}","gists_url":"https://api.github.com/users/johnynek/gists{/gist_id}","starred_url":"https://api.github.com/users/johnynek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnynek/subscriptions","organizations_url":"https://api.github.com/users/johnynek/orgs","repos_url":"https://api.github.com/users/johnynek/repos","events_url":"https://api.github.com/users/johnynek/events{/privacy}","received_events_url":"https://api.github.com/users/johnynek/received_events","type":"User","site_admin":false},"body":"can we add a comment to this logic about what is going on? I think for each `K1`, we keep the top `heavyHittersN`.","created_at":"2015-08-05T03:32:33Z","updated_at":"2015-08-05T03:32:33Z","html_url":"https://github.com/twitter/algebird/pull/471#discussion_r36267214","pull_request_url":"https://api.github.com/repos/twitter/algebird/pulls/471","_links":{"self":{"href":"https://api.github.com/repos/twitter/algebird/pulls/comments/36267214"},"html":{"href":"https://github.com/twitter/algebird/pull/471#discussion_r36267214"},"pull_request":{"href":"https://api.github.com/repos/twitter/algebird/pulls/471"}}},"pull_request":{"url":"https://api.github.com/repos/twitter/algebird/pulls/471","id":40629297,"html_url":"https://github.com/twitter/algebird/pull/471","diff_url":"https://github.com/twitter/algebird/pull/471.diff","patch_url":"https://github.com/twitter/algebird/pull/471.patch","issue_url":"https://api.github.com/repos/twitter/algebird/issues/471","number":471,"state":"open","locked":false,"title":"Adding scoped top-N CMS monoid","user":{"login":"jnievelt","id":4684038,"avatar_url":"https://avatars.githubusercontent.com/u/4684038?v=3","gravatar_id":"","url":"https://api.github.com/users/jnievelt","html_url":"https://github.com/jnievelt","followers_url":"https://api.github.com/users/jnievelt/followers","following_url":"https://api.github.com/users/jnievelt/following{/other_user}","gists_url":"https://api.github.com/users/jnievelt/gists{/gist_id}","starred_url":"https://api.github.com/users/jnievelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnievelt/subscriptions","organizations_url":"https://api.github.com/users/jnievelt/orgs","repos_url":"https://api.github.com/users/jnievelt/repos","events_url":"https://api.github.com/users/jnievelt/events{/privacy}","received_events_url":"https://api.github.com/users/jnievelt/received_events","type":"User","site_admin":false},"body":"Closes #468\r\n\r\nA bit of refactoring out duplicate code.  Leaving in `TopPctCMSAggregator` and `TopNCMSAggregator` so this should be binary compatible.","created_at":"2015-07-23T01:29:59Z","updated_at":"2015-08-05T03:32:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1d831b5d2bb422139dad0928a7b2293f46460b79","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/twitter/algebird/pulls/471/commits","review_comments_url":"https://api.github.com/repos/twitter/algebird/pulls/471/comments","review_comment_url":"https://api.github.com/repos/twitter/algebird/pulls/comments{/number}","comments_url":"https://api.github.com/repos/twitter/algebird/issues/471/comments","statuses_url":"https://api.github.com/repos/twitter/algebird/statuses/75a7ad1564f14156411a6707453133cf4b94d732","head":{"label":"twitter:jnievelt-468","ref":"jnievelt-468","sha":"75a7ad1564f14156411a6707453133cf4b94d732","user":{"login":"twitter","id":50278,"avatar_url":"https://avatars.githubusercontent.com/u/50278?v=3","gravatar_id":"","url":"https://api.github.com/users/twitter","html_url":"https://github.com/twitter","followers_url":"https://api.github.com/users/twitter/followers","following_url":"https://api.github.com/users/twitter/following{/other_user}","gists_url":"https://api.github.com/users/twitter/gists{/gist_id}","starred_url":"https://api.github.com/users/twitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twitter/subscriptions","organizations_url":"https://api.github.com/users/twitter/orgs","repos_url":"https://api.github.com/users/twitter/repos","events_url":"https://api.github.com/users/twitter/events{/privacy}","received_events_url":"https://api.github.com/users/twitter/received_events","type":"Organization","site_admin":false},"repo":{"id":5275507,"name":"algebird","full_name":"twitter/algebird","owner":{"login":"twitter","id":50278,"avatar_url":"https://avatars.githubusercontent.com/u/50278?v=3","gravatar_id":"","url":"https://api.github.com/users/twitter","html_url":"https://github.com/twitter","followers_url":"https://api.github.com/users/twitter/followers","following_url":"https://api.github.com/users/twitter/following{/other_user}","gists_url":"https://api.github.com/users/twitter/gists{/gist_id}","starred_url":"https://api.github.com/users/twitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twitter/subscriptions","organizations_url":"https://api.github.com/users/twitter/orgs","repos_url":"https://api.github.com/users/twitter/repos","events_url":"https://api.github.com/users/twitter/events{/privacy}","received_events_url":"https://api.github.com/users/twitter/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/twitter/algebird","description":"Abstract Algebra for Scala","fork":false,"url":"https://api.github.com/repos/twitter/algebird","forks_url":"https://api.github.com/repos/twitter/algebird/forks","keys_url":"https://api.github.com/repos/twitter/algebird/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twitter/algebird/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twitter/algebird/teams","hooks_url":"https://api.github.com/repos/twitter/algebird/hooks","issue_events_url":"https://api.github.com/repos/twitter/algebird/issues/events{/number}","events_url":"https://api.github.com/repos/twitter/algebird/events","assignees_url":"https://api.github.com/repos/twitter/algebird/assignees{/user}","branches_url":"https://api.github.com/repos/twitter/algebird/branches{/branch}","tags_url":"https://api.github.com/repos/twitter/algebird/tags","blobs_url":"https://api.github.com/repos/twitter/algebird/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twitter/algebird/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twitter/algebird/git/refs{/sha}","trees_url":"https://api.github.com/repos/twitter/algebird/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twitter/algebird/statuses/{sha}","languages_url":"https://api.github.com/repos/twitter/algebird/languages","stargazers_url":"https://api.github.com/repos/twitter/algebird/stargazers","contributors_url":"https://api.github.com/repos/twitter/algebird/contributors","subscribers_url":"https://api.github.com/repos/twitter/algebird/subscribers","subscription_url":"https://api.github.com/repos/twitter/algebird/subscription","commits_url":"https://api.github.com/repos/twitter/algebird/commits{/sha}","git_commits_url":"https://api.github.com/repos/twitter/algebird/git/commits{/sha}","comments_url":"https://api.github.com/repos/twitter/algebird/comments{/number}","issue_comment_url":"https://api.github.com/repos/twitter/algebird/issues/comments{/number}","contents_url":"https://api.github.com/repos/twitter/algebird/contents/{+path}","compare_url":"https://api.github.com/repos/twitter/algebird/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twitter/algebird/merges","archive_url":"https://api.github.com/repos/twitter/algebird/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twitter/algebird/downloads","issues_url":"https://api.github.com/repos/twitter/algebird/issues{/number}","pulls_url":"https://api.github.com/repos/twitter/algebird/pulls{/number}","milestones_url":"https://api.github.com/repos/twitter/algebird/milestones{/number}","notifications_url":"https://api.github.com/repos/twitter/algebird/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twitter/algebird/labels{/name}","releases_url":"https://api.github.com/repos/twitter/algebird/releases{/id}","created_at":"2012-08-02T17:24:42Z","updated_at":"2015-08-04T23:21:05Z","pushed_at":"2015-08-05T01:41:08Z","git_url":"git://github.com/twitter/algebird.git","ssh_url":"git@github.com:twitter/algebird.git","clone_url":"https://github.com/twitter/algebird.git","svn_url":"https://github.com/twitter/algebird","homepage":"https://twitter.com/scalding","size":7857,"stargazers_count":966,"watchers_count":966,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":177,"mirror_url":null,"open_issues_count":96,"forks":177,"open_issues":96,"watchers":966,"default_branch":"develop"}},"base":{"label":"twitter:develop","ref":"develop","sha":"e9b925f5da67e77bda54b2d5c5233d5ff6506ba0","user":{"login":"twitter","id":50278,"avatar_url":"https://avatars.githubusercontent.com/u/50278?v=3","gravatar_id":"","url":"https://api.github.com/users/twitter","html_url":"https://github.com/twitter","followers_url":"https://api.github.com/users/twitter/followers","following_url":"https://api.github.com/users/twitter/following{/other_user}","gists_url":"https://api.github.com/users/twitter/gists{/gist_id}","starred_url":"https://api.github.com/users/twitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twitter/subscriptions","organizations_url":"https://api.github.com/users/twitter/orgs","repos_url":"https://api.github.com/users/twitter/repos","events_url":"https://api.github.com/users/twitter/events{/privacy}","received_events_url":"https://api.github.com/users/twitter/received_events","type":"Organization","site_admin":false},"repo":{"id":5275507,"name":"algebird","full_name":"twitter/algebird","owner":{"login":"twitter","id":50278,"avatar_url":"https://avatars.githubusercontent.com/u/50278?v=3","gravatar_id":"","url":"https://api.github.com/users/twitter","html_url":"https://github.com/twitter","followers_url":"https://api.github.com/users/twitter/followers","following_url":"https://api.github.com/users/twitter/following{/other_user}","gists_url":"https://api.github.com/users/twitter/gists{/gist_id}","starred_url":"https://api.github.com/users/twitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twitter/subscriptions","organizations_url":"https://api.github.com/users/twitter/orgs","repos_url":"https://api.github.com/users/twitter/repos","events_url":"https://api.github.com/users/twitter/events{/privacy}","received_events_url":"https://api.github.com/users/twitter/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/twitter/algebird","description":"Abstract Algebra for Scala","fork":false,"url":"https://api.github.com/repos/twitter/algebird","forks_url":"https://api.github.com/repos/twitter/algebird/forks","keys_url":"https://api.github.com/repos/twitter/algebird/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twitter/algebird/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twitter/algebird/teams","hooks_url":"https://api.github.com/repos/twitter/algebird/hooks","issue_events_url":"https://api.github.com/repos/twitter/algebird/issues/events{/number}","events_url":"https://api.github.com/repos/twitter/algebird/events","assignees_url":"https://api.github.com/repos/twitter/algebird/assignees{/user}","branches_url":"https://api.github.com/repos/twitter/algebird/branches{/branch}","tags_url":"https://api.github.com/repos/twitter/algebird/tags","blobs_url":"https://api.github.com/repos/twitter/algebird/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twitter/algebird/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twitter/algebird/git/refs{/sha}","trees_url":"https://api.github.com/repos/twitter/algebird/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twitter/algebird/statuses/{sha}","languages_url":"https://api.github.com/repos/twitter/algebird/languages","stargazers_url":"https://api.github.com/repos/twitter/algebird/stargazers","contributors_url":"https://api.github.com/repos/twitter/algebird/contributors","subscribers_url":"https://api.github.com/repos/twitter/algebird/subscribers","subscription_url":"https://api.github.com/repos/twitter/algebird/subscription","commits_url":"https://api.github.com/repos/twitter/algebird/commits{/sha}","git_commits_url":"https://api.github.com/repos/twitter/algebird/git/commits{/sha}","comments_url":"https://api.github.com/repos/twitter/algebird/comments{/number}","issue_comment_url":"https://api.github.com/repos/twitter/algebird/issues/comments{/number}","contents_url":"https://api.github.com/repos/twitter/algebird/contents/{+path}","compare_url":"https://api.github.com/repos/twitter/algebird/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twitter/algebird/merges","archive_url":"https://api.github.com/repos/twitter/algebird/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twitter/algebird/downloads","issues_url":"https://api.github.com/repos/twitter/algebird/issues{/number}","pulls_url":"https://api.github.com/repos/twitter/algebird/pulls{/number}","milestones_url":"https://api.github.com/repos/twitter/algebird/milestones{/number}","notifications_url":"https://api.github.com/repos/twitter/algebird/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twitter/algebird/labels{/name}","releases_url":"https://api.github.com/repos/twitter/algebird/releases{/id}","created_at":"2012-08-02T17:24:42Z","updated_at":"2015-08-04T23:21:05Z","pushed_at":"2015-08-05T01:41:08Z","git_url":"git://github.com/twitter/algebird.git","ssh_url":"git@github.com:twitter/algebird.git","clone_url":"https://github.com/twitter/algebird.git","svn_url":"https://github.com/twitter/algebird","homepage":"https://twitter.com/scalding","size":7857,"stargazers_count":966,"watchers_count":966,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":177,"mirror_url":null,"open_issues_count":96,"forks":177,"open_issues":96,"watchers":966,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/twitter/algebird/pulls/471"},"html":{"href":"https://github.com/twitter/algebird/pull/471"},"issue":{"href":"https://api.github.com/repos/twitter/algebird/issues/471"},"comments":{"href":"https://api.github.com/repos/twitter/algebird/issues/471/comments"},"review_comments":{"href":"https://api.github.com/repos/twitter/algebird/pulls/471/comments"},"review_comment":{"href":"https://api.github.com/repos/twitter/algebird/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/twitter/algebird/pulls/471/commits"},"statuses":{"href":"https://api.github.com/repos/twitter/algebird/statuses/75a7ad1564f14156411a6707453133cf4b94d732"}}}}