{"action":"created","comment":{"url":"https://api.github.com/repos/yahoo/fili/pulls/comments/103786249","pull_request_review_id":24586779,"id":103786249,"diff_hunk":"@@ -648,11 +674,58 @@ private TopDocs getPageOfData(\n             int perPage,\n             int currentPage\n     ) {\n+        /**\n+         * Works around the lack of a way to get at the underlying Collector in TimeLimitingCollector\n+         */\n+        class AccessibleTimeLimitingCollector extends TimeLimitingCollector {\n+            private TopScoreDocCollector wrappedCollector;\n+\n+            /**\n+             * @param collector the wrapped collector\n+             * @param clock the clock used to implement the timeout\n+             * @param ticksAllowed the amount of time allowed for the search\n+             */\n+            AccessibleTimeLimitingCollector(TopScoreDocCollector collector, Counter clock, long ticksAllowed) {\n+                super(collector, clock, ticksAllowed);\n+                wrappedCollector = collector;\n+            }\n+\n+            /**\n+             * This is the method TimeLimitingCollector was missing.\n+             * @return the wrapped collector\n+             */\n+            public TopScoreDocCollector getWrappedCollector() {\n+                return wrappedCollector;\n+            }\n+        }\n+\n+        /**\n+         * This parallelizes the lucene search - each thread using a time limited collector.\n+         */\n+        final CollectorManager<AccessibleTimeLimitingCollector, TopDocs> manager\n+                = new CollectorManager<AccessibleTimeLimitingCollector, TopDocs>() {\n+\n+            @Override\n+            public AccessibleTimeLimitingCollector newCollector() throws IOException {\n+                return new AccessibleTimeLimitingCollector(\n+                        TopScoreDocCollector.create(perPage, lastEntry), Counter.newCounter(false), searchTimeout\n+                );\n+            }\n+\n+            @Override\n+            public TopDocs reduce(Collection<AccessibleTimeLimitingCollector> collectors) throws IOException {\n+                final TopDocs[] docs = collectors.stream()\n+                        .map((collector) -> collector.getWrappedCollector().topDocs())\n+                        .collect(Collectors.toList())\n+                        .toArray(new TopDocs[collectors.size()]);\n+\n+                return TopDocs.merge(perPage, docs);\n+            }\n+        };\n+\n         lock.readLock().lock();\n         try {\n-            return lastEntry == null ?\n-                    indexSearcher.search(query, perPage) :\n-                    indexSearcher.searchAfter(lastEntry, query, perPage);\n+            return indexSearcher.search(query, manager);","path":"fili-core/src/main/java/com/yahoo/bard/webservice/data/dimension/impl/LuceneSearchProvider.java","position":148,"original_position":148,"commit_id":"81615b51e35eb2780b45256373953995e7590765","original_commit_id":"81615b51e35eb2780b45256373953995e7590765","user":{"login":"aklish","id":6979393,"avatar_url":"https://avatars2.githubusercontent.com/u/6979393?v=3","gravatar_id":"","url":"https://api.github.com/users/aklish","html_url":"https://github.com/aklish","followers_url":"https://api.github.com/users/aklish/followers","following_url":"https://api.github.com/users/aklish/following{/other_user}","gists_url":"https://api.github.com/users/aklish/gists{/gist_id}","starred_url":"https://api.github.com/users/aklish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aklish/subscriptions","organizations_url":"https://api.github.com/users/aklish/orgs","repos_url":"https://api.github.com/users/aklish/repos","events_url":"https://api.github.com/users/aklish/events{/privacy}","received_events_url":"https://api.github.com/users/aklish/received_events","type":"User","site_admin":false},"body":"It is actually handled in the newCollector function.  That function constructs a collector with `lastEntry` as an argument.","created_at":"2017-03-01T20:54:40Z","updated_at":"2017-03-01T20:54:40Z","html_url":"https://github.com/yahoo/fili/pull/183#discussion_r103786249","pull_request_url":"https://api.github.com/repos/yahoo/fili/pulls/183","_links":{"self":{"href":"https://api.github.com/repos/yahoo/fili/pulls/comments/103786249"},"html":{"href":"https://github.com/yahoo/fili/pull/183#discussion_r103786249"},"pull_request":{"href":"https://api.github.com/repos/yahoo/fili/pulls/183"}}},"pull_request":{"url":"https://api.github.com/repos/yahoo/fili/pulls/183","id":108375395,"html_url":"https://github.com/yahoo/fili/pull/183","diff_url":"https://github.com/yahoo/fili/pull/183.diff","patch_url":"https://github.com/yahoo/fili/pull/183.patch","issue_url":"https://api.github.com/repos/yahoo/fili/issues/183","number":183,"state":"open","locked":false,"title":"Support timeouts for lucene search provider","user":{"login":"aklish","id":6979393,"avatar_url":"https://avatars2.githubusercontent.com/u/6979393?v=3","gravatar_id":"","url":"https://api.github.com/users/aklish","html_url":"https://github.com/aklish","followers_url":"https://api.github.com/users/aklish/followers","following_url":"https://api.github.com/users/aklish/following{/other_user}","gists_url":"https://api.github.com/users/aklish/gists{/gist_id}","starred_url":"https://api.github.com/users/aklish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aklish/subscriptions","organizations_url":"https://api.github.com/users/aklish/orgs","repos_url":"https://api.github.com/users/aklish/repos","events_url":"https://api.github.com/users/aklish/events{/privacy}","received_events_url":"https://api.github.com/users/aklish/received_events","type":"User","site_admin":false},"body":"…ger'\r\n\r\n","created_at":"2017-02-28T17:07:00Z","updated_at":"2017-03-01T20:54:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"52cf3e9d8dd2c491a9af3f7a1cb98f7982b1e5d5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/yahoo/fili/pulls/183/commits","review_comments_url":"https://api.github.com/repos/yahoo/fili/pulls/183/comments","review_comment_url":"https://api.github.com/repos/yahoo/fili/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yahoo/fili/issues/183/comments","statuses_url":"https://api.github.com/repos/yahoo/fili/statuses/81615b51e35eb2780b45256373953995e7590765","head":{"label":"yahoo:addLuceneSearchTimeout","ref":"addLuceneSearchTimeout","sha":"81615b51e35eb2780b45256373953995e7590765","user":{"login":"yahoo","id":16574,"avatar_url":"https://avatars2.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"repo":{"id":60879636,"name":"fili","full_name":"yahoo/fili","owner":{"login":"yahoo","id":16574,"avatar_url":"https://avatars2.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yahoo/fili","description":"Easily make RESTful web services for time series reporting with Big Data analytics engines like Druid and Hive.","fork":false,"url":"https://api.github.com/repos/yahoo/fili","forks_url":"https://api.github.com/repos/yahoo/fili/forks","keys_url":"https://api.github.com/repos/yahoo/fili/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yahoo/fili/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yahoo/fili/teams","hooks_url":"https://api.github.com/repos/yahoo/fili/hooks","issue_events_url":"https://api.github.com/repos/yahoo/fili/issues/events{/number}","events_url":"https://api.github.com/repos/yahoo/fili/events","assignees_url":"https://api.github.com/repos/yahoo/fili/assignees{/user}","branches_url":"https://api.github.com/repos/yahoo/fili/branches{/branch}","tags_url":"https://api.github.com/repos/yahoo/fili/tags","blobs_url":"https://api.github.com/repos/yahoo/fili/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yahoo/fili/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yahoo/fili/git/refs{/sha}","trees_url":"https://api.github.com/repos/yahoo/fili/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yahoo/fili/statuses/{sha}","languages_url":"https://api.github.com/repos/yahoo/fili/languages","stargazers_url":"https://api.github.com/repos/yahoo/fili/stargazers","contributors_url":"https://api.github.com/repos/yahoo/fili/contributors","subscribers_url":"https://api.github.com/repos/yahoo/fili/subscribers","subscription_url":"https://api.github.com/repos/yahoo/fili/subscription","commits_url":"https://api.github.com/repos/yahoo/fili/commits{/sha}","git_commits_url":"https://api.github.com/repos/yahoo/fili/git/commits{/sha}","comments_url":"https://api.github.com/repos/yahoo/fili/comments{/number}","issue_comment_url":"https://api.github.com/repos/yahoo/fili/issues/comments{/number}","contents_url":"https://api.github.com/repos/yahoo/fili/contents/{+path}","compare_url":"https://api.github.com/repos/yahoo/fili/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yahoo/fili/merges","archive_url":"https://api.github.com/repos/yahoo/fili/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yahoo/fili/downloads","issues_url":"https://api.github.com/repos/yahoo/fili/issues{/number}","pulls_url":"https://api.github.com/repos/yahoo/fili/pulls{/number}","milestones_url":"https://api.github.com/repos/yahoo/fili/milestones{/number}","notifications_url":"https://api.github.com/repos/yahoo/fili/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yahoo/fili/labels{/name}","releases_url":"https://api.github.com/repos/yahoo/fili/releases{/id}","deployments_url":"https://api.github.com/repos/yahoo/fili/deployments","created_at":"2016-06-10T22:07:59Z","updated_at":"2017-02-27T04:51:14Z","pushed_at":"2017-03-01T18:16:29Z","git_url":"git://github.com/yahoo/fili.git","ssh_url":"git@github.com:yahoo/fili.git","clone_url":"https://github.com/yahoo/fili.git","svn_url":"https://github.com/yahoo/fili","homepage":"","size":4582,"stargazers_count":31,"watchers_count":31,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":49,"forks":25,"open_issues":49,"watchers":31,"default_branch":"master"}},"base":{"label":"yahoo:master","ref":"master","sha":"33cc88a295387343c496fdba3416f7b9ee6c6de6","user":{"login":"yahoo","id":16574,"avatar_url":"https://avatars2.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"repo":{"id":60879636,"name":"fili","full_name":"yahoo/fili","owner":{"login":"yahoo","id":16574,"avatar_url":"https://avatars2.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yahoo/fili","description":"Easily make RESTful web services for time series reporting with Big Data analytics engines like Druid and Hive.","fork":false,"url":"https://api.github.com/repos/yahoo/fili","forks_url":"https://api.github.com/repos/yahoo/fili/forks","keys_url":"https://api.github.com/repos/yahoo/fili/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yahoo/fili/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yahoo/fili/teams","hooks_url":"https://api.github.com/repos/yahoo/fili/hooks","issue_events_url":"https://api.github.com/repos/yahoo/fili/issues/events{/number}","events_url":"https://api.github.com/repos/yahoo/fili/events","assignees_url":"https://api.github.com/repos/yahoo/fili/assignees{/user}","branches_url":"https://api.github.com/repos/yahoo/fili/branches{/branch}","tags_url":"https://api.github.com/repos/yahoo/fili/tags","blobs_url":"https://api.github.com/repos/yahoo/fili/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yahoo/fili/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yahoo/fili/git/refs{/sha}","trees_url":"https://api.github.com/repos/yahoo/fili/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yahoo/fili/statuses/{sha}","languages_url":"https://api.github.com/repos/yahoo/fili/languages","stargazers_url":"https://api.github.com/repos/yahoo/fili/stargazers","contributors_url":"https://api.github.com/repos/yahoo/fili/contributors","subscribers_url":"https://api.github.com/repos/yahoo/fili/subscribers","subscription_url":"https://api.github.com/repos/yahoo/fili/subscription","commits_url":"https://api.github.com/repos/yahoo/fili/commits{/sha}","git_commits_url":"https://api.github.com/repos/yahoo/fili/git/commits{/sha}","comments_url":"https://api.github.com/repos/yahoo/fili/comments{/number}","issue_comment_url":"https://api.github.com/repos/yahoo/fili/issues/comments{/number}","contents_url":"https://api.github.com/repos/yahoo/fili/contents/{+path}","compare_url":"https://api.github.com/repos/yahoo/fili/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yahoo/fili/merges","archive_url":"https://api.github.com/repos/yahoo/fili/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yahoo/fili/downloads","issues_url":"https://api.github.com/repos/yahoo/fili/issues{/number}","pulls_url":"https://api.github.com/repos/yahoo/fili/pulls{/number}","milestones_url":"https://api.github.com/repos/yahoo/fili/milestones{/number}","notifications_url":"https://api.github.com/repos/yahoo/fili/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yahoo/fili/labels{/name}","releases_url":"https://api.github.com/repos/yahoo/fili/releases{/id}","deployments_url":"https://api.github.com/repos/yahoo/fili/deployments","created_at":"2016-06-10T22:07:59Z","updated_at":"2017-02-27T04:51:14Z","pushed_at":"2017-03-01T18:16:29Z","git_url":"git://github.com/yahoo/fili.git","ssh_url":"git@github.com:yahoo/fili.git","clone_url":"https://github.com/yahoo/fili.git","svn_url":"https://github.com/yahoo/fili","homepage":"","size":4582,"stargazers_count":31,"watchers_count":31,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":49,"forks":25,"open_issues":49,"watchers":31,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yahoo/fili/pulls/183"},"html":{"href":"https://github.com/yahoo/fili/pull/183"},"issue":{"href":"https://api.github.com/repos/yahoo/fili/issues/183"},"comments":{"href":"https://api.github.com/repos/yahoo/fili/issues/183/comments"},"review_comments":{"href":"https://api.github.com/repos/yahoo/fili/pulls/183/comments"},"review_comment":{"href":"https://api.github.com/repos/yahoo/fili/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yahoo/fili/pulls/183/commits"},"statuses":{"href":"https://api.github.com/repos/yahoo/fili/statuses/81615b51e35eb2780b45256373953995e7590765"}}}}
{"actor":{"display_login":"aklish"}}