github-code-scanning[bot] commented on code in PR #11595:
URL: https://github.com/apache/druid/pull/11595#discussion_r1259829665
##########
processing/src/main/java/org/apache/druid/query/CacheStrategy.java:
##########
@@ -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)
+ {
+ 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);
Review Comment:
## Deprecated method or constructor invocation
Invoking [CacheStrategy.isCacheable](1) should be avoided because it has
been deprecated.
[Show more
details](https://github.com/apache/druid/security/code-scanning/5263)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]