rishabhdaim commented on code in PR #2934:
URL: https://github.com/apache/jackrabbit-oak/pull/2934#discussion_r3362319917


##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java:
##########
@@ -466,11 +465,6 @@ public boolean getReadOnlyMode() {
         return isReadOnlyMode;
     }
 
-    public T setPrefetchFeature(@Nullable Feature prefetch) {
-        this.prefetchFeature = prefetch;
-        return thisBuilder();
-    }
-
     @Nullable
     public Feature getPrefetchFeature() {

Review Comment:
   `setPrefetchFeature()` was removed but `getPrefetchFeature()` and the 
`prefetchFeature` field remain (always null). Consider removing the getter and 
dead fields on the builder, store, and service as part of this cleanup.



##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java:
##########
@@ -4046,18 +4043,11 @@ boolean isReadOnlyMode() {
     @Override
     public void prefetch(java.util.Collection<String> paths, NodeState 
rootState) {
         if (paths != null
-                && rootState instanceof DocumentNodeState
-                && isPrefetchEnabled()) {
+                && rootState instanceof DocumentNodeState) {

Review Comment:
   With the guard gone, queries that already use `option(prefetches N)` will 
always warm the document cache now, even when `FT_PREFETCH_OAK-9780` was off 
before. Worth a release-note callout and a post-upgrade check of 
`DOCUMENT_NODES_PREFETCH` metrics.



##########
oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/prefetch/CacheWarmingTest.java:
##########
@@ -78,11 +72,6 @@ public class CacheWarmingTest {
 
     private CountingMongoDatabase db;
 
-    @Before
-    public void enablePrefetch() {
-        System.setProperty(SYS_PROP_PREFETCH, "true");
-    }
-
     @AfterClass

Review Comment:
   After dropping sys-prop setup, consider adding a test that calls 
`DocumentNodeStore.prefetch()` (not `CacheWarming` directly) with default 
builder setup and asserts cache warming — that would lock in the always-on 
store path this PR introduces.



-- 
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]

Reply via email to