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

[GitHub] [flink] Aitozi commented on a change in pull request #17129: [WIP][FLINK-23654][runtime] Splitting IO and future threadpools and adding advanced configurations

Aitozi commented on a change in pull request #17129:
URL: https://github.com/apache/flink/pull/17129#discussion_r701472134



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobManagerSharedServices.java
##########
@@ -147,10 +164,18 @@ public static JobManagerSharedServices fromConfiguration(
                                 failOnJvmMetaspaceOomError ? fatalErrorHandler : null,
                                 checkClassLoaderLeak));
 
+        final int numberCPUCores = Hardware.getNumberCPUCores();
+        final int numJobManagerFutureThreads =
+                config.getInteger(JobManagerOptions.JOB_MANAGER_FUTURE_POOL_SIZE, numberCPUCores);
         final ScheduledExecutorService futureExecutor =
                 Executors.newScheduledThreadPool(
-                        Hardware.getNumberCPUCores(),
-                        new ExecutorThreadFactory("jobmanager-future"));
+                        numJobManagerFutureThreads, new ExecutorThreadFactory("jobmanager-future"));
+
+        final int numJobManagerIoThreads =

Review comment:
       same here 

##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/jobmaster/JobManagerSharedServices.java
##########
@@ -147,10 +164,18 @@ public static JobManagerSharedServices fromConfiguration(
                                 failOnJvmMetaspaceOomError ? fatalErrorHandler : null,
                                 checkClassLoaderLeak));
 
+        final int numberCPUCores = Hardware.getNumberCPUCores();
+        final int numJobManagerFutureThreads =

Review comment:
       `numJobManagerFutureThreads ` -> `jobManagerFuturePoolSize` ? 

##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/jobmaster/JobManagerSharedServicesTest.java
##########
@@ -0,0 +1,145 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.runtime.jobmaster;
+
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.configuration.JobManagerOptions;
+import org.apache.flink.core.testutils.OneShotLatch;
+import org.apache.flink.runtime.blob.BlobServer;
+import org.apache.flink.runtime.blob.VoidBlobStore;
+import org.apache.flink.runtime.util.Hardware;
+import org.apache.flink.runtime.util.TestingFatalErrorHandler;
+import org.apache.flink.util.TestLogger;
+import org.apache.flink.util.function.ThrowingRunnable;
+
+import org.junit.Test;
+
+import javax.annotation.Nonnull;
+
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.Executor;
+import java.util.concurrent.ScheduledExecutorService;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * Tests auxiliary shared services created by {@link JobManagerSharedServices} and used by the
+ * {@link JobMaster}.
+ */
+public class JobManagerSharedServicesTest extends TestLogger {
+
+    private static final int CPU_CORES = Hardware.getNumberCPUCores();
+
+    @Test
+    public void testFutureExecutorNoConfiguration() throws Exception {
+        final Configuration config = new Configuration();
+
+        final JobManagerSharedServices jobManagerSharedServices =
+                createJobManagerSharedServices(config);
+
+        try {
+            ScheduledExecutorService futureExecutor = jobManagerSharedServices.getFutureExecutor();
+
+            assertExecutorPoolSize(futureExecutor, CPU_CORES);
+        } finally {
+            jobManagerSharedServices.shutdown();
+        }
+    }
+
+    @Nonnull
+    private JobManagerSharedServices createJobManagerSharedServices(Configuration config)

Review comment:
       Move these two helper method down to the class ? 




-- 
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-unsubscribe@flink.apache.org

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