{"action":"created","comment":{"url":"https://api.github.com/repos/vmware/hillview/pulls/comments/197921376","pull_request_review_id":131753443,"id":197921376,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NzkyMTM3Ng==","diff_hunk":"@@ -0,0 +1,69 @@\n+package org.hillview.sketches;\n+\n+import it.unimi.dsi.fastutil.longs.Long2IntRBTreeMap;\n+import it.unimi.dsi.fastutil.longs.Long2ObjectRBTreeMap;\n+import org.hillview.table.api.IColumn;\n+\n+/**\n+ * A data structure that computes the minHash of table. It stores the row indices of the k rows that\n+ * hash to the minimum value (for some column to which the hash is applied). We assume no collisions\n+ * in the hash function.Finally, we will replace the row indices by the values of the column at\n+ * those indices. This structure is used to iterate over the table (and avoid boxing/unboxing).\n+ */\n+public class MinKRows {\n+    /**\n+     * The parameter k in min k hash values.\n+     */\n+    public final int maxSize;\n+    /**\n+     * The actual number, which can be smaller if there are fewer distinct keys.\n+     */\n+    public int curSize;\n+    /**\n+     * The largest hash value currently in the min k.\n+     */\n+    public long cutoff;\n+    /**\n+     * A hashmap consisting of <hashValue, rowIndex> pairs.\n+     */\n+    public Long2IntRBTreeMap treeMap;\n+\n+    public MinKRows(final int maxSize) {\n+        this.maxSize = maxSize;\n+        this.treeMap = new Long2IntRBTreeMap();\n+        this.curSize = 0;\n+        this.cutoff = 0;\n+    }\n+\n+    public void push(long hashKey, int row) {\n+        if (this.curSize == 0) {\n+            this.treeMap.put(hashKey, row);\n+            this.cutoff = hashKey;\n+            this.curSize += 1;\n+        }\n+        if (!treeMap.containsKey(hashKey)) { //Does not have it already\n+            if (hashKey < this.cutoff) {  //It is below cutoff\n+                this.treeMap.put(hashKey, row);\n+                if (this.curSize == this.maxSize) {\n+                    this.treeMap.remove(this.cutoff);\n+                    this.cutoff = this.treeMap.lastLongKey();\n+                } else\n+                    this.curSize += 1;\n+            } else { // we ignore hash collisions.\n+                if (this.curSize < this.maxSize) {\n+                    this.curSize += 1;\n+                    this.treeMap.put(hashKey, row);\n+                    this.cutoff = hashKey;\n+                }\n+            }\n+        }\n+    }\n+\n+    public MinKSet getMinKSet(IColumn iCol) {","path":"platform/src/main/java/org/hillview/sketches/MinKRows.java","position":62,"original_position":62,"commit_id":"4a2f9d0f6d9bc9d7629ce50c6b4a53b2b1c6d1a0","original_commit_id":"4a2f9d0f6d9bc9d7629ce50c6b4a53b2b1c6d1a0","user":{"login":"mbudiu-vmw","id":19397042,"node_id":"MDQ6VXNlcjE5Mzk3MDQy","avatar_url":"https://avatars1.githubusercontent.com/u/19397042?v=4","gravatar_id":"","url":"https://api.github.com/users/mbudiu-vmw","html_url":"https://github.com/mbudiu-vmw","followers_url":"https://api.github.com/users/mbudiu-vmw/followers","following_url":"https://api.github.com/users/mbudiu-vmw/following{/other_user}","gists_url":"https://api.github.com/users/mbudiu-vmw/gists{/gist_id}","starred_url":"https://api.github.com/users/mbudiu-vmw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbudiu-vmw/subscriptions","organizations_url":"https://api.github.com/users/mbudiu-vmw/orgs","repos_url":"https://api.github.com/users/mbudiu-vmw/repos","events_url":"https://api.github.com/users/mbudiu-vmw/events{/privacy}","received_events_url":"https://api.github.com/users/mbudiu-vmw/received_events","type":"User","site_admin":false},"body":"If the class is generic then this should take a `Function<Integer, T>` as an argument instead of a column.","created_at":"2018-06-25T19:53:13Z","updated_at":"2018-06-25T20:04:12Z","html_url":"https://github.com/vmware/hillview/pull/362#discussion_r197921376","pull_request_url":"https://api.github.com/repos/vmware/hillview/pulls/362","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/vmware/hillview/pulls/comments/197921376"},"html":{"href":"https://github.com/vmware/hillview/pull/362#discussion_r197921376"},"pull_request":{"href":"https://api.github.com/repos/vmware/hillview/pulls/362"}}},"pull_request":{"url":"https://api.github.com/repos/vmware/hillview/pulls/362","id":196870560,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2ODcwNTYw","html_url":"https://github.com/vmware/hillview/pull/362","diff_url":"https://github.com/vmware/hillview/pull/362.diff","patch_url":"https://github.com/vmware/hillview/pull/362.patch","issue_url":"https://api.github.com/repos/vmware/hillview/issues/362","number":362,"state":"open","locked":false,"title":"L0 Sampling via MinWise Hashing","user":{"login":"parikg","id":22647534,"node_id":"MDQ6VXNlcjIyNjQ3NTM0","avatar_url":"https://avatars1.githubusercontent.com/u/22647534?v=4","gravatar_id":"","url":"https://api.github.com/users/parikg","html_url":"https://github.com/parikg","followers_url":"https://api.github.com/users/parikg/followers","following_url":"https://api.github.com/users/parikg/following{/other_user}","gists_url":"https://api.github.com/users/parikg/gists{/gist_id}","starred_url":"https://api.github.com/users/parikg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parikg/subscriptions","organizations_url":"https://api.github.com/users/parikg/orgs","repos_url":"https://api.github.com/users/parikg/repos","events_url":"https://api.github.com/users/parikg/events{/privacy}","received_events_url":"https://api.github.com/users/parikg/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-06-23T00:31:29Z","updated_at":"2018-06-25T20:04:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"46b1cea0f31253accd46ffc2cf4f9dece32c5e2a","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":656548839,"node_id":"MDU6TGFiZWw2NTY1NDg4Mzk=","url":"https://api.github.com/repos/vmware/hillview/labels/cla-not-required","name":"cla-not-required","color":"159818","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/vmware/hillview/pulls/362/commits","review_comments_url":"https://api.github.com/repos/vmware/hillview/pulls/362/comments","review_comment_url":"https://api.github.com/repos/vmware/hillview/pulls/comments{/number}","comments_url":"https://api.github.com/repos/vmware/hillview/issues/362/comments","statuses_url":"https://api.github.com/repos/vmware/hillview/statuses/4a2f9d0f6d9bc9d7629ce50c6b4a53b2b1c6d1a0","head":{"label":"parikg:minhashing","ref":"minhashing","sha":"4a2f9d0f6d9bc9d7629ce50c6b4a53b2b1c6d1a0","user":{"login":"parikg","id":22647534,"node_id":"MDQ6VXNlcjIyNjQ3NTM0","avatar_url":"https://avatars1.githubusercontent.com/u/22647534?v=4","gravatar_id":"","url":"https://api.github.com/users/parikg","html_url":"https://github.com/parikg","followers_url":"https://api.github.com/users/parikg/followers","following_url":"https://api.github.com/users/parikg/following{/other_user}","gists_url":"https://api.github.com/users/parikg/gists{/gist_id}","starred_url":"https://api.github.com/users/parikg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parikg/subscriptions","organizations_url":"https://api.github.com/users/parikg/orgs","repos_url":"https://api.github.com/users/parikg/repos","events_url":"https://api.github.com/users/parikg/events{/privacy}","received_events_url":"https://api.github.com/users/parikg/received_events","type":"User","site_admin":false},"repo":{"id":70101919,"node_id":"MDEwOlJlcG9zaXRvcnk3MDEwMTkxOQ==","name":"hiero","full_name":"parikg/hiero","owner":{"login":"parikg","id":22647534,"node_id":"MDQ6VXNlcjIyNjQ3NTM0","avatar_url":"https://avatars1.githubusercontent.com/u/22647534?v=4","gravatar_id":"","url":"https://api.github.com/users/parikg","html_url":"https://github.com/parikg","followers_url":"https://api.github.com/users/parikg/followers","following_url":"https://api.github.com/users/parikg/following{/other_user}","gists_url":"https://api.github.com/users/parikg/gists{/gist_id}","starred_url":"https://api.github.com/users/parikg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parikg/subscriptions","organizations_url":"https://api.github.com/users/parikg/orgs","repos_url":"https://api.github.com/users/parikg/repos","events_url":"https://api.github.com/users/parikg/events{/privacy}","received_events_url":"https://api.github.com/users/parikg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/parikg/hiero","description":"Big data spreadsheet","fork":true,"url":"https://api.github.com/repos/parikg/hiero","forks_url":"https://api.github.com/repos/parikg/hiero/forks","keys_url":"https://api.github.com/repos/parikg/hiero/keys{/key_id}","collaborators_url":"https://api.github.com/repos/parikg/hiero/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/parikg/hiero/teams","hooks_url":"https://api.github.com/repos/parikg/hiero/hooks","issue_events_url":"https://api.github.com/repos/parikg/hiero/issues/events{/number}","events_url":"https://api.github.com/repos/parikg/hiero/events","assignees_url":"https://api.github.com/repos/parikg/hiero/assignees{/user}","branches_url":"https://api.github.com/repos/parikg/hiero/branches{/branch}","tags_url":"https://api.github.com/repos/parikg/hiero/tags","blobs_url":"https://api.github.com/repos/parikg/hiero/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/parikg/hiero/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/parikg/hiero/git/refs{/sha}","trees_url":"https://api.github.com/repos/parikg/hiero/git/trees{/sha}","statuses_url":"https://api.github.com/repos/parikg/hiero/statuses/{sha}","languages_url":"https://api.github.com/repos/parikg/hiero/languages","stargazers_url":"https://api.github.com/repos/parikg/hiero/stargazers","contributors_url":"https://api.github.com/repos/parikg/hiero/contributors","subscribers_url":"https://api.github.com/repos/parikg/hiero/subscribers","subscription_url":"https://api.github.com/repos/parikg/hiero/subscription","commits_url":"https://api.github.com/repos/parikg/hiero/commits{/sha}","git_commits_url":"https://api.github.com/repos/parikg/hiero/git/commits{/sha}","comments_url":"https://api.github.com/repos/parikg/hiero/comments{/number}","issue_comment_url":"https://api.github.com/repos/parikg/hiero/issues/comments{/number}","contents_url":"https://api.github.com/repos/parikg/hiero/contents/{+path}","compare_url":"https://api.github.com/repos/parikg/hiero/compare/{base}...{head}","merges_url":"https://api.github.com/repos/parikg/hiero/merges","archive_url":"https://api.github.com/repos/parikg/hiero/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/parikg/hiero/downloads","issues_url":"https://api.github.com/repos/parikg/hiero/issues{/number}","pulls_url":"https://api.github.com/repos/parikg/hiero/pulls{/number}","milestones_url":"https://api.github.com/repos/parikg/hiero/milestones{/number}","notifications_url":"https://api.github.com/repos/parikg/hiero/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/parikg/hiero/labels{/name}","releases_url":"https://api.github.com/repos/parikg/hiero/releases{/id}","deployments_url":"https://api.github.com/repos/parikg/hiero/deployments","created_at":"2016-10-05T21:45:45Z","updated_at":"2017-01-06T00:13:20Z","pushed_at":"2018-06-23T00:29:23Z","git_url":"git://github.com/parikg/hiero.git","ssh_url":"git@github.com:parikg/hiero.git","clone_url":"https://github.com/parikg/hiero.git","svn_url":"https://github.com/parikg/hiero","homepage":null,"size":7086,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"vmware:master","ref":"master","sha":"b200c9d1ef69b2999dcb38638b2ee29ad5652d91","user":{"login":"vmware","id":473334,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzMzNA==","avatar_url":"https://avatars0.githubusercontent.com/u/473334?v=4","gravatar_id":"","url":"https://api.github.com/users/vmware","html_url":"https://github.com/vmware","followers_url":"https://api.github.com/users/vmware/followers","following_url":"https://api.github.com/users/vmware/following{/other_user}","gists_url":"https://api.github.com/users/vmware/gists{/gist_id}","starred_url":"https://api.github.com/users/vmware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmware/subscriptions","organizations_url":"https://api.github.com/users/vmware/orgs","repos_url":"https://api.github.com/users/vmware/repos","events_url":"https://api.github.com/users/vmware/events{/privacy}","received_events_url":"https://api.github.com/users/vmware/received_events","type":"Organization","site_admin":false},"repo":{"id":69908551,"node_id":"MDEwOlJlcG9zaXRvcnk2OTkwODU1MQ==","name":"hillview","full_name":"vmware/hillview","owner":{"login":"vmware","id":473334,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ3MzMzNA==","avatar_url":"https://avatars0.githubusercontent.com/u/473334?v=4","gravatar_id":"","url":"https://api.github.com/users/vmware","html_url":"https://github.com/vmware","followers_url":"https://api.github.com/users/vmware/followers","following_url":"https://api.github.com/users/vmware/following{/other_user}","gists_url":"https://api.github.com/users/vmware/gists{/gist_id}","starred_url":"https://api.github.com/users/vmware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vmware/subscriptions","organizations_url":"https://api.github.com/users/vmware/orgs","repos_url":"https://api.github.com/users/vmware/repos","events_url":"https://api.github.com/users/vmware/events{/privacy}","received_events_url":"https://api.github.com/users/vmware/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vmware/hillview","description":"Big data spreadsheet","fork":false,"url":"https://api.github.com/repos/vmware/hillview","forks_url":"https://api.github.com/repos/vmware/hillview/forks","keys_url":"https://api.github.com/repos/vmware/hillview/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vmware/hillview/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vmware/hillview/teams","hooks_url":"https://api.github.com/repos/vmware/hillview/hooks","issue_events_url":"https://api.github.com/repos/vmware/hillview/issues/events{/number}","events_url":"https://api.github.com/repos/vmware/hillview/events","assignees_url":"https://api.github.com/repos/vmware/hillview/assignees{/user}","branches_url":"https://api.github.com/repos/vmware/hillview/branches{/branch}","tags_url":"https://api.github.com/repos/vmware/hillview/tags","blobs_url":"https://api.github.com/repos/vmware/hillview/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vmware/hillview/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vmware/hillview/git/refs{/sha}","trees_url":"https://api.github.com/repos/vmware/hillview/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vmware/hillview/statuses/{sha}","languages_url":"https://api.github.com/repos/vmware/hillview/languages","stargazers_url":"https://api.github.com/repos/vmware/hillview/stargazers","contributors_url":"https://api.github.com/repos/vmware/hillview/contributors","subscribers_url":"https://api.github.com/repos/vmware/hillview/subscribers","subscription_url":"https://api.github.com/repos/vmware/hillview/subscription","commits_url":"https://api.github.com/repos/vmware/hillview/commits{/sha}","git_commits_url":"https://api.github.com/repos/vmware/hillview/git/commits{/sha}","comments_url":"https://api.github.com/repos/vmware/hillview/comments{/number}","issue_comment_url":"https://api.github.com/repos/vmware/hillview/issues/comments{/number}","contents_url":"https://api.github.com/repos/vmware/hillview/contents/{+path}","compare_url":"https://api.github.com/repos/vmware/hillview/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vmware/hillview/merges","archive_url":"https://api.github.com/repos/vmware/hillview/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vmware/hillview/downloads","issues_url":"https://api.github.com/repos/vmware/hillview/issues{/number}","pulls_url":"https://api.github.com/repos/vmware/hillview/pulls{/number}","milestones_url":"https://api.github.com/repos/vmware/hillview/milestones{/number}","notifications_url":"https://api.github.com/repos/vmware/hillview/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vmware/hillview/labels{/name}","releases_url":"https://api.github.com/repos/vmware/hillview/releases{/id}","deployments_url":"https://api.github.com/repos/vmware/hillview/deployments","created_at":"2016-10-03T20:32:15Z","updated_at":"2018-06-23T01:04:45Z","pushed_at":"2018-06-23T01:04:44Z","git_url":"git://github.com/vmware/hillview.git","ssh_url":"git@github.com:vmware/hillview.git","clone_url":"https://github.com/vmware/hillview.git","svn_url":"https://github.com/vmware/hillview","homepage":null,"size":7031,"stargazers_count":30,"watchers_count":30,"language":"Java","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":45,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":8,"open_issues":45,"watchers":30,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vmware/hillview/pulls/362"},"html":{"href":"https://github.com/vmware/hillview/pull/362"},"issue":{"href":"https://api.github.com/repos/vmware/hillview/issues/362"},"comments":{"href":"https://api.github.com/repos/vmware/hillview/issues/362/comments"},"review_comments":{"href":"https://api.github.com/repos/vmware/hillview/pulls/362/comments"},"review_comment":{"href":"https://api.github.com/repos/vmware/hillview/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/vmware/hillview/pulls/362/commits"},"statuses":{"href":"https://api.github.com/repos/vmware/hillview/statuses/4a2f9d0f6d9bc9d7629ce50c6b4a53b2b1c6d1a0"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"mbudiu-vmw"}}