{"action":"created","comment":{"url":"https://api.github.com/repos/codice/ddf/pulls/comments/127288751","pull_request_review_id":49845621,"id":127288751,"diff_hunk":"@@ -68,39 +85,106 @@ public SolrQueryFilterVisitor(SolrClient client, String solrCoreName) {\n         schemaFieldResolver = new SchemaFieldResolver(client);\n         this.solrCoreName = solrCoreName;\n     }\n+    @Override\n+    public Object visit(And filter, Object data) {\n+        List<Filter> childList = filter.getChildren();\n+        return logicalOperator(childList, AND, data);\n+    }\n+\n+    @Override\n+    public Object visit(Or filter, Object data) {\n+        List<Filter> childList = filter.getChildren();\n+        return logicalOperator(childList, OR, data);\n+    }\n+\n+    private Object logicalOperator(List<Filter> filters, String operator, Object data) {\n+        if (filters == null || filters.isEmpty()) {\n+            throw new UnsupportedOperationException(\n+                    \"[\" + operator + \"] operation must contain 1 or more filters.\");\n+        }\n+        int startIndex = 0;\n+        Filter child = filters.get(startIndex);\n+        startIndex++;\n+        StringBuilder builder = new StringBuilder();\n+        builder.append(START_PAREN);\n+        builder.append(getQuery(child.accept(this, data)));\n+\n+        for (int i = startIndex; i < filters.size(); i++) {\n+            Filter localFilter = filters.get(i);\n+\n+            if (localFilter != null) {\n+                String query = getQuery(localFilter.accept(this, data));\n+                if(query == null){\n+                    throw new UnsupportedOperationException(\n+                            \"Query operation \"+localFilter+\" is not supported.\");\n+                }\n+                builder.append(operator)\n+                        .append(query);\n+            } else {\n+                throw new UnsupportedOperationException(\n+                        \"Query was not interpreted properly. Query should not be null.\");\n+            }\n+\n+        }\n+        builder.append(END_PAREN);\n+\n+        return new SolrQuery(builder.toString());\n+    }\n+\n+    private String getQuery(Object data) {\n+        if (data instanceof SolrQuery) {\n+            return ((SolrQuery) data).getQuery();\n+        }\n+        return null;\n+    }\n \n     @Override\n     public Object visit(PropertyIsEqualTo filter, Object data) {\n         LOGGER.debug(\"ENTERING: PropertyIsEqualTo filter\");\n \n         ExpressionValueVisitor expressionVisitor = new ExpressionValueVisitor();\n \n-        filter.getExpression1()\n+        String propertyName = (String) filter.getExpression1()","path":"platform/solr/solr-query/src/main/java/org/codice/solr/query/SolrQueryFilterVisitor.java","position":102,"original_position":102,"commit_id":"ec12cdc96434ba69598ff956f906a138012dd8f9","original_commit_id":"26fe9e20325442a79e8e413cc481f787783b8a29","user":{"login":"lessarderic","id":11377558,"avatar_url":"https://avatars2.githubusercontent.com/u/11377558?v=3","gravatar_id":"","url":"https://api.github.com/users/lessarderic","html_url":"https://github.com/lessarderic","followers_url":"https://api.github.com/users/lessarderic/followers","following_url":"https://api.github.com/users/lessarderic/following{/other_user}","gists_url":"https://api.github.com/users/lessarderic/gists{/gist_id}","starred_url":"https://api.github.com/users/lessarderic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lessarderic/subscriptions","organizations_url":"https://api.github.com/users/lessarderic/orgs","repos_url":"https://api.github.com/users/lessarderic/repos","events_url":"https://api.github.com/users/lessarderic/events{/privacy}","received_events_url":"https://api.github.com/users/lessarderic/received_events","type":"User","site_admin":false},"body":"❓ Any chance this could be something else than a `String` here?","created_at":"2017-07-13T18:03:26Z","updated_at":"2017-07-13T18:08:53Z","html_url":"https://github.com/codice/ddf/pull/2130#discussion_r127288751","pull_request_url":"https://api.github.com/repos/codice/ddf/pulls/2130","_links":{"self":{"href":"https://api.github.com/repos/codice/ddf/pulls/comments/127288751"},"html":{"href":"https://github.com/codice/ddf/pull/2130#discussion_r127288751"},"pull_request":{"href":"https://api.github.com/repos/codice/ddf/pulls/2130"}}},"pull_request":{"url":"https://api.github.com/repos/codice/ddf/pulls/2130","id":129778255,"html_url":"https://github.com/codice/ddf/pull/2130","diff_url":"https://github.com/codice/ddf/pull/2130.diff","patch_url":"https://github.com/codice/ddf/pull/2130.patch","issue_url":"https://api.github.com/repos/codice/ddf/issues/2130","number":2130,"state":"open","locked":false,"title":"DDF 3128 Add Decanter and alert/solr appenders base for future expansion","user":{"login":"clockard","id":5248090,"avatar_url":"https://avatars2.githubusercontent.com/u/5248090?v=3","gravatar_id":"","url":"https://api.github.com/users/clockard","html_url":"https://github.com/clockard","followers_url":"https://api.github.com/users/clockard/followers","following_url":"https://api.github.com/users/clockard/following{/other_user}","gists_url":"https://api.github.com/users/clockard/gists{/gist_id}","starred_url":"https://api.github.com/users/clockard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clockard/subscriptions","organizations_url":"https://api.github.com/users/clockard/orgs","repos_url":"https://api.github.com/users/clockard/repos","events_url":"https://api.github.com/users/clockard/events{/privacy}","received_events_url":"https://api.github.com/users/clockard/received_events","type":"User","site_admin":false},"body":"#### What does this PR do?\r\nAdd Decanter and alert/solr appenders base for future expansion. Also includes\r\n- Update PersistenceStore to support batch add\r\n- Add AND/OR capability to persistent store cql queries\r\n\r\n#### Who is reviewing it? \r\n(please choose AT LEAST two reviewers that need to approve the PR before it can get merged)\r\n@emmberk @vinamartin \r\n#### Select relevant component teams: \r\nhttps://github.com/orgs/codice/teams\r\n#### Choose 2 committers to review/merge the PR. \r\n(please choose ONLY two committers from below, delete the rest)\r\n@lessarderic\r\n@pklinef\r\n#### How should this be tested? (List steps with links to updated documentation)\r\nAs far as the alerting goes there is nothing testable right now. The Decanter event collector can be started along with the solr appender to verify that those aspects work. \r\n#### Any background context you want to provide?\r\n#### What are the relevant tickets?\r\n[DDF-3128](https://codice.atlassian.net/browse/DDF-3128)\r\n#### Screenshots (if appropriate)\r\n![screen shot 2017-07-11 at 11 51 35 am](https://user-images.githubusercontent.com/5248090/28085180-c6293c96-662f-11e7-86d7-e08823184e32.png)\r\n![screen shot 2017-07-11 at 11 52 27 am](https://user-images.githubusercontent.com/5248090/28085187-c9847b4e-662f-11e7-8868-8fd14074f8ff.png)\r\n\r\n#### Checklist:\r\n- [X] Documentation Updated\r\n- [X] Update / Add Unit Tests\r\n\r\n#### Review Comment Legend:\r\n- ✏️ (Pencil) This comment is a nitpick or style suggestion, no action required for approval. This comment should provide a suggestion either as an in line code snippet or a gist. \r\n- ❓ (Question Mark) This comment is to gain a clearer understanding of design or code choices, clarification is required but action may not be necessary for approval.\r\n- ❗ (Exclamation Mark) This comment is critical and requires clarification or action before approval.\r\n","created_at":"2017-07-10T21:30:21Z","updated_at":"2017-07-13T18:08:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"403ba0635a334d08de36c589a6b623478c21685e","assignee":{"login":"pklinef","id":700518,"avatar_url":"https://avatars2.githubusercontent.com/u/700518?v=3","gravatar_id":"","url":"https://api.github.com/users/pklinef","html_url":"https://github.com/pklinef","followers_url":"https://api.github.com/users/pklinef/followers","following_url":"https://api.github.com/users/pklinef/following{/other_user}","gists_url":"https://api.github.com/users/pklinef/gists{/gist_id}","starred_url":"https://api.github.com/users/pklinef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pklinef/subscriptions","organizations_url":"https://api.github.com/users/pklinef/orgs","repos_url":"https://api.github.com/users/pklinef/repos","events_url":"https://api.github.com/users/pklinef/events{/privacy}","received_events_url":"https://api.github.com/users/pklinef/received_events","type":"User","site_admin":false},"assignees":[{"login":"pklinef","id":700518,"avatar_url":"https://avatars2.githubusercontent.com/u/700518?v=3","gravatar_id":"","url":"https://api.github.com/users/pklinef","html_url":"https://github.com/pklinef","followers_url":"https://api.github.com/users/pklinef/followers","following_url":"https://api.github.com/users/pklinef/following{/other_user}","gists_url":"https://api.github.com/users/pklinef/gists{/gist_id}","starred_url":"https://api.github.com/users/pklinef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pklinef/subscriptions","organizations_url":"https://api.github.com/users/pklinef/orgs","repos_url":"https://api.github.com/users/pklinef/repos","events_url":"https://api.github.com/users/pklinef/events{/privacy}","received_events_url":"https://api.github.com/users/pklinef/received_events","type":"User","site_admin":false},{"login":"lessarderic","id":11377558,"avatar_url":"https://avatars2.githubusercontent.com/u/11377558?v=3","gravatar_id":"","url":"https://api.github.com/users/lessarderic","html_url":"https://github.com/lessarderic","followers_url":"https://api.github.com/users/lessarderic/followers","following_url":"https://api.github.com/users/lessarderic/following{/other_user}","gists_url":"https://api.github.com/users/lessarderic/gists{/gist_id}","starred_url":"https://api.github.com/users/lessarderic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lessarderic/subscriptions","organizations_url":"https://api.github.com/users/lessarderic/orgs","repos_url":"https://api.github.com/users/lessarderic/repos","events_url":"https://api.github.com/users/lessarderic/events{/privacy}","received_events_url":"https://api.github.com/users/lessarderic/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/codice/ddf/pulls/2130/commits","review_comments_url":"https://api.github.com/repos/codice/ddf/pulls/2130/comments","review_comment_url":"https://api.github.com/repos/codice/ddf/pulls/comments{/number}","comments_url":"https://api.github.com/repos/codice/ddf/issues/2130/comments","statuses_url":"https://api.github.com/repos/codice/ddf/statuses/ec12cdc96434ba69598ff956f906a138012dd8f9","head":{"label":"clockard:DDf-3128","ref":"DDf-3128","sha":"ec12cdc96434ba69598ff956f906a138012dd8f9","user":{"login":"clockard","id":5248090,"avatar_url":"https://avatars2.githubusercontent.com/u/5248090?v=3","gravatar_id":"","url":"https://api.github.com/users/clockard","html_url":"https://github.com/clockard","followers_url":"https://api.github.com/users/clockard/followers","following_url":"https://api.github.com/users/clockard/following{/other_user}","gists_url":"https://api.github.com/users/clockard/gists{/gist_id}","starred_url":"https://api.github.com/users/clockard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clockard/subscriptions","organizations_url":"https://api.github.com/users/clockard/orgs","repos_url":"https://api.github.com/users/clockard/repos","events_url":"https://api.github.com/users/clockard/events{/privacy}","received_events_url":"https://api.github.com/users/clockard/received_events","type":"User","site_admin":false},"repo":{"id":33900871,"name":"ddf","full_name":"clockard/ddf","owner":{"login":"clockard","id":5248090,"avatar_url":"https://avatars2.githubusercontent.com/u/5248090?v=3","gravatar_id":"","url":"https://api.github.com/users/clockard","html_url":"https://github.com/clockard","followers_url":"https://api.github.com/users/clockard/followers","following_url":"https://api.github.com/users/clockard/following{/other_user}","gists_url":"https://api.github.com/users/clockard/gists{/gist_id}","starred_url":"https://api.github.com/users/clockard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clockard/subscriptions","organizations_url":"https://api.github.com/users/clockard/orgs","repos_url":"https://api.github.com/users/clockard/repos","events_url":"https://api.github.com/users/clockard/events{/privacy}","received_events_url":"https://api.github.com/users/clockard/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/clockard/ddf","description":"The Distributed Data Framework - Distribution, SDK, and Test","fork":true,"url":"https://api.github.com/repos/clockard/ddf","forks_url":"https://api.github.com/repos/clockard/ddf/forks","keys_url":"https://api.github.com/repos/clockard/ddf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/clockard/ddf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/clockard/ddf/teams","hooks_url":"https://api.github.com/repos/clockard/ddf/hooks","issue_events_url":"https://api.github.com/repos/clockard/ddf/issues/events{/number}","events_url":"https://api.github.com/repos/clockard/ddf/events","assignees_url":"https://api.github.com/repos/clockard/ddf/assignees{/user}","branches_url":"https://api.github.com/repos/clockard/ddf/branches{/branch}","tags_url":"https://api.github.com/repos/clockard/ddf/tags","blobs_url":"https://api.github.com/repos/clockard/ddf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/clockard/ddf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/clockard/ddf/git/refs{/sha}","trees_url":"https://api.github.com/repos/clockard/ddf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/clockard/ddf/statuses/{sha}","languages_url":"https://api.github.com/repos/clockard/ddf/languages","stargazers_url":"https://api.github.com/repos/clockard/ddf/stargazers","contributors_url":"https://api.github.com/repos/clockard/ddf/contributors","subscribers_url":"https://api.github.com/repos/clockard/ddf/subscribers","subscription_url":"https://api.github.com/repos/clockard/ddf/subscription","commits_url":"https://api.github.com/repos/clockard/ddf/commits{/sha}","git_commits_url":"https://api.github.com/repos/clockard/ddf/git/commits{/sha}","comments_url":"https://api.github.com/repos/clockard/ddf/comments{/number}","issue_comment_url":"https://api.github.com/repos/clockard/ddf/issues/comments{/number}","contents_url":"https://api.github.com/repos/clockard/ddf/contents/{+path}","compare_url":"https://api.github.com/repos/clockard/ddf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/clockard/ddf/merges","archive_url":"https://api.github.com/repos/clockard/ddf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/clockard/ddf/downloads","issues_url":"https://api.github.com/repos/clockard/ddf/issues{/number}","pulls_url":"https://api.github.com/repos/clockard/ddf/pulls{/number}","milestones_url":"https://api.github.com/repos/clockard/ddf/milestones{/number}","notifications_url":"https://api.github.com/repos/clockard/ddf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/clockard/ddf/labels{/name}","releases_url":"https://api.github.com/repos/clockard/ddf/releases{/id}","deployments_url":"https://api.github.com/repos/clockard/ddf/deployments","created_at":"2015-04-14T00:06:27Z","updated_at":"2016-01-14T17:17:40Z","pushed_at":"2017-07-13T16:27:37Z","git_url":"git://github.com/clockard/ddf.git","ssh_url":"git@github.com:clockard/ddf.git","clone_url":"https://github.com/clockard/ddf.git","svn_url":"https://github.com/clockard/ddf","homepage":"","size":167947,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"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":"master"}},"base":{"label":"codice:master","ref":"master","sha":"d3bb1bfe95437b9745a906d440d37ece8841f998","user":{"login":"codice","id":2386734,"avatar_url":"https://avatars1.githubusercontent.com/u/2386734?v=3","gravatar_id":"","url":"https://api.github.com/users/codice","html_url":"https://github.com/codice","followers_url":"https://api.github.com/users/codice/followers","following_url":"https://api.github.com/users/codice/following{/other_user}","gists_url":"https://api.github.com/users/codice/gists{/gist_id}","starred_url":"https://api.github.com/users/codice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codice/subscriptions","organizations_url":"https://api.github.com/users/codice/orgs","repos_url":"https://api.github.com/users/codice/repos","events_url":"https://api.github.com/users/codice/events{/privacy}","received_events_url":"https://api.github.com/users/codice/received_events","type":"Organization","site_admin":false},"repo":{"id":15173563,"name":"ddf","full_name":"codice/ddf","owner":{"login":"codice","id":2386734,"avatar_url":"https://avatars1.githubusercontent.com/u/2386734?v=3","gravatar_id":"","url":"https://api.github.com/users/codice","html_url":"https://github.com/codice","followers_url":"https://api.github.com/users/codice/followers","following_url":"https://api.github.com/users/codice/following{/other_user}","gists_url":"https://api.github.com/users/codice/gists{/gist_id}","starred_url":"https://api.github.com/users/codice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codice/subscriptions","organizations_url":"https://api.github.com/users/codice/orgs","repos_url":"https://api.github.com/users/codice/repos","events_url":"https://api.github.com/users/codice/events{/privacy}","received_events_url":"https://api.github.com/users/codice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/codice/ddf","description":"Distributed Data Framework - an open source, modular integration framework.","fork":false,"url":"https://api.github.com/repos/codice/ddf","forks_url":"https://api.github.com/repos/codice/ddf/forks","keys_url":"https://api.github.com/repos/codice/ddf/keys{/key_id}","collaborators_url":"https://api.github.com/repos/codice/ddf/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/codice/ddf/teams","hooks_url":"https://api.github.com/repos/codice/ddf/hooks","issue_events_url":"https://api.github.com/repos/codice/ddf/issues/events{/number}","events_url":"https://api.github.com/repos/codice/ddf/events","assignees_url":"https://api.github.com/repos/codice/ddf/assignees{/user}","branches_url":"https://api.github.com/repos/codice/ddf/branches{/branch}","tags_url":"https://api.github.com/repos/codice/ddf/tags","blobs_url":"https://api.github.com/repos/codice/ddf/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/codice/ddf/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/codice/ddf/git/refs{/sha}","trees_url":"https://api.github.com/repos/codice/ddf/git/trees{/sha}","statuses_url":"https://api.github.com/repos/codice/ddf/statuses/{sha}","languages_url":"https://api.github.com/repos/codice/ddf/languages","stargazers_url":"https://api.github.com/repos/codice/ddf/stargazers","contributors_url":"https://api.github.com/repos/codice/ddf/contributors","subscribers_url":"https://api.github.com/repos/codice/ddf/subscribers","subscription_url":"https://api.github.com/repos/codice/ddf/subscription","commits_url":"https://api.github.com/repos/codice/ddf/commits{/sha}","git_commits_url":"https://api.github.com/repos/codice/ddf/git/commits{/sha}","comments_url":"https://api.github.com/repos/codice/ddf/comments{/number}","issue_comment_url":"https://api.github.com/repos/codice/ddf/issues/comments{/number}","contents_url":"https://api.github.com/repos/codice/ddf/contents/{+path}","compare_url":"https://api.github.com/repos/codice/ddf/compare/{base}...{head}","merges_url":"https://api.github.com/repos/codice/ddf/merges","archive_url":"https://api.github.com/repos/codice/ddf/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/codice/ddf/downloads","issues_url":"https://api.github.com/repos/codice/ddf/issues{/number}","pulls_url":"https://api.github.com/repos/codice/ddf/pulls{/number}","milestones_url":"https://api.github.com/repos/codice/ddf/milestones{/number}","notifications_url":"https://api.github.com/repos/codice/ddf/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/codice/ddf/labels{/name}","releases_url":"https://api.github.com/repos/codice/ddf/releases{/id}","deployments_url":"https://api.github.com/repos/codice/ddf/deployments","created_at":"2013-12-13T20:38:28Z","updated_at":"2017-07-11T18:00:54Z","pushed_at":"2017-07-13T16:36:47Z","git_url":"git://github.com/codice/ddf.git","ssh_url":"git@github.com:codice/ddf.git","clone_url":"https://github.com/codice/ddf.git","svn_url":"https://github.com/codice/ddf","homepage":"http://ddf.codice.org","size":327325,"stargazers_count":61,"watchers_count":61,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":113,"mirror_url":null,"open_issues_count":27,"forks":113,"open_issues":27,"watchers":61,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/codice/ddf/pulls/2130"},"html":{"href":"https://github.com/codice/ddf/pull/2130"},"issue":{"href":"https://api.github.com/repos/codice/ddf/issues/2130"},"comments":{"href":"https://api.github.com/repos/codice/ddf/issues/2130/comments"},"review_comments":{"href":"https://api.github.com/repos/codice/ddf/pulls/2130/comments"},"review_comment":{"href":"https://api.github.com/repos/codice/ddf/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/codice/ddf/pulls/2130/commits"},"statuses":{"href":"https://api.github.com/repos/codice/ddf/statuses/ec12cdc96434ba69598ff956f906a138012dd8f9"}}}}
{"actor":{"display_login":"lessarderic"}}