jpountz commented on code in PR #14412: URL: https://github.com/apache/lucene/pull/14412#discussion_r2019755560
########## lucene/CHANGES.txt: ########## @@ -47,6 +47,7 @@ Other --------------------- * GITHUB#14229: Bump minimum required Java version to 25 +* GITHUB#14412: Allow skip cache factor to be updated dynamically. (Sagar Upadhyaya) Review Comment: Can you move the CHANGES entry under version 10.2 below, section "New Features"? ########## lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java: ########## @@ -142,6 +142,20 @@ public LRUQueryCache( missCount = new LongAdder(); } + public float getSkipCacheFactor() { + return skipCacheFactor; + } + + /** + * This setter enables the skipCacheFactor to be updated dynamically. + * + * @param skipCacheFactor determines whether we need to skip the cache operation based on cost and + * lead cost. + */ + public void setSkipCacheFactor(float skipCacheFactor) { Review Comment: Can you explain what this factor does, e.g. by copying this from the ctor docs: "clauses whose cost is {@code skipCacheFactor} times more than the cost of the top-level query will not be cached in order to not slow down queries too much." ########## lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java: ########## @@ -142,6 +142,20 @@ public LRUQueryCache( missCount = new LongAdder(); } + public float getSkipCacheFactor() { Review Comment: Can you add javadocs here too? Lucene aims at having all public APIs documented to make javadocs nicer to browse by users. In this case it could mostly refer to the setter, something like ``` Get the skip cache factor. @see #setSkipCacheFactor ``` -- 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: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org