{"action":"created","comment":{"url":"https://api.github.com/repos/druid-io/druid/pulls/comments/56079330","id":56079330,"diff_hunk":"@@ -0,0 +1,42 @@\n+/*\n+ * Licensed to Metamarkets Group Inc. (Metamarkets) under one\n+ * or more contributor license agreements. See the NOTICE file\n+ * distributed with this work for additional information\n+ * regarding copyright ownership. Metamarkets licenses this file\n+ * to you under the Apache License, Version 2.0 (the\n+ * \"License\"); you may not use this file except in compliance\n+ * with the License. You may obtain a copy of the License at\n+ *\n+ * http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing,\n+ * software distributed under the License is distributed on an\n+ * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n+ * KIND, either express or implied. See the License for the\n+ * specific language governing permissions and limitations\n+ * under the License.\n+ */\n+\n+package io.druid.query.aggregation.distinctcount;\n+\n+import com.fasterxml.jackson.annotation.JsonSubTypes;\n+import com.fasterxml.jackson.annotation.JsonTypeInfo;\n+import com.metamx.collections.bitmap.MutableBitmap;\n+\n+/**\n+ */\n+@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = \"type\", defaultImpl = RoaringBitMapFactory.class)\n+@JsonSubTypes(value = {\n+    @JsonSubTypes.Type(name = \"java\", value = JavaBitMapFactory.class),\n+    @JsonSubTypes.Type(name = \"concise\", value = ConciseBitMapFactory.class),\n+    @JsonSubTypes.Type(name = \"roaring\", value = RoaringBitMapFactory.class)\n+})\n+public interface BitMapFactory\n+{\n+  /**\n+   * Create a new empty bitmap\n+   *\n+   * @return the new bitmap\n+   */\n+  public MutableBitmap makeEmptyMutableBitmap();","path":"extensions/distinctcount/src/main/java/io/druid/query/aggregation/distinctcount/BitMapFactory.java","position":41,"original_position":41,"commit_id":"53b5345db91ffef94084d3c28fcd70e6035a6ee3","original_commit_id":"53b5345db91ffef94084d3c28fcd70e6035a6ee3","user":{"login":"fjy","id":428325,"avatar_url":"https://avatars.githubusercontent.com/u/428325?v=3","gravatar_id":"","url":"https://api.github.com/users/fjy","html_url":"https://github.com/fjy","followers_url":"https://api.github.com/users/fjy/followers","following_url":"https://api.github.com/users/fjy/following{/other_user}","gists_url":"https://api.github.com/users/fjy/gists{/gist_id}","starred_url":"https://api.github.com/users/fjy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fjy/subscriptions","organizations_url":"https://api.github.com/users/fjy/orgs","repos_url":"https://api.github.com/users/fjy/repos","events_url":"https://api.github.com/users/fjy/events{/privacy}","received_events_url":"https://api.github.com/users/fjy/received_events","type":"User","site_admin":false},"body":"why not use the factory in Bytebuffer collections?","created_at":"2016-03-14T21:28:30Z","updated_at":"2016-03-14T21:28:30Z","html_url":"https://github.com/druid-io/druid/pull/2602#discussion_r56079330","pull_request_url":"https://api.github.com/repos/druid-io/druid/pulls/2602","_links":{"self":{"href":"https://api.github.com/repos/druid-io/druid/pulls/comments/56079330"},"html":{"href":"https://github.com/druid-io/druid/pull/2602#discussion_r56079330"},"pull_request":{"href":"https://api.github.com/repos/druid-io/druid/pulls/2602"}}},"pull_request":{"url":"https://api.github.com/repos/druid-io/druid/pulls/2602","id":61882060,"html_url":"https://github.com/druid-io/druid/pull/2602","diff_url":"https://github.com/druid-io/druid/pull/2602.diff","patch_url":"https://github.com/druid-io/druid/pull/2602.patch","issue_url":"https://api.github.com/repos/druid-io/druid/issues/2602","number":2602,"state":"open","locked":false,"title":"implement distinctcount","user":{"login":"binlijin","id":1531353,"avatar_url":"https://avatars.githubusercontent.com/u/1531353?v=3","gravatar_id":"","url":"https://api.github.com/users/binlijin","html_url":"https://github.com/binlijin","followers_url":"https://api.github.com/users/binlijin/followers","following_url":"https://api.github.com/users/binlijin/following{/other_user}","gists_url":"https://api.github.com/users/binlijin/gists{/gist_id}","starred_url":"https://api.github.com/users/binlijin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binlijin/subscriptions","organizations_url":"https://api.github.com/users/binlijin/orgs","repos_url":"https://api.github.com/users/binlijin/repos","events_url":"https://api.github.com/users/binlijin/events{/privacy}","received_events_url":"https://api.github.com/users/binlijin/received_events","type":"User","site_admin":false},"body":"Discuss at https://groups.google.com/forum/#!topic/druid-development/GXRpXfBzfJs\r\n(1) First use https://github.com/druid-io/druid/pull/2570 to partition data by visitor_id.\r\n(2) Second use distinctcount to calculate exact UV.\r\nThere is some limitations, when use with groupBy, the groupBy keys' numbers should not exceed maxIntermediateRows in every segment, if exceed the result will wrong. And when use with topN, numValuesPerPass should not too big, if too big the distinctcount will use many memory and cause the JVM out of service.","created_at":"2016-03-07T07:37:51Z","updated_at":"2016-03-14T21:28:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bb395b80f3f5677b3861ce2ecfebe1c82ba5882a","assignee":null,"milestone":{"url":"https://api.github.com/repos/druid-io/druid/milestones/20","html_url":"https://github.com/druid-io/druid/milestones/0.9.2","labels_url":"https://api.github.com/repos/druid-io/druid/milestones/20/labels","id":1571409,"number":20,"title":"0.9.2","description":"","creator":{"login":"fjy","id":428325,"avatar_url":"https://avatars.githubusercontent.com/u/428325?v=3","gravatar_id":"","url":"https://api.github.com/users/fjy","html_url":"https://github.com/fjy","followers_url":"https://api.github.com/users/fjy/followers","following_url":"https://api.github.com/users/fjy/following{/other_user}","gists_url":"https://api.github.com/users/fjy/gists{/gist_id}","starred_url":"https://api.github.com/users/fjy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fjy/subscriptions","organizations_url":"https://api.github.com/users/fjy/orgs","repos_url":"https://api.github.com/users/fjy/repos","events_url":"https://api.github.com/users/fjy/events{/privacy}","received_events_url":"https://api.github.com/users/fjy/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":2,"state":"open","created_at":"2016-02-08T22:01:21Z","updated_at":"2016-03-14T20:33:08Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/druid-io/druid/pulls/2602/commits","review_comments_url":"https://api.github.com/repos/druid-io/druid/pulls/2602/comments","review_comment_url":"https://api.github.com/repos/druid-io/druid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/druid-io/druid/issues/2602/comments","statuses_url":"https://api.github.com/repos/druid-io/druid/statuses/53b5345db91ffef94084d3c28fcd70e6035a6ee3","head":{"label":"binlijin:distinctcount","ref":"distinctcount","sha":"53b5345db91ffef94084d3c28fcd70e6035a6ee3","user":{"login":"binlijin","id":1531353,"avatar_url":"https://avatars.githubusercontent.com/u/1531353?v=3","gravatar_id":"","url":"https://api.github.com/users/binlijin","html_url":"https://github.com/binlijin","followers_url":"https://api.github.com/users/binlijin/followers","following_url":"https://api.github.com/users/binlijin/following{/other_user}","gists_url":"https://api.github.com/users/binlijin/gists{/gist_id}","starred_url":"https://api.github.com/users/binlijin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binlijin/subscriptions","organizations_url":"https://api.github.com/users/binlijin/orgs","repos_url":"https://api.github.com/users/binlijin/repos","events_url":"https://api.github.com/users/binlijin/events{/privacy}","received_events_url":"https://api.github.com/users/binlijin/received_events","type":"User","site_admin":false},"repo":{"id":45811047,"name":"druid","full_name":"binlijin/druid","owner":{"login":"binlijin","id":1531353,"avatar_url":"https://avatars.githubusercontent.com/u/1531353?v=3","gravatar_id":"","url":"https://api.github.com/users/binlijin","html_url":"https://github.com/binlijin","followers_url":"https://api.github.com/users/binlijin/followers","following_url":"https://api.github.com/users/binlijin/following{/other_user}","gists_url":"https://api.github.com/users/binlijin/gists{/gist_id}","starred_url":"https://api.github.com/users/binlijin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/binlijin/subscriptions","organizations_url":"https://api.github.com/users/binlijin/orgs","repos_url":"https://api.github.com/users/binlijin/repos","events_url":"https://api.github.com/users/binlijin/events{/privacy}","received_events_url":"https://api.github.com/users/binlijin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/binlijin/druid","description":"Column oriented distributed data store ideal for powering interactive applications","fork":true,"url":"https://api.github.com/repos/binlijin/druid","forks_url":"https://api.github.com/repos/binlijin/druid/forks","keys_url":"https://api.github.com/repos/binlijin/druid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/binlijin/druid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/binlijin/druid/teams","hooks_url":"https://api.github.com/repos/binlijin/druid/hooks","issue_events_url":"https://api.github.com/repos/binlijin/druid/issues/events{/number}","events_url":"https://api.github.com/repos/binlijin/druid/events","assignees_url":"https://api.github.com/repos/binlijin/druid/assignees{/user}","branches_url":"https://api.github.com/repos/binlijin/druid/branches{/branch}","tags_url":"https://api.github.com/repos/binlijin/druid/tags","blobs_url":"https://api.github.com/repos/binlijin/druid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/binlijin/druid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/binlijin/druid/git/refs{/sha}","trees_url":"https://api.github.com/repos/binlijin/druid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/binlijin/druid/statuses/{sha}","languages_url":"https://api.github.com/repos/binlijin/druid/languages","stargazers_url":"https://api.github.com/repos/binlijin/druid/stargazers","contributors_url":"https://api.github.com/repos/binlijin/druid/contributors","subscribers_url":"https://api.github.com/repos/binlijin/druid/subscribers","subscription_url":"https://api.github.com/repos/binlijin/druid/subscription","commits_url":"https://api.github.com/repos/binlijin/druid/commits{/sha}","git_commits_url":"https://api.github.com/repos/binlijin/druid/git/commits{/sha}","comments_url":"https://api.github.com/repos/binlijin/druid/comments{/number}","issue_comment_url":"https://api.github.com/repos/binlijin/druid/issues/comments{/number}","contents_url":"https://api.github.com/repos/binlijin/druid/contents/{+path}","compare_url":"https://api.github.com/repos/binlijin/druid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/binlijin/druid/merges","archive_url":"https://api.github.com/repos/binlijin/druid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/binlijin/druid/downloads","issues_url":"https://api.github.com/repos/binlijin/druid/issues{/number}","pulls_url":"https://api.github.com/repos/binlijin/druid/pulls{/number}","milestones_url":"https://api.github.com/repos/binlijin/druid/milestones{/number}","notifications_url":"https://api.github.com/repos/binlijin/druid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/binlijin/druid/labels{/name}","releases_url":"https://api.github.com/repos/binlijin/druid/releases{/id}","deployments_url":"https://api.github.com/repos/binlijin/druid/deployments","created_at":"2015-11-09T02:48:36Z","updated_at":"2016-01-14T02:57:00Z","pushed_at":"2016-03-13T01:45:35Z","git_url":"git://github.com/binlijin/druid.git","ssh_url":"git@github.com:binlijin/druid.git","clone_url":"https://github.com/binlijin/druid.git","svn_url":"https://github.com/binlijin/druid","homepage":"http://druid.io","size":103702,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"druid-io:master","ref":"master","sha":"4fa08a13291949f9b2b98cee8300e6b38e376695","user":{"login":"druid-io","id":4203474,"avatar_url":"https://avatars.githubusercontent.com/u/4203474?v=3","gravatar_id":"","url":"https://api.github.com/users/druid-io","html_url":"https://github.com/druid-io","followers_url":"https://api.github.com/users/druid-io/followers","following_url":"https://api.github.com/users/druid-io/following{/other_user}","gists_url":"https://api.github.com/users/druid-io/gists{/gist_id}","starred_url":"https://api.github.com/users/druid-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/druid-io/subscriptions","organizations_url":"https://api.github.com/users/druid-io/orgs","repos_url":"https://api.github.com/users/druid-io/repos","events_url":"https://api.github.com/users/druid-io/events{/privacy}","received_events_url":"https://api.github.com/users/druid-io/received_events","type":"Organization","site_admin":false},"repo":{"id":6358188,"name":"druid","full_name":"druid-io/druid","owner":{"login":"druid-io","id":4203474,"avatar_url":"https://avatars.githubusercontent.com/u/4203474?v=3","gravatar_id":"","url":"https://api.github.com/users/druid-io","html_url":"https://github.com/druid-io","followers_url":"https://api.github.com/users/druid-io/followers","following_url":"https://api.github.com/users/druid-io/following{/other_user}","gists_url":"https://api.github.com/users/druid-io/gists{/gist_id}","starred_url":"https://api.github.com/users/druid-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/druid-io/subscriptions","organizations_url":"https://api.github.com/users/druid-io/orgs","repos_url":"https://api.github.com/users/druid-io/repos","events_url":"https://api.github.com/users/druid-io/events{/privacy}","received_events_url":"https://api.github.com/users/druid-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/druid-io/druid","description":"Column oriented distributed data store ideal for powering interactive applications","fork":false,"url":"https://api.github.com/repos/druid-io/druid","forks_url":"https://api.github.com/repos/druid-io/druid/forks","keys_url":"https://api.github.com/repos/druid-io/druid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/druid-io/druid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/druid-io/druid/teams","hooks_url":"https://api.github.com/repos/druid-io/druid/hooks","issue_events_url":"https://api.github.com/repos/druid-io/druid/issues/events{/number}","events_url":"https://api.github.com/repos/druid-io/druid/events","assignees_url":"https://api.github.com/repos/druid-io/druid/assignees{/user}","branches_url":"https://api.github.com/repos/druid-io/druid/branches{/branch}","tags_url":"https://api.github.com/repos/druid-io/druid/tags","blobs_url":"https://api.github.com/repos/druid-io/druid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/druid-io/druid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/druid-io/druid/git/refs{/sha}","trees_url":"https://api.github.com/repos/druid-io/druid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/druid-io/druid/statuses/{sha}","languages_url":"https://api.github.com/repos/druid-io/druid/languages","stargazers_url":"https://api.github.com/repos/druid-io/druid/stargazers","contributors_url":"https://api.github.com/repos/druid-io/druid/contributors","subscribers_url":"https://api.github.com/repos/druid-io/druid/subscribers","subscription_url":"https://api.github.com/repos/druid-io/druid/subscription","commits_url":"https://api.github.com/repos/druid-io/druid/commits{/sha}","git_commits_url":"https://api.github.com/repos/druid-io/druid/git/commits{/sha}","comments_url":"https://api.github.com/repos/druid-io/druid/comments{/number}","issue_comment_url":"https://api.github.com/repos/druid-io/druid/issues/comments{/number}","contents_url":"https://api.github.com/repos/druid-io/druid/contents/{+path}","compare_url":"https://api.github.com/repos/druid-io/druid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/druid-io/druid/merges","archive_url":"https://api.github.com/repos/druid-io/druid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/druid-io/druid/downloads","issues_url":"https://api.github.com/repos/druid-io/druid/issues{/number}","pulls_url":"https://api.github.com/repos/druid-io/druid/pulls{/number}","milestones_url":"https://api.github.com/repos/druid-io/druid/milestones{/number}","notifications_url":"https://api.github.com/repos/druid-io/druid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/druid-io/druid/labels{/name}","releases_url":"https://api.github.com/repos/druid-io/druid/releases{/id}","deployments_url":"https://api.github.com/repos/druid-io/druid/deployments","created_at":"2012-10-23T19:08:07Z","updated_at":"2016-03-14T09:37:36Z","pushed_at":"2016-03-14T21:15:52Z","git_url":"git://github.com/druid-io/druid.git","ssh_url":"git@github.com:druid-io/druid.git","clone_url":"https://github.com/druid-io/druid.git","svn_url":"https://github.com/druid-io/druid","homepage":"http://druid.io","size":127415,"stargazers_count":2538,"watchers_count":2538,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":608,"mirror_url":null,"open_issues_count":361,"forks":608,"open_issues":361,"watchers":2538,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/druid-io/druid/pulls/2602"},"html":{"href":"https://github.com/druid-io/druid/pull/2602"},"issue":{"href":"https://api.github.com/repos/druid-io/druid/issues/2602"},"comments":{"href":"https://api.github.com/repos/druid-io/druid/issues/2602/comments"},"review_comments":{"href":"https://api.github.com/repos/druid-io/druid/pulls/2602/comments"},"review_comment":{"href":"https://api.github.com/repos/druid-io/druid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/druid-io/druid/pulls/2602/commits"},"statuses":{"href":"https://api.github.com/repos/druid-io/druid/statuses/53b5345db91ffef94084d3c28fcd70e6035a6ee3"}}}}