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/06/04 05:51:42 UTC

[GitHub] [flink] xintongsong commented on a change in pull request #15286: [FLINK-17707][k8s] Support configuring replicas of JobManager deployment when HA enabled

xintongsong commented on a change in pull request #15286:
URL: https://github.com/apache/flink/pull/15286#discussion_r645304570



##########
File path: flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/parameters/KubernetesJobManagerParameters.java
##########
@@ -160,4 +160,18 @@ public String getEntrypointClass() {
     public boolean isInternalServiceEnabled() {
         return !HighAvailabilityMode.isHighAvailabilityModeActivated(flinkConfig);
     }
+
+    public int getReplicas() {
+        final int replicas =
+                flinkConfig.get(KubernetesConfigOptions.KUBERNETES_JOBMANAGER_REPLICAS);
+        checkArgument(
+                replicas > 0,
+                "'%s' should not be configured less than one.",
+                KubernetesConfigOptions.KUBERNETES_JOBMANAGER_REPLICAS.key());
+        if (replicas > 1 && !HighAvailabilityMode.isHighAvailabilityModeActivated(flinkConfig)) {
+            throw new IllegalArgumentException(
+                    "High availability should be enabled when starting standby JobManagers.");
+        }

Review comment:
       `IllegalConfigurationException` is preferred rather than `IllegalArgumentException`.




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