{"action":"created","comment":{"url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments/39737279","id":39737279,"diff_hunk":"@@ -0,0 +1,39 @@\n+/*\n+ * Copyright (c) 2008-2015, Hazelcast, Inc. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * 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, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+package com.hazelcast.query;\n+\n+import com.hazelcast.query.impl.Indexes;\n+import com.hazelcast.query.impl.predicates.Visitor;\n+\n+/**\n+ * Predicates which can be visited by optimizer.\n+ *\n+ */\n+public interface Visitable {\n+\n+    /**\n+     * Accept visitor. Predicate can either return it's own instance if no modification\n+     * was done as a result of the visit. In the case there is a change needed then\n+     * the predicate has to return changed copy of itself. Predicates has to be treated\n+     * as immutable for optimization purposes.\n+     *\n+     * @param visitor visitor to accept\n+     * @param indexes indexes\n+     * @return itself or its changed copy\n+     */\n+    Predicate accept(Visitor visitor, Indexes indexes);","path":"hazelcast/src/main/java/com/hazelcast/query/Visitable.java","position":38,"original_position":38,"commit_id":"621b58b30731efb519e7f9a90ab8cc3349f422ce","original_commit_id":"621b58b30731efb519e7f9a90ab8cc3349f422ce","user":{"login":"jerrinot","id":158619,"avatar_url":"https://avatars.githubusercontent.com/u/158619?v=3","gravatar_id":"","url":"https://api.github.com/users/jerrinot","html_url":"https://github.com/jerrinot","followers_url":"https://api.github.com/users/jerrinot/followers","following_url":"https://api.github.com/users/jerrinot/following{/other_user}","gists_url":"https://api.github.com/users/jerrinot/gists{/gist_id}","starred_url":"https://api.github.com/users/jerrinot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerrinot/subscriptions","organizations_url":"https://api.github.com/users/jerrinot/orgs","repos_url":"https://api.github.com/users/jerrinot/repos","events_url":"https://api.github.com/users/jerrinot/events{/privacy}","received_events_url":"https://api.github.com/users/jerrinot/received_events","type":"User","site_admin":false},"body":"I do agree. but then I'd need to create a visitor per map. As each map has a different instance of `Indexes`. or some look-up mechanism. ","created_at":"2015-09-17T12:00:36Z","updated_at":"2015-09-17T12:00:36Z","html_url":"https://github.com/hazelcast/hazelcast/pull/6194#discussion_r39737279","pull_request_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6194","_links":{"self":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments/39737279"},"html":{"href":"https://github.com/hazelcast/hazelcast/pull/6194#discussion_r39737279"},"pull_request":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6194"}}},"pull_request":{"url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6194","id":44876549,"html_url":"https://github.com/hazelcast/hazelcast/pull/6194","diff_url":"https://github.com/hazelcast/hazelcast/pull/6194.diff","patch_url":"https://github.com/hazelcast/hazelcast/pull/6194.patch","issue_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/6194","number":6194,"state":"open","locked":false,"title":"Query Optimizations, part 1","user":{"login":"jerrinot","id":158619,"avatar_url":"https://avatars.githubusercontent.com/u/158619?v=3","gravatar_id":"","url":"https://api.github.com/users/jerrinot","html_url":"https://github.com/jerrinot","followers_url":"https://api.github.com/users/jerrinot/followers","following_url":"https://api.github.com/users/jerrinot/following{/other_user}","gists_url":"https://api.github.com/users/jerrinot/gists{/gist_id}","starred_url":"https://api.github.com/users/jerrinot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerrinot/subscriptions","organizations_url":"https://api.github.com/users/jerrinot/orgs","repos_url":"https://api.github.com/users/jerrinot/repos","events_url":"https://api.github.com/users/jerrinot/events{/privacy}","received_events_url":"https://api.github.com/users/jerrinot/received_events","type":"User","site_admin":false},"body":"Introduces Query Optimizer based on static rewriting rules. It treats\r\nPredicates as immutable and returns a modifed copy when optimized is\r\nfound. This is the first part where only a handful of predicates are\r\noptimized. Other PRs will follow.\r\n\r\nOptimized can be disabled by setting property\r\nhazelcast.query.optimizer.type to \"none\"","created_at":"2015-09-13T17:14:47Z","updated_at":"2015-09-17T12:00:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5a3d9eb3664d7c060034cbe910b9fd4ca620df16","assignee":{"login":"jerrinot","id":158619,"avatar_url":"https://avatars.githubusercontent.com/u/158619?v=3","gravatar_id":"","url":"https://api.github.com/users/jerrinot","html_url":"https://github.com/jerrinot","followers_url":"https://api.github.com/users/jerrinot/followers","following_url":"https://api.github.com/users/jerrinot/following{/other_user}","gists_url":"https://api.github.com/users/jerrinot/gists{/gist_id}","starred_url":"https://api.github.com/users/jerrinot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerrinot/subscriptions","organizations_url":"https://api.github.com/users/jerrinot/orgs","repos_url":"https://api.github.com/users/jerrinot/repos","events_url":"https://api.github.com/users/jerrinot/events{/privacy}","received_events_url":"https://api.github.com/users/jerrinot/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/61","html_url":"https://github.com/hazelcast/hazelcast/milestones/3.6","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/milestones/61/labels","id":982584,"number":61,"title":"3.6","description":"","creator":{"login":"enesakar","id":234086,"avatar_url":"https://avatars.githubusercontent.com/u/234086?v=3","gravatar_id":"","url":"https://api.github.com/users/enesakar","html_url":"https://github.com/enesakar","followers_url":"https://api.github.com/users/enesakar/followers","following_url":"https://api.github.com/users/enesakar/following{/other_user}","gists_url":"https://api.github.com/users/enesakar/gists{/gist_id}","starred_url":"https://api.github.com/users/enesakar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/enesakar/subscriptions","organizations_url":"https://api.github.com/users/enesakar/orgs","repos_url":"https://api.github.com/users/enesakar/repos","events_url":"https://api.github.com/users/enesakar/events{/privacy}","received_events_url":"https://api.github.com/users/enesakar/received_events","type":"User","site_admin":false},"open_issues":152,"closed_issues":428,"state":"open","created_at":"2015-02-17T09:27:09Z","updated_at":"2015-09-17T11:19:16Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6194/commits","review_comments_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6194/comments","review_comment_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments{/number}","comments_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/6194/comments","statuses_url":"https://api.github.com/repos/hazelcast/hazelcast/statuses/621b58b30731efb519e7f9a90ab8cc3349f422ce","head":{"label":"jerrinot:improvements/query-optimizer-pr1","ref":"improvements/query-optimizer-pr1","sha":"621b58b30731efb519e7f9a90ab8cc3349f422ce","user":{"login":"jerrinot","id":158619,"avatar_url":"https://avatars.githubusercontent.com/u/158619?v=3","gravatar_id":"","url":"https://api.github.com/users/jerrinot","html_url":"https://github.com/jerrinot","followers_url":"https://api.github.com/users/jerrinot/followers","following_url":"https://api.github.com/users/jerrinot/following{/other_user}","gists_url":"https://api.github.com/users/jerrinot/gists{/gist_id}","starred_url":"https://api.github.com/users/jerrinot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerrinot/subscriptions","organizations_url":"https://api.github.com/users/jerrinot/orgs","repos_url":"https://api.github.com/users/jerrinot/repos","events_url":"https://api.github.com/users/jerrinot/events{/privacy}","received_events_url":"https://api.github.com/users/jerrinot/received_events","type":"User","site_admin":false},"repo":{"id":14844579,"name":"hazelcast","full_name":"jerrinot/hazelcast","owner":{"login":"jerrinot","id":158619,"avatar_url":"https://avatars.githubusercontent.com/u/158619?v=3","gravatar_id":"","url":"https://api.github.com/users/jerrinot","html_url":"https://github.com/jerrinot","followers_url":"https://api.github.com/users/jerrinot/followers","following_url":"https://api.github.com/users/jerrinot/following{/other_user}","gists_url":"https://api.github.com/users/jerrinot/gists{/gist_id}","starred_url":"https://api.github.com/users/jerrinot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerrinot/subscriptions","organizations_url":"https://api.github.com/users/jerrinot/orgs","repos_url":"https://api.github.com/users/jerrinot/repos","events_url":"https://api.github.com/users/jerrinot/events{/privacy}","received_events_url":"https://api.github.com/users/jerrinot/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jerrinot/hazelcast","description":"Open Source In-Memory Data Grid","fork":true,"url":"https://api.github.com/repos/jerrinot/hazelcast","forks_url":"https://api.github.com/repos/jerrinot/hazelcast/forks","keys_url":"https://api.github.com/repos/jerrinot/hazelcast/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jerrinot/hazelcast/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jerrinot/hazelcast/teams","hooks_url":"https://api.github.com/repos/jerrinot/hazelcast/hooks","issue_events_url":"https://api.github.com/repos/jerrinot/hazelcast/issues/events{/number}","events_url":"https://api.github.com/repos/jerrinot/hazelcast/events","assignees_url":"https://api.github.com/repos/jerrinot/hazelcast/assignees{/user}","branches_url":"https://api.github.com/repos/jerrinot/hazelcast/branches{/branch}","tags_url":"https://api.github.com/repos/jerrinot/hazelcast/tags","blobs_url":"https://api.github.com/repos/jerrinot/hazelcast/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jerrinot/hazelcast/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jerrinot/hazelcast/git/refs{/sha}","trees_url":"https://api.github.com/repos/jerrinot/hazelcast/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jerrinot/hazelcast/statuses/{sha}","languages_url":"https://api.github.com/repos/jerrinot/hazelcast/languages","stargazers_url":"https://api.github.com/repos/jerrinot/hazelcast/stargazers","contributors_url":"https://api.github.com/repos/jerrinot/hazelcast/contributors","subscribers_url":"https://api.github.com/repos/jerrinot/hazelcast/subscribers","subscription_url":"https://api.github.com/repos/jerrinot/hazelcast/subscription","commits_url":"https://api.github.com/repos/jerrinot/hazelcast/commits{/sha}","git_commits_url":"https://api.github.com/repos/jerrinot/hazelcast/git/commits{/sha}","comments_url":"https://api.github.com/repos/jerrinot/hazelcast/comments{/number}","issue_comment_url":"https://api.github.com/repos/jerrinot/hazelcast/issues/comments{/number}","contents_url":"https://api.github.com/repos/jerrinot/hazelcast/contents/{+path}","compare_url":"https://api.github.com/repos/jerrinot/hazelcast/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jerrinot/hazelcast/merges","archive_url":"https://api.github.com/repos/jerrinot/hazelcast/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jerrinot/hazelcast/downloads","issues_url":"https://api.github.com/repos/jerrinot/hazelcast/issues{/number}","pulls_url":"https://api.github.com/repos/jerrinot/hazelcast/pulls{/number}","milestones_url":"https://api.github.com/repos/jerrinot/hazelcast/milestones{/number}","notifications_url":"https://api.github.com/repos/jerrinot/hazelcast/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jerrinot/hazelcast/labels{/name}","releases_url":"https://api.github.com/repos/jerrinot/hazelcast/releases{/id}","created_at":"2013-12-01T19:18:56Z","updated_at":"2015-04-27T20:28:12Z","pushed_at":"2015-09-17T11:12:28Z","git_url":"git://github.com/jerrinot/hazelcast.git","ssh_url":"git@github.com:jerrinot/hazelcast.git","clone_url":"https://github.com/jerrinot/hazelcast.git","svn_url":"https://github.com/jerrinot/hazelcast","homepage":"www.hazelcast.com","size":78713,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"hazelcast:master","ref":"master","sha":"ae877df50978fcfb112d6d0cab2c78f80d1ee770","user":{"login":"hazelcast","id":1453152,"avatar_url":"https://avatars.githubusercontent.com/u/1453152?v=3","gravatar_id":"","url":"https://api.github.com/users/hazelcast","html_url":"https://github.com/hazelcast","followers_url":"https://api.github.com/users/hazelcast/followers","following_url":"https://api.github.com/users/hazelcast/following{/other_user}","gists_url":"https://api.github.com/users/hazelcast/gists{/gist_id}","starred_url":"https://api.github.com/users/hazelcast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hazelcast/subscriptions","organizations_url":"https://api.github.com/users/hazelcast/orgs","repos_url":"https://api.github.com/users/hazelcast/repos","events_url":"https://api.github.com/users/hazelcast/events{/privacy}","received_events_url":"https://api.github.com/users/hazelcast/received_events","type":"Organization","site_admin":false},"repo":{"id":3786237,"name":"hazelcast","full_name":"hazelcast/hazelcast","owner":{"login":"hazelcast","id":1453152,"avatar_url":"https://avatars.githubusercontent.com/u/1453152?v=3","gravatar_id":"","url":"https://api.github.com/users/hazelcast","html_url":"https://github.com/hazelcast","followers_url":"https://api.github.com/users/hazelcast/followers","following_url":"https://api.github.com/users/hazelcast/following{/other_user}","gists_url":"https://api.github.com/users/hazelcast/gists{/gist_id}","starred_url":"https://api.github.com/users/hazelcast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hazelcast/subscriptions","organizations_url":"https://api.github.com/users/hazelcast/orgs","repos_url":"https://api.github.com/users/hazelcast/repos","events_url":"https://api.github.com/users/hazelcast/events{/privacy}","received_events_url":"https://api.github.com/users/hazelcast/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/hazelcast/hazelcast","description":"Open Source In-Memory Data Grid","fork":false,"url":"https://api.github.com/repos/hazelcast/hazelcast","forks_url":"https://api.github.com/repos/hazelcast/hazelcast/forks","keys_url":"https://api.github.com/repos/hazelcast/hazelcast/keys{/key_id}","collaborators_url":"https://api.github.com/repos/hazelcast/hazelcast/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/hazelcast/hazelcast/teams","hooks_url":"https://api.github.com/repos/hazelcast/hazelcast/hooks","issue_events_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/events{/number}","events_url":"https://api.github.com/repos/hazelcast/hazelcast/events","assignees_url":"https://api.github.com/repos/hazelcast/hazelcast/assignees{/user}","branches_url":"https://api.github.com/repos/hazelcast/hazelcast/branches{/branch}","tags_url":"https://api.github.com/repos/hazelcast/hazelcast/tags","blobs_url":"https://api.github.com/repos/hazelcast/hazelcast/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/hazelcast/hazelcast/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/hazelcast/hazelcast/git/refs{/sha}","trees_url":"https://api.github.com/repos/hazelcast/hazelcast/git/trees{/sha}","statuses_url":"https://api.github.com/repos/hazelcast/hazelcast/statuses/{sha}","languages_url":"https://api.github.com/repos/hazelcast/hazelcast/languages","stargazers_url":"https://api.github.com/repos/hazelcast/hazelcast/stargazers","contributors_url":"https://api.github.com/repos/hazelcast/hazelcast/contributors","subscribers_url":"https://api.github.com/repos/hazelcast/hazelcast/subscribers","subscription_url":"https://api.github.com/repos/hazelcast/hazelcast/subscription","commits_url":"https://api.github.com/repos/hazelcast/hazelcast/commits{/sha}","git_commits_url":"https://api.github.com/repos/hazelcast/hazelcast/git/commits{/sha}","comments_url":"https://api.github.com/repos/hazelcast/hazelcast/comments{/number}","issue_comment_url":"https://api.github.com/repos/hazelcast/hazelcast/issues/comments{/number}","contents_url":"https://api.github.com/repos/hazelcast/hazelcast/contents/{+path}","compare_url":"https://api.github.com/repos/hazelcast/hazelcast/compare/{base}...{head}","merges_url":"https://api.github.com/repos/hazelcast/hazelcast/merges","archive_url":"https://api.github.com/repos/hazelcast/hazelcast/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/hazelcast/hazelcast/downloads","issues_url":"https://api.github.com/repos/hazelcast/hazelcast/issues{/number}","pulls_url":"https://api.github.com/repos/hazelcast/hazelcast/pulls{/number}","milestones_url":"https://api.github.com/repos/hazelcast/hazelcast/milestones{/number}","notifications_url":"https://api.github.com/repos/hazelcast/hazelcast/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/hazelcast/hazelcast/labels{/name}","releases_url":"https://api.github.com/repos/hazelcast/hazelcast/releases{/id}","created_at":"2012-03-21T12:25:18Z","updated_at":"2015-09-15T18:51:05Z","pushed_at":"2015-09-17T11:32:33Z","git_url":"git://github.com/hazelcast/hazelcast.git","ssh_url":"git@github.com:hazelcast/hazelcast.git","clone_url":"https://github.com/hazelcast/hazelcast.git","svn_url":"https://github.com/hazelcast/hazelcast","homepage":"www.hazelcast.com","size":153377,"stargazers_count":1236,"watchers_count":1236,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":601,"mirror_url":null,"open_issues_count":501,"forks":601,"open_issues":501,"watchers":1236,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6194"},"html":{"href":"https://github.com/hazelcast/hazelcast/pull/6194"},"issue":{"href":"https://api.github.com/repos/hazelcast/hazelcast/issues/6194"},"comments":{"href":"https://api.github.com/repos/hazelcast/hazelcast/issues/6194/comments"},"review_comments":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6194/comments"},"review_comment":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/hazelcast/hazelcast/pulls/6194/commits"},"statuses":{"href":"https://api.github.com/repos/hazelcast/hazelcast/statuses/621b58b30731efb519e7f9a90ab8cc3349f422ce"}}}}