GJL commented on a change in pull request #10173: [FLINK-14708][FLINK-14131][FLINK-14682] Introduce RestartAllStrategy URL: https://github.com/apache/flink/pull/10173#discussion_r345828280
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/failover/flip1/FailoverStrategyFactoryLoader.java ########## @@ -0,0 +1,66 @@ +/* + * 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.executiongraph.failover.flip1; + +import org.apache.flink.configuration.Configuration; +import org.apache.flink.configuration.IllegalConfigurationException; +import org.apache.flink.configuration.JobManagerOptions; + +import static org.apache.flink.util.Preconditions.checkNotNull; + +/** + * A utility class to load NG failover strategy factories from the configuration. + */ +public class FailoverStrategyFactoryLoader { + + /** Config name for the {@link RestartAllStrategy}. */ + public static final String FULL_RESTART_STRATEGY_NAME = "full"; + + /** Config name for the {@link RestartPipelinedRegionStrategy}. */ + public static final String PIPELINED_REGION_RESTART_STRATEGY_NAME = "region"; + + /** + * Loads a {@link FailoverStrategy.Factory} from the given configuration. + * + * @param config which specifies the failover strategy factory to load + * @return failover strategy factory loaded + */ + public static FailoverStrategy.Factory loadFailoverStrategyFactory(final Configuration config) { + checkNotNull(config); + + // the default NG failover strategy is region failover strategy. + // TODO: Remove the overridden default value when removing legacy scheduler + // and changing the default value of JobManagerOptions.EXECUTION_FAILOVER_STRATEGY Review comment: there is one extra space after `//` ---------------------------------------------------------------- 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] With regards, Apache Git Services
