{"action":"created","comment":{"url":"https://api.github.com/repos/druid-io/druid/pulls/comments/148840251","pull_request_review_id":74147804,"id":148840251,"diff_hunk":"@@ -265,27 +271,60 @@ public CachingClusteredClient(\n       }\n \n       final Set<ServerToSegment> segments = computeSegmentsToQuery(timeline);\n-      @Nullable final byte[] queryCacheKey = computeQueryCacheKey();\n+      @Nullable\n+      final byte[] queryCacheKey = computeQueryCacheKey();\n+      @Nullable\n+      final String queryResultKey = computeCurrentEtag(segments, queryCacheKey);\n       if (query.getContext().get(QueryResource.HEADER_IF_NONE_MATCH) != null) {\n-        @Nullable final String prevEtag = (String) query.getContext().get(QueryResource.HEADER_IF_NONE_MATCH);\n-        @Nullable final String currentEtag = computeCurrentEtag(segments, queryCacheKey);\n+        @Nullable\n+        final String prevEtag = (String) query.getContext().get(QueryResource.HEADER_IF_NONE_MATCH);\n+        @Nullable\n+        final String currentEtag = queryResultKey;\n         if (currentEtag != null && currentEtag.equals(prevEtag)) {\n           return Sequences.empty();\n         }\n       }\n \n+      @Nullable\n+      final byte[] cachedResultSet = fetchFromResultLevelCache(queryResultKey);\n+      if (cachedResultSet != null) {\n+        log.info(\"Fetching entire result set from cache\");","path":"server/src/main/java/io/druid/client/CachingClusteredClient.java","position":60,"original_position":60,"commit_id":"83ee76e34d5449920d70ef80a2f213c340d14002","original_commit_id":"83ee76e34d5449920d70ef80a2f213c340d14002","user":{"login":"drcrallen","id":8213081,"avatar_url":"https://avatars2.githubusercontent.com/u/8213081?v=4","gravatar_id":"","url":"https://api.github.com/users/drcrallen","html_url":"https://github.com/drcrallen","followers_url":"https://api.github.com/users/drcrallen/followers","following_url":"https://api.github.com/users/drcrallen/following{/other_user}","gists_url":"https://api.github.com/users/drcrallen/gists{/gist_id}","starred_url":"https://api.github.com/users/drcrallen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drcrallen/subscriptions","organizations_url":"https://api.github.com/users/drcrallen/orgs","repos_url":"https://api.github.com/users/drcrallen/repos","events_url":"https://api.github.com/users/drcrallen/events{/privacy}","received_events_url":"https://api.github.com/users/drcrallen/received_events","type":"User","site_admin":false},"body":"This should be debug, not info. That's a lot of logging to have on every query.","created_at":"2017-11-03T17:04:18Z","updated_at":"2017-11-03T17:15:04Z","html_url":"https://github.com/druid-io/druid/pull/5028#discussion_r148840251","pull_request_url":"https://api.github.com/repos/druid-io/druid/pulls/5028","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/druid-io/druid/pulls/comments/148840251"},"html":{"href":"https://github.com/druid-io/druid/pull/5028#discussion_r148840251"},"pull_request":{"href":"https://api.github.com/repos/druid-io/druid/pulls/5028"}}},"pull_request":{"url":"https://api.github.com/repos/druid-io/druid/pulls/5028","id":149902161,"html_url":"https://github.com/druid-io/druid/pull/5028","diff_url":"https://github.com/druid-io/druid/pull/5028.diff","patch_url":"https://github.com/druid-io/druid/pull/5028.patch","issue_url":"https://api.github.com/repos/druid-io/druid/issues/5028","number":5028,"state":"open","locked":false,"title":"Add result level caching to Brokers","user":{"login":"a2l007","id":4603202,"avatar_url":"https://avatars0.githubusercontent.com/u/4603202?v=4","gravatar_id":"","url":"https://api.github.com/users/a2l007","html_url":"https://github.com/a2l007","followers_url":"https://api.github.com/users/a2l007/followers","following_url":"https://api.github.com/users/a2l007/following{/other_user}","gists_url":"https://api.github.com/users/a2l007/gists{/gist_id}","starred_url":"https://api.github.com/users/a2l007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a2l007/subscriptions","organizations_url":"https://api.github.com/users/a2l007/orgs","repos_url":"https://api.github.com/users/a2l007/repos","events_url":"https://api.github.com/users/a2l007/events{/privacy}","received_events_url":"https://api.github.com/users/a2l007/received_events","type":"User","site_admin":false},"body":"Based on proposal #4843 , this introduces result level caching in brokers. It uses the etag functionality to identify the existence of result cache for a specific query. This is independent of the segment level caching and therefore both types of caching can be configured independently. The result level cache is populated after the merge using the etag as the cache key and merged result set as cache value. \r\nSince query results may be large, there is a configurable parameter `resultLevelCacheLimit` that limits the size of the query response that can be cached.","created_at":"2017-10-31T20:40:10Z","updated_at":"2017-11-03T17:15:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7f2d00cb07687966cdf4d419fd4660f5c89de41e","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/druid-io/druid/pulls/5028/commits","review_comments_url":"https://api.github.com/repos/druid-io/druid/pulls/5028/comments","review_comment_url":"https://api.github.com/repos/druid-io/druid/pulls/comments{/number}","comments_url":"https://api.github.com/repos/druid-io/druid/issues/5028/comments","statuses_url":"https://api.github.com/repos/druid-io/druid/statuses/83ee76e34d5449920d70ef80a2f213c340d14002","head":{"label":"a2l007:result_level_cache","ref":"result_level_cache","sha":"83ee76e34d5449920d70ef80a2f213c340d14002","user":{"login":"a2l007","id":4603202,"avatar_url":"https://avatars0.githubusercontent.com/u/4603202?v=4","gravatar_id":"","url":"https://api.github.com/users/a2l007","html_url":"https://github.com/a2l007","followers_url":"https://api.github.com/users/a2l007/followers","following_url":"https://api.github.com/users/a2l007/following{/other_user}","gists_url":"https://api.github.com/users/a2l007/gists{/gist_id}","starred_url":"https://api.github.com/users/a2l007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a2l007/subscriptions","organizations_url":"https://api.github.com/users/a2l007/orgs","repos_url":"https://api.github.com/users/a2l007/repos","events_url":"https://api.github.com/users/a2l007/events{/privacy}","received_events_url":"https://api.github.com/users/a2l007/received_events","type":"User","site_admin":false},"repo":{"id":97611468,"name":"druid","full_name":"a2l007/druid","owner":{"login":"a2l007","id":4603202,"avatar_url":"https://avatars0.githubusercontent.com/u/4603202?v=4","gravatar_id":"","url":"https://api.github.com/users/a2l007","html_url":"https://github.com/a2l007","followers_url":"https://api.github.com/users/a2l007/followers","following_url":"https://api.github.com/users/a2l007/following{/other_user}","gists_url":"https://api.github.com/users/a2l007/gists{/gist_id}","starred_url":"https://api.github.com/users/a2l007/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/a2l007/subscriptions","organizations_url":"https://api.github.com/users/a2l007/orgs","repos_url":"https://api.github.com/users/a2l007/repos","events_url":"https://api.github.com/users/a2l007/events{/privacy}","received_events_url":"https://api.github.com/users/a2l007/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/a2l007/druid","description":"Column oriented distributed data store ideal for powering interactive applications","fork":true,"url":"https://api.github.com/repos/a2l007/druid","forks_url":"https://api.github.com/repos/a2l007/druid/forks","keys_url":"https://api.github.com/repos/a2l007/druid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/a2l007/druid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/a2l007/druid/teams","hooks_url":"https://api.github.com/repos/a2l007/druid/hooks","issue_events_url":"https://api.github.com/repos/a2l007/druid/issues/events{/number}","events_url":"https://api.github.com/repos/a2l007/druid/events","assignees_url":"https://api.github.com/repos/a2l007/druid/assignees{/user}","branches_url":"https://api.github.com/repos/a2l007/druid/branches{/branch}","tags_url":"https://api.github.com/repos/a2l007/druid/tags","blobs_url":"https://api.github.com/repos/a2l007/druid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/a2l007/druid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/a2l007/druid/git/refs{/sha}","trees_url":"https://api.github.com/repos/a2l007/druid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/a2l007/druid/statuses/{sha}","languages_url":"https://api.github.com/repos/a2l007/druid/languages","stargazers_url":"https://api.github.com/repos/a2l007/druid/stargazers","contributors_url":"https://api.github.com/repos/a2l007/druid/contributors","subscribers_url":"https://api.github.com/repos/a2l007/druid/subscribers","subscription_url":"https://api.github.com/repos/a2l007/druid/subscription","commits_url":"https://api.github.com/repos/a2l007/druid/commits{/sha}","git_commits_url":"https://api.github.com/repos/a2l007/druid/git/commits{/sha}","comments_url":"https://api.github.com/repos/a2l007/druid/comments{/number}","issue_comment_url":"https://api.github.com/repos/a2l007/druid/issues/comments{/number}","contents_url":"https://api.github.com/repos/a2l007/druid/contents/{+path}","compare_url":"https://api.github.com/repos/a2l007/druid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/a2l007/druid/merges","archive_url":"https://api.github.com/repos/a2l007/druid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/a2l007/druid/downloads","issues_url":"https://api.github.com/repos/a2l007/druid/issues{/number}","pulls_url":"https://api.github.com/repos/a2l007/druid/pulls{/number}","milestones_url":"https://api.github.com/repos/a2l007/druid/milestones{/number}","notifications_url":"https://api.github.com/repos/a2l007/druid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/a2l007/druid/labels{/name}","releases_url":"https://api.github.com/repos/a2l007/druid/releases{/id}","deployments_url":"https://api.github.com/repos/a2l007/druid/deployments","created_at":"2017-07-18T14:57:15Z","updated_at":"2017-07-18T14:57:30Z","pushed_at":"2017-11-01T01:41:32Z","git_url":"git://github.com/a2l007/druid.git","ssh_url":"git@github.com:a2l007/druid.git","clone_url":"https://github.com/a2l007/druid.git","svn_url":"https://github.com/a2l007/druid","homepage":"http://druid.io","size":128312,"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,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"druid-io:master","ref":"master","sha":"e96daa2593808d7e10d833525066d4b9e455de4f","user":{"login":"druid-io","id":4203474,"avatar_url":"https://avatars0.githubusercontent.com/u/4203474?v=4","gravatar_id":"","url":"https://api.github.com/users/druid-io","html_url":"https://github.com/druid-io","followers_url":"https://api.github.com/users/druid-io/followers","following_url":"https://api.github.com/users/druid-io/following{/other_user}","gists_url":"https://api.github.com/users/druid-io/gists{/gist_id}","starred_url":"https://api.github.com/users/druid-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/druid-io/subscriptions","organizations_url":"https://api.github.com/users/druid-io/orgs","repos_url":"https://api.github.com/users/druid-io/repos","events_url":"https://api.github.com/users/druid-io/events{/privacy}","received_events_url":"https://api.github.com/users/druid-io/received_events","type":"Organization","site_admin":false},"repo":{"id":6358188,"name":"druid","full_name":"druid-io/druid","owner":{"login":"druid-io","id":4203474,"avatar_url":"https://avatars0.githubusercontent.com/u/4203474?v=4","gravatar_id":"","url":"https://api.github.com/users/druid-io","html_url":"https://github.com/druid-io","followers_url":"https://api.github.com/users/druid-io/followers","following_url":"https://api.github.com/users/druid-io/following{/other_user}","gists_url":"https://api.github.com/users/druid-io/gists{/gist_id}","starred_url":"https://api.github.com/users/druid-io/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/druid-io/subscriptions","organizations_url":"https://api.github.com/users/druid-io/orgs","repos_url":"https://api.github.com/users/druid-io/repos","events_url":"https://api.github.com/users/druid-io/events{/privacy}","received_events_url":"https://api.github.com/users/druid-io/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/druid-io/druid","description":"Column oriented distributed data store ideal for powering interactive applications","fork":false,"url":"https://api.github.com/repos/druid-io/druid","forks_url":"https://api.github.com/repos/druid-io/druid/forks","keys_url":"https://api.github.com/repos/druid-io/druid/keys{/key_id}","collaborators_url":"https://api.github.com/repos/druid-io/druid/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/druid-io/druid/teams","hooks_url":"https://api.github.com/repos/druid-io/druid/hooks","issue_events_url":"https://api.github.com/repos/druid-io/druid/issues/events{/number}","events_url":"https://api.github.com/repos/druid-io/druid/events","assignees_url":"https://api.github.com/repos/druid-io/druid/assignees{/user}","branches_url":"https://api.github.com/repos/druid-io/druid/branches{/branch}","tags_url":"https://api.github.com/repos/druid-io/druid/tags","blobs_url":"https://api.github.com/repos/druid-io/druid/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/druid-io/druid/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/druid-io/druid/git/refs{/sha}","trees_url":"https://api.github.com/repos/druid-io/druid/git/trees{/sha}","statuses_url":"https://api.github.com/repos/druid-io/druid/statuses/{sha}","languages_url":"https://api.github.com/repos/druid-io/druid/languages","stargazers_url":"https://api.github.com/repos/druid-io/druid/stargazers","contributors_url":"https://api.github.com/repos/druid-io/druid/contributors","subscribers_url":"https://api.github.com/repos/druid-io/druid/subscribers","subscription_url":"https://api.github.com/repos/druid-io/druid/subscription","commits_url":"https://api.github.com/repos/druid-io/druid/commits{/sha}","git_commits_url":"https://api.github.com/repos/druid-io/druid/git/commits{/sha}","comments_url":"https://api.github.com/repos/druid-io/druid/comments{/number}","issue_comment_url":"https://api.github.com/repos/druid-io/druid/issues/comments{/number}","contents_url":"https://api.github.com/repos/druid-io/druid/contents/{+path}","compare_url":"https://api.github.com/repos/druid-io/druid/compare/{base}...{head}","merges_url":"https://api.github.com/repos/druid-io/druid/merges","archive_url":"https://api.github.com/repos/druid-io/druid/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/druid-io/druid/downloads","issues_url":"https://api.github.com/repos/druid-io/druid/issues{/number}","pulls_url":"https://api.github.com/repos/druid-io/druid/pulls{/number}","milestones_url":"https://api.github.com/repos/druid-io/druid/milestones{/number}","notifications_url":"https://api.github.com/repos/druid-io/druid/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/druid-io/druid/labels{/name}","releases_url":"https://api.github.com/repos/druid-io/druid/releases{/id}","deployments_url":"https://api.github.com/repos/druid-io/druid/deployments","created_at":"2012-10-23T19:08:07Z","updated_at":"2017-11-03T11:10:22Z","pushed_at":"2017-11-03T16:16:03Z","git_url":"git://github.com/druid-io/druid.git","ssh_url":"git@github.com:druid-io/druid.git","clone_url":"https://github.com/druid-io/druid.git","svn_url":"https://github.com/druid-io/druid","homepage":"http://druid.io","size":128715,"stargazers_count":5640,"watchers_count":5640,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1380,"mirror_url":null,"archived":false,"open_issues_count":849,"forks":1380,"open_issues":849,"watchers":5640,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/druid-io/druid/pulls/5028"},"html":{"href":"https://github.com/druid-io/druid/pull/5028"},"issue":{"href":"https://api.github.com/repos/druid-io/druid/issues/5028"},"comments":{"href":"https://api.github.com/repos/druid-io/druid/issues/5028/comments"},"review_comments":{"href":"https://api.github.com/repos/druid-io/druid/pulls/5028/comments"},"review_comment":{"href":"https://api.github.com/repos/druid-io/druid/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/druid-io/druid/pulls/5028/commits"},"statuses":{"href":"https://api.github.com/repos/druid-io/druid/statuses/83ee76e34d5449920d70ef80a2f213c340d14002"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"drcrallen"}}