Java Code Examples for org.apache.flink.api.common.restartstrategy.RestartStrategies#NoRestartStrategyConfiguration
The following examples show how to use
org.apache.flink.api.common.restartstrategy.RestartStrategies#NoRestartStrategyConfiguration .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RestartStrategyFactory.java From Flink-CEPplus with Apache License 2.0 | 6 votes |
/** * Creates a {@link RestartStrategy} instance from the given {@link org.apache.flink.api.common.restartstrategy.RestartStrategies.RestartStrategyConfiguration}. * * @param restartStrategyConfiguration Restart strategy configuration which specifies which * restart strategy to instantiate * @return RestartStrategy instance */ public static RestartStrategy createRestartStrategy(RestartStrategies.RestartStrategyConfiguration restartStrategyConfiguration) { if (restartStrategyConfiguration instanceof RestartStrategies.NoRestartStrategyConfiguration) { return new NoRestartStrategy(); } else if (restartStrategyConfiguration instanceof RestartStrategies.FixedDelayRestartStrategyConfiguration) { RestartStrategies.FixedDelayRestartStrategyConfiguration fixedDelayConfig = (RestartStrategies.FixedDelayRestartStrategyConfiguration) restartStrategyConfiguration; return new FixedDelayRestartStrategy( fixedDelayConfig.getRestartAttempts(), fixedDelayConfig.getDelayBetweenAttemptsInterval().toMilliseconds()); } else if (restartStrategyConfiguration instanceof RestartStrategies.FailureRateRestartStrategyConfiguration) { RestartStrategies.FailureRateRestartStrategyConfiguration config = (RestartStrategies.FailureRateRestartStrategyConfiguration) restartStrategyConfiguration; return new FailureRateRestartStrategy( config.getMaxFailureRate(), config.getFailureInterval(), config.getDelayBetweenAttemptsInterval() ); } else if (restartStrategyConfiguration instanceof RestartStrategies.FallbackRestartStrategyConfiguration) { return null; } else { throw new IllegalArgumentException("Unknown restart strategy configuration " + restartStrategyConfiguration + "."); } }
Example 2
Source File: RestartStrategyFactory.java From flink with Apache License 2.0 | 6 votes |
/** * Creates a {@link RestartStrategy} instance from the given {@link org.apache.flink.api.common.restartstrategy.RestartStrategies.RestartStrategyConfiguration}. * * @param restartStrategyConfiguration Restart strategy configuration which specifies which * restart strategy to instantiate * @return RestartStrategy instance */ public static RestartStrategy createRestartStrategy(RestartStrategies.RestartStrategyConfiguration restartStrategyConfiguration) { if (restartStrategyConfiguration instanceof RestartStrategies.NoRestartStrategyConfiguration) { return new NoRestartStrategy(); } else if (restartStrategyConfiguration instanceof RestartStrategies.FixedDelayRestartStrategyConfiguration) { RestartStrategies.FixedDelayRestartStrategyConfiguration fixedDelayConfig = (RestartStrategies.FixedDelayRestartStrategyConfiguration) restartStrategyConfiguration; return new FixedDelayRestartStrategy( fixedDelayConfig.getRestartAttempts(), fixedDelayConfig.getDelayBetweenAttemptsInterval().toMilliseconds()); } else if (restartStrategyConfiguration instanceof RestartStrategies.FailureRateRestartStrategyConfiguration) { RestartStrategies.FailureRateRestartStrategyConfiguration config = (RestartStrategies.FailureRateRestartStrategyConfiguration) restartStrategyConfiguration; return new FailureRateRestartStrategy( config.getMaxFailureRate(), config.getFailureInterval(), config.getDelayBetweenAttemptsInterval() ); } else if (restartStrategyConfiguration instanceof RestartStrategies.FallbackRestartStrategyConfiguration) { return null; } else { throw new IllegalArgumentException("Unknown restart strategy configuration " + restartStrategyConfiguration + "."); } }
Example 3
Source File: RestartStrategyFactory.java From flink with Apache License 2.0 | 6 votes |
/** * Creates a {@link RestartStrategy} instance from the given {@link org.apache.flink.api.common.restartstrategy.RestartStrategies.RestartStrategyConfiguration}. * * @param restartStrategyConfiguration Restart strategy configuration which specifies which * restart strategy to instantiate * @return RestartStrategy instance */ public static RestartStrategy createRestartStrategy(RestartStrategies.RestartStrategyConfiguration restartStrategyConfiguration) { if (restartStrategyConfiguration instanceof RestartStrategies.NoRestartStrategyConfiguration) { return new NoRestartStrategy(); } else if (restartStrategyConfiguration instanceof RestartStrategies.FixedDelayRestartStrategyConfiguration) { RestartStrategies.FixedDelayRestartStrategyConfiguration fixedDelayConfig = (RestartStrategies.FixedDelayRestartStrategyConfiguration) restartStrategyConfiguration; return new FixedDelayRestartStrategy( fixedDelayConfig.getRestartAttempts(), fixedDelayConfig.getDelayBetweenAttemptsInterval().toMilliseconds()); } else if (restartStrategyConfiguration instanceof RestartStrategies.FailureRateRestartStrategyConfiguration) { RestartStrategies.FailureRateRestartStrategyConfiguration config = (RestartStrategies.FailureRateRestartStrategyConfiguration) restartStrategyConfiguration; return new FailureRateRestartStrategy( config.getMaxFailureRate(), config.getFailureInterval(), config.getDelayBetweenAttemptsInterval() ); } else if (restartStrategyConfiguration instanceof RestartStrategies.FallbackRestartStrategyConfiguration) { return null; } else { throw new IllegalArgumentException("Unknown restart strategy configuration " + restartStrategyConfiguration + "."); } }