gyfora commented on a change in pull request #44:
URL: 
https://github.com/apache/flink-kubernetes-operator/pull/44#discussion_r826607445



##########
File path: 
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/FlinkOperator.java
##########
@@ -74,12 +88,43 @@ public static void main(String... args) {
                         reconcilerFactory,
                         observerFactory);
 
-        FlinkControllerConfig controllerConfig = new 
FlinkControllerConfig(controller);
+        controllerConfig = new FlinkControllerConfig(controller);
         controller.setControllerConfig(controllerConfig);
         controllerConfig.setConfigurationService(configurationService);
+    }
 
+    public void run() {
         operator.register(controller, controllerConfig);
         operator.installShutdownHook();
         operator.start();
     }
+
+    protected ConfigurationService getConfigurationService() {
+        return new 
ConfigurationServiceDecorator(DefaultConfigurationService.instance()) {
+            @Override
+            public ExecutorService getExecutorService() {
+                int maxPoolSize = getReconciliationMaxPoolSize();
+                return new ThreadPoolExecutor(
+                        0, maxPoolSize, 60L, TimeUnit.SECONDS, new 
SynchronousQueue<>());
+            }
+
+            private int getReconciliationMaxPoolSize() {
+                int value =
+                        EnvUtils.getPositiveOrMinusOneInt(
+                                EnvUtils.ENV_RECONCILIATION_MAX_PARALLELISM,
+                                Integer.MAX_VALUE,
+                                "Specify a positive number or -1 for infinite 
parallelism.");

Review comment:
       I think it would be a bit nicer and (a lot simpler) to add this to 
`OperatorConfigOptions` and expose it through the `FlinkOperatorConfiguration` 
class instead of the env variable. 
   
   We have some env variable based configs still in a few places but I think 
for things like this the operator config is much better.




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