{"action":"created","comment":{"url":"https://api.github.com/repos/mbudiu-vmw/hiero/pulls/comments/84727295","pull_request_review_id":5484871,"id":84727295,"diff_hunk":"@@ -0,0 +1,103 @@\n+package org.hiero.sketch.table;\n+\n+import org.hiero.sketch.table.api.IMembershipSet;\n+import org.hiero.sketch.table.api.IRowIterator;\n+import org.scalactic.exceptions.NullArgumentException;\n+\n+import java.util.*;\n+import java.util.function.Predicate;\n+\n+\n+/**\n+ * Created by uwieder on 10/20/16.\n+ *\n+ * This implementation uses a full membership data structure plus a list of filter functions that are used for the isMemeber and for the iterator functions. Upside is that construction is quick, adding a filter function is quick.\n+ * The downside is that the isMemeber can take a long time if there are many filters, and iterator takes a long time if it's sparse. Also, each first call for  getSize after a new filter is a linear scan.\n+ *\n+ * TODO: Complete the getSize member.\n+ */\n+public class PartialMembershipDense implements IMembershipSet {\n+\n+    private IMembershipSet baseMap;\n+    private int rowCount;\n+    private boolean rowCountCorrect;\n+    private Predicate<Integer> filter;\n+\n+    /* class is instantiated by supplying a memshipSet (perhaps the full one), and a filter function. If a filter is not supplied it is defaulted to be true */\n+\n+    public PartialMembershipDense(IMembershipSet baseMap) throws NullArgumentException{\n+        if (baseMap == null) throw new NullArgumentException(\"PartialMembershipDense cannot be instantiated without a base MembershipSet\");\n+        this.baseMap = baseMap;\n+        this.rowCount = baseMap.getSize();\n+        this.filter = Integer -> {return true;};\n+        this.rowCountCorrect = false;\n+    }\n+\n+    public PartialMembershipDense(IMembershipSet baseMap, Predicate<Integer> filter) throws NullArgumentException{\n+        if (baseMap == null) throw new NullArgumentException(\"PartialMembershipDense cannot be instantiated without a base MembershipSet\");\n+        this.baseMap = baseMap;\n+        this.rowCount = baseMap.getSize();\n+        if (filter == null)\n+            filter = Integer -> true;\n+        this.filter = filter;\n+        this.rowCountCorrect = false;\n+    }\n+\n+    @Override\n+    public boolean isMember(int rowIndex) {\n+        return (baseMap.isMember(rowIndex) && filter.test(rowIndex));\n+    }\n+\n+\n+    @Override\n+    public int getSize() {\n+\n+        if (rowCountCorrect)\n+            return this.rowCount;\n+        else //TODO get the iterator from baseMap and iterate trhough all items checking the filter and applying the size.\n+        {\n+            int counter = 0;\n+            IRowIterator IT = this.baseMap.getIterator();\n+            int tmp = IT.getNextRow();\n+            while (tmp>=0){","path":"src/main/java/org/hiero/sketch/table/PartialMembershipDense.java","position":62,"original_position":62,"commit_id":"ceab38a6e3e05d6ba8ceaf8f32ecdd74f1900382","original_commit_id":"ceab38a6e3e05d6ba8ceaf8f32ecdd74f1900382","user":{"login":"mbudiu-vmw","id":19397042,"avatar_url":"https://avatars.githubusercontent.com/u/19397042?v=3","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":"while (tmp >= 0) {","created_at":"2016-10-24T16:29:18Z","updated_at":"2016-10-24T16:29:18Z","html_url":"https://github.com/mbudiu-vmw/hiero/pull/11#discussion_r84727295","pull_request_url":"https://api.github.com/repos/mbudiu-vmw/hiero/pulls/11","_links":{"self":{"href":"https://api.github.com/repos/mbudiu-vmw/hiero/pulls/comments/84727295"},"html":{"href":"https://github.com/mbudiu-vmw/hiero/pull/11#discussion_r84727295"},"pull_request":{"href":"https://api.github.com/repos/mbudiu-vmw/hiero/pulls/11"}}},"pull_request":{"url":"https://api.github.com/repos/mbudiu-vmw/hiero/pulls/11","id":90643018,"html_url":"https://github.com/mbudiu-vmw/hiero/pull/11","diff_url":"https://github.com/mbudiu-vmw/hiero/pull/11.diff","patch_url":"https://github.com/mbudiu-vmw/hiero/pull/11.patch","issue_url":"https://api.github.com/repos/mbudiu-vmw/hiero/issues/11","number":11,"state":"open","locked":false,"title":"PartialMembership","user":{"login":"uwieder","id":19557712,"avatar_url":"https://avatars.githubusercontent.com/u/19557712?v=3","gravatar_id":"","url":"https://api.github.com/users/uwieder","html_url":"https://github.com/uwieder","followers_url":"https://api.github.com/users/uwieder/followers","following_url":"https://api.github.com/users/uwieder/following{/other_user}","gists_url":"https://api.github.com/users/uwieder/gists{/gist_id}","starred_url":"https://api.github.com/users/uwieder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uwieder/subscriptions","organizations_url":"https://api.github.com/users/uwieder/orgs","repos_url":"https://api.github.com/users/uwieder/repos","events_url":"https://api.github.com/users/uwieder/events{/privacy}","received_events_url":"https://api.github.com/users/uwieder/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-24T16:04:54Z","updated_at":"2016-10-24T16:34:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a455c0d92208911d3854a00b6e74b45ddfb3f778","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mbudiu-vmw/hiero/pulls/11/commits","review_comments_url":"https://api.github.com/repos/mbudiu-vmw/hiero/pulls/11/comments","review_comment_url":"https://api.github.com/repos/mbudiu-vmw/hiero/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mbudiu-vmw/hiero/issues/11/comments","statuses_url":"https://api.github.com/repos/mbudiu-vmw/hiero/statuses/ceab38a6e3e05d6ba8ceaf8f32ecdd74f1900382","head":{"label":"uwieder:master","ref":"master","sha":"ceab38a6e3e05d6ba8ceaf8f32ecdd74f1900382","user":{"login":"uwieder","id":19557712,"avatar_url":"https://avatars.githubusercontent.com/u/19557712?v=3","gravatar_id":"","url":"https://api.github.com/users/uwieder","html_url":"https://github.com/uwieder","followers_url":"https://api.github.com/users/uwieder/followers","following_url":"https://api.github.com/users/uwieder/following{/other_user}","gists_url":"https://api.github.com/users/uwieder/gists{/gist_id}","starred_url":"https://api.github.com/users/uwieder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uwieder/subscriptions","organizations_url":"https://api.github.com/users/uwieder/orgs","repos_url":"https://api.github.com/users/uwieder/repos","events_url":"https://api.github.com/users/uwieder/events{/privacy}","received_events_url":"https://api.github.com/users/uwieder/received_events","type":"User","site_admin":false},"repo":{"id":70951699,"name":"hiero","full_name":"uwieder/hiero","owner":{"login":"uwieder","id":19557712,"avatar_url":"https://avatars.githubusercontent.com/u/19557712?v=3","gravatar_id":"","url":"https://api.github.com/users/uwieder","html_url":"https://github.com/uwieder","followers_url":"https://api.github.com/users/uwieder/followers","following_url":"https://api.github.com/users/uwieder/following{/other_user}","gists_url":"https://api.github.com/users/uwieder/gists{/gist_id}","starred_url":"https://api.github.com/users/uwieder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uwieder/subscriptions","organizations_url":"https://api.github.com/users/uwieder/orgs","repos_url":"https://api.github.com/users/uwieder/repos","events_url":"https://api.github.com/users/uwieder/events{/privacy}","received_events_url":"https://api.github.com/users/uwieder/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/uwieder/hiero","description":"Big data spreadsheet","fork":true,"url":"https://api.github.com/repos/uwieder/hiero","forks_url":"https://api.github.com/repos/uwieder/hiero/forks","keys_url":"https://api.github.com/repos/uwieder/hiero/keys{/key_id}","collaborators_url":"https://api.github.com/repos/uwieder/hiero/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/uwieder/hiero/teams","hooks_url":"https://api.github.com/repos/uwieder/hiero/hooks","issue_events_url":"https://api.github.com/repos/uwieder/hiero/issues/events{/number}","events_url":"https://api.github.com/repos/uwieder/hiero/events","assignees_url":"https://api.github.com/repos/uwieder/hiero/assignees{/user}","branches_url":"https://api.github.com/repos/uwieder/hiero/branches{/branch}","tags_url":"https://api.github.com/repos/uwieder/hiero/tags","blobs_url":"https://api.github.com/repos/uwieder/hiero/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/uwieder/hiero/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/uwieder/hiero/git/refs{/sha}","trees_url":"https://api.github.com/repos/uwieder/hiero/git/trees{/sha}","statuses_url":"https://api.github.com/repos/uwieder/hiero/statuses/{sha}","languages_url":"https://api.github.com/repos/uwieder/hiero/languages","stargazers_url":"https://api.github.com/repos/uwieder/hiero/stargazers","contributors_url":"https://api.github.com/repos/uwieder/hiero/contributors","subscribers_url":"https://api.github.com/repos/uwieder/hiero/subscribers","subscription_url":"https://api.github.com/repos/uwieder/hiero/subscription","commits_url":"https://api.github.com/repos/uwieder/hiero/commits{/sha}","git_commits_url":"https://api.github.com/repos/uwieder/hiero/git/commits{/sha}","comments_url":"https://api.github.com/repos/uwieder/hiero/comments{/number}","issue_comment_url":"https://api.github.com/repos/uwieder/hiero/issues/comments{/number}","contents_url":"https://api.github.com/repos/uwieder/hiero/contents/{+path}","compare_url":"https://api.github.com/repos/uwieder/hiero/compare/{base}...{head}","merges_url":"https://api.github.com/repos/uwieder/hiero/merges","archive_url":"https://api.github.com/repos/uwieder/hiero/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/uwieder/hiero/downloads","issues_url":"https://api.github.com/repos/uwieder/hiero/issues{/number}","pulls_url":"https://api.github.com/repos/uwieder/hiero/pulls{/number}","milestones_url":"https://api.github.com/repos/uwieder/hiero/milestones{/number}","notifications_url":"https://api.github.com/repos/uwieder/hiero/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/uwieder/hiero/labels{/name}","releases_url":"https://api.github.com/repos/uwieder/hiero/releases{/id}","deployments_url":"https://api.github.com/repos/uwieder/hiero/deployments","created_at":"2016-10-14T22:32:07Z","updated_at":"2016-10-14T22:32:09Z","pushed_at":"2016-10-24T15:49:31Z","git_url":"git://github.com/uwieder/hiero.git","ssh_url":"git@github.com:uwieder/hiero.git","clone_url":"https://github.com/uwieder/hiero.git","svn_url":"https://github.com/uwieder/hiero","homepage":null,"size":74,"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":"mbudiu-vmw:master","ref":"master","sha":"088cac29cd0f0c59f13a2a5e3d2e0674a70f6e8b","user":{"login":"mbudiu-vmw","id":19397042,"avatar_url":"https://avatars.githubusercontent.com/u/19397042?v=3","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},"repo":{"id":69908551,"name":"hiero","full_name":"mbudiu-vmw/hiero","owner":{"login":"mbudiu-vmw","id":19397042,"avatar_url":"https://avatars.githubusercontent.com/u/19397042?v=3","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},"private":false,"html_url":"https://github.com/mbudiu-vmw/hiero","description":"Big data spreadsheet","fork":false,"url":"https://api.github.com/repos/mbudiu-vmw/hiero","forks_url":"https://api.github.com/repos/mbudiu-vmw/hiero/forks","keys_url":"https://api.github.com/repos/mbudiu-vmw/hiero/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mbudiu-vmw/hiero/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mbudiu-vmw/hiero/teams","hooks_url":"https://api.github.com/repos/mbudiu-vmw/hiero/hooks","issue_events_url":"https://api.github.com/repos/mbudiu-vmw/hiero/issues/events{/number}","events_url":"https://api.github.com/repos/mbudiu-vmw/hiero/events","assignees_url":"https://api.github.com/repos/mbudiu-vmw/hiero/assignees{/user}","branches_url":"https://api.github.com/repos/mbudiu-vmw/hiero/branches{/branch}","tags_url":"https://api.github.com/repos/mbudiu-vmw/hiero/tags","blobs_url":"https://api.github.com/repos/mbudiu-vmw/hiero/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mbudiu-vmw/hiero/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mbudiu-vmw/hiero/git/refs{/sha}","trees_url":"https://api.github.com/repos/mbudiu-vmw/hiero/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mbudiu-vmw/hiero/statuses/{sha}","languages_url":"https://api.github.com/repos/mbudiu-vmw/hiero/languages","stargazers_url":"https://api.github.com/repos/mbudiu-vmw/hiero/stargazers","contributors_url":"https://api.github.com/repos/mbudiu-vmw/hiero/contributors","subscribers_url":"https://api.github.com/repos/mbudiu-vmw/hiero/subscribers","subscription_url":"https://api.github.com/repos/mbudiu-vmw/hiero/subscription","commits_url":"https://api.github.com/repos/mbudiu-vmw/hiero/commits{/sha}","git_commits_url":"https://api.github.com/repos/mbudiu-vmw/hiero/git/commits{/sha}","comments_url":"https://api.github.com/repos/mbudiu-vmw/hiero/comments{/number}","issue_comment_url":"https://api.github.com/repos/mbudiu-vmw/hiero/issues/comments{/number}","contents_url":"https://api.github.com/repos/mbudiu-vmw/hiero/contents/{+path}","compare_url":"https://api.github.com/repos/mbudiu-vmw/hiero/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mbudiu-vmw/hiero/merges","archive_url":"https://api.github.com/repos/mbudiu-vmw/hiero/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mbudiu-vmw/hiero/downloads","issues_url":"https://api.github.com/repos/mbudiu-vmw/hiero/issues{/number}","pulls_url":"https://api.github.com/repos/mbudiu-vmw/hiero/pulls{/number}","milestones_url":"https://api.github.com/repos/mbudiu-vmw/hiero/milestones{/number}","notifications_url":"https://api.github.com/repos/mbudiu-vmw/hiero/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mbudiu-vmw/hiero/labels{/name}","releases_url":"https://api.github.com/repos/mbudiu-vmw/hiero/releases{/id}","deployments_url":"https://api.github.com/repos/mbudiu-vmw/hiero/deployments","created_at":"2016-10-03T20:32:15Z","updated_at":"2016-10-14T00:39:11Z","pushed_at":"2016-10-24T16:04:54Z","git_url":"git://github.com/mbudiu-vmw/hiero.git","ssh_url":"git@github.com:mbudiu-vmw/hiero.git","clone_url":"https://github.com/mbudiu-vmw/hiero.git","svn_url":"https://github.com/mbudiu-vmw/hiero","homepage":null,"size":72,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mbudiu-vmw/hiero/pulls/11"},"html":{"href":"https://github.com/mbudiu-vmw/hiero/pull/11"},"issue":{"href":"https://api.github.com/repos/mbudiu-vmw/hiero/issues/11"},"comments":{"href":"https://api.github.com/repos/mbudiu-vmw/hiero/issues/11/comments"},"review_comments":{"href":"https://api.github.com/repos/mbudiu-vmw/hiero/pulls/11/comments"},"review_comment":{"href":"https://api.github.com/repos/mbudiu-vmw/hiero/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mbudiu-vmw/hiero/pulls/11/commits"},"statuses":{"href":"https://api.github.com/repos/mbudiu-vmw/hiero/statuses/ceab38a6e3e05d6ba8ceaf8f32ecdd74f1900382"}}}}
{"actor":{"display_login":"mbudiu-vmw"}}