Github user StefanRRichter commented on a diff in the pull request:

    https://github.com/apache/flink/pull/5239#discussion_r170229683
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/state/LocalRecoveryConfig.java
 ---
    @@ -0,0 +1,120 @@
    +/*
    + * 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.state;
    +
    +import org.apache.flink.api.common.io.ParseException;
    +import org.apache.flink.configuration.CheckpointingOptions;
    +import org.apache.flink.configuration.Configuration;
    +
    +import org.slf4j.LoggerFactory;
    +
    +import javax.annotation.Nonnull;
    +
    +/**
    + * This class encapsulates the completed configuration for local recovery, 
i.e. the root
    + * directories into which all file-based snapshots can be written and the 
general mode for the local recover feature.
    + */
    +public class LocalRecoveryConfig {
    +
    +   /**
    +    * Enum over modes of local recovery:
    +    * <p><ul>
    +    * <li>DISABLED: disables local recovery.
    +    * <li>ENABLE_FILE_BASED: enables local recovery in a variant that is 
based on local files.
    +    * </ul>
    +    */
    +   public enum LocalRecoveryMode {
    +           DISABLED,
    +           ENABLE_FILE_BASED;
    +
    +           /**
    +            * Attempts to parses the given string to a {@link 
LocalRecoveryMode}.
    +            *
    +            * @param input string to parse
    +            * @return the {@link LocalRecoveryMode} that is represented by 
the input string.
    +            * @throws ParseException if the string cannot be parsed to a 
{@link LocalRecoveryMode}.
    +            */
    +           @Nonnull
    +           public static LocalRecoveryMode fromString(String input) throws 
ParseException {
    +                   if (input != null) {
    +                           String trimInput = input.trim();
    +                           if 
(DISABLED.toString().equalsIgnoreCase(trimInput)) {
    +                                   return DISABLED;
    +                           } else if 
(ENABLE_FILE_BASED.toString().equalsIgnoreCase(trimInput)) {
    +                                   return ENABLE_FILE_BASED;
    +                           }
    +                   }
    +                   throw new ParseException("Cannot parse input to 
LocalRecoveryMode: " + input);
    +           }
    --- End diff --
    
    👍 


---

Reply via email to