adamcin commented on code in PR #1094:
URL: https://github.com/apache/jackrabbit-oak/pull/1094#discussion_r1446363899


##########
oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/repository/RepositoryImpl.java:
##########
@@ -564,4 +571,30 @@ public synchronized void cancel() {
             }
         }
     }
+
+    /**
+     * This is a fallback implementation of {@link 
org.apache.jackrabbit.oak.spi.query.SessionQuerySettingsProvider} that
+     * unifies and replaces the previous handling of {@code 
fastQueryResultSize} and {@code oak.fastQuerySize} here
+     * and in the {@link org.apache.jackrabbit.oak.jcr.session.SessionContext}.
+     */
+    private static class FastQuerySizeSettingsProvider implements 
SessionQuerySettingsProvider {
+        private final boolean fastQueryResultSize;
+
+        public FastQuerySizeSettingsProvider(boolean fastQueryResultSize) {
+            this.fastQueryResultSize = fastQueryResultSize;
+        }
+
+        @Override
+        public @NotNull SessionQuerySettings getQuerySettings(@NotNull 
ContentSession session) {
+            return new SessionQuerySettings() {
+                @Override
+                public boolean useDirectResultCount() {
+                    if (System.getProperty("oak.fastQuerySize") != null) {
+                        return Boolean.getBoolean("oak.fastQuerySize");
+                    }

Review Comment:
   @thomasmueller Thanks. I made a change to use an Optional expression for the 
line.



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