You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@jena.apache.org by GitBox <gi...@apache.org> on 2021/03/03 22:06:02 UTC

[GitHub] [jena] afs commented on a change in pull request #943: Code cleaning.

afs commented on a change in pull request #943:
URL: https://github.com/apache/jena/pull/943#discussion_r586828011



##########
File path: jena-fuseki2/jena-fuseki-main/src/main/java/org/apache/jena/fuseki/main/FusekiServer.java
##########
@@ -736,6 +738,41 @@ private void serviceEndpointOperation(String datasetName, String endpointName, O
             dap.getDataService().addEndpoint(endpoint);
         }
 
+        /**
+         * Set the number threads used by Jetty. This uses a {@code org.eclipse.jetty.util.thread.QueuedThreadPool} provided by Jetty.
+         * <p>
+         * Argument order is (minThreads, maxThreads).
+         * <p>
+         * <ul>
+         * <li>Use (-1,-1) for Jetty "default". The Jetty 9.4 defaults are (min=8,max=200).
+         * <li>If (min != -1, max is -1) then the default max is 20.
+         * <li>If (min is -1, max != -1) then the default min is 2.
+         * </ul>
+         */
+        public Builder numServerThreads(int minThreads, int maxThreads) {
+            if ( minThreads >= 0 && maxThreads > 0 ) {
+                if ( minThreads > maxThreads )
+                    throw new FusekiConfigException(String.format("Bad thread setting: (min=%d, max=%d)", minThreads, maxThreads));
+            }

Review comment:
       This isn't accessible from an assembler ATM.
   
   Jetty has a test "if (maxThreads < minThreads)" but can change the use of min/max to make any negative numbers be "default".
   




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@jena.apache.org
For additional commands, e-mail: pr-help@jena.apache.org