thomasmueller commented on code in PR #3076:
URL: https://github.com/apache/jackrabbit-oak/pull/3076#discussion_r4003254550


##########
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/nodetype/NodeTypeIndex.java:
##########
@@ -41,13 +41,25 @@ class NodeTypeIndex implements QueryIndex, JcrConstants {
 
     private final MountInfoProvider mountInfoProvider;
 
+    // OAK-12348: false (default) uses the configurable cost formula.
+    private final boolean disableConfigurableCosts;
+
+    // Value returned by getMinimumCost(), precomputed from 
disableConfigurableCosts.
+    private final double minimumCost;
+
     public NodeTypeIndex(MountInfoProvider mountInfoProvider) {
+        this(mountInfoProvider, false);
+    }
+
+    public NodeTypeIndex(MountInfoProvider mountInfoProvider, boolean 
disableConfigurableCosts) {
         this.mountInfoProvider = mountInfoProvider;
+        this.disableConfigurableCosts = disableConfigurableCosts;
+        this.minimumCost = disableConfigurableCosts ? 
NodeTypeIndexLookup.MINIMUM_COST : 0;
     }
 
     @Override
     public double getMinimumCost() {
-        return NodeTypeIndexLookup.MINIMUM_COST;
+        return minimumCost;

Review Comment:
   I think there is no need to change getMinimumCost()



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