1996fanrui commented on code in PR #23942:
URL: https://github.com/apache/flink/pull/23942#discussion_r1462744107


##########
flink-core/src/main/java/org/apache/flink/configuration/RestartStrategyOptions.java:
##########
@@ -55,6 +64,54 @@ public class RestartStrategyOptions {
 
     @Internal public static final String RESTART_STRATEGY_CONFIG_PREFIX = 
"restart-strategy";
 
+    /** The restart strategy type. */
+    @Internal
+    public enum RestartStrategyType {
+        NO_RESTART_STRATEGY("disable", Sets.newHashSet("none", "off")),
+        FIXED_DELAY("fixed-delay", Sets.newHashSet("fixeddelay")),
+        FAILURE_RATE("failure-rate", Sets.newHashSet("failurerate")),
+        EXPONENTIAL_DELAY("exponential-delay", 
Sets.newHashSet("exponentialdelay"));
+
+        private final String mainValue;
+        private final Set<String> allAvailableValues;
+
+        RestartStrategyType(String mainValue, Set<String> 
otherAvailableValues) {
+            this.mainValue = mainValue;
+            this.allAvailableValues = Sets.newHashSet(mainValue);
+            allAvailableValues.addAll(otherAvailableValues);
+        }
+
+        /** Return the corresponding RestartStrategyType based on the 
displayed value. */
+        public static RestartStrategyType getTypeFromValue(String value) {
+            for (RestartStrategyType restartStrategyType : 
RestartStrategyType.values()) {

Review Comment:
   Thanks @qinf for the review! Updated.



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