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:
[email protected]


Reply via email to