-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Enable result level cache for GroupByStrategyV2 on broker #11595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
cf381d5
fb75a3a
8c6dab2
cc16291
9bfb04c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,17 +36,38 @@ | |
| @ExtensionPoint | ||
| public interface CacheStrategy<T, CacheType, QueryType extends Query<T>> | ||
| { | ||
| /** | ||
| * This method is deprecated and retained for backward incompatibility. | ||
| * Returns whether the given query is cacheable or not. | ||
| * The {@code willMergeRunners} parameter can be used for distinguishing the caller is a broker or a data node. | ||
| * | ||
| * @param ignoredQuery the query to be cached | ||
| * @param ignoredWillMergeRunners indicates that {@link QueryRunnerFactory#mergeRunners(QueryProcessingPool, Iterable)} will be | ||
| * called on the cached by-segment results | ||
| * | ||
| * @return true if the query is cacheable, otherwise false. | ||
| */ | ||
| @Deprecated | ||
| default boolean isCacheable(QueryType ignoredQuery, boolean ignoredWillMergeRunners) | ||
Check noticeCode scanning / CodeQL Useless parameter
The parameter 'ignoredWillMergeRunners' is never used.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the old method and doesn't need a default implementation as such but a default impl is good since implementations don't need to override the deprecated method. The new method will definitely require a default implementation. You can do this
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please let me know what you think. The aim to the above suggestion is for existing extensions to keep working as it is.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks good. I will take it. |
||
| { | ||
| return false; | ||
| } | ||
|
|
||
| /** | ||
| * Returns whether the given query is cacheable or not. | ||
| * The {@code willMergeRunners} parameter can be used for distinguishing the caller is a broker or a data node. | ||
| * | ||
| * @param query the query to be cached | ||
| * @param willMergeRunners indicates that {@link QueryRunnerFactory#mergeRunners(QueryProcessingPool, Iterable)} will be | ||
| * called on the cached by-segment results | ||
| * @param bySegment segment level or result level cache | ||
| * | ||
| * @return true if the query is cacheable, otherwise false. | ||
| */ | ||
| boolean isCacheable(QueryType query, boolean willMergeRunners); | ||
| default boolean isCacheable(QueryType query, boolean willMergeRunners, boolean bySegment) | ||
| { | ||
| return isCacheable(query, willMergeRunners); | ||
Check noticeCode scanning / CodeQL Deprecated method or constructor invocation
Invoking [CacheStrategy.isCacheable](1) should be avoided because it has been deprecated.
|
||
| } | ||
|
|
||
| /** | ||
| * Computes the per-segment cache key for the given query. Because this is a per-segment cache key, it should only | ||
|
|
||
Check notice
Code scanning / CodeQL
Useless parameter