danbosnichill commented on a change in pull request #13711: URL: https://github.com/apache/flink/pull/13711#discussion_r509814560
########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/concurrent/ExponentialBackoffRetryStrategy.java ########## @@ -0,0 +1,64 @@ +/* + * 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.concurrent; + +import org.apache.flink.api.common.time.Time; +import org.apache.flink.util.Preconditions; + +/** + * An implementation of {@link RetryStrategy} that retries that has an exponential backoff with + * a cap. + */ +public class ExponentialBackoffRetryStrategy implements RetryStrategy { + private final int remainingRetries; + private final Time currentRetryDelay; + private final Time maxRetryDelay; + + /** + * @param remainingRetries number of times to retry + * @param currentRetryDelay the current delay between retries + * @param maxRetryDelay the max delay between retries + */ + public ExponentialBackoffRetryStrategy(int remainingRetries, Time currentRetryDelay, Time maxRetryDelay) { Review comment: Yea, I can change it. ########## File path: flink-runtime/src/main/java/org/apache/flink/runtime/concurrent/FixedRetryStrategy.java ########## @@ -0,0 +1,58 @@ +/* + * 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.concurrent; + +import org.apache.flink.api.common.time.Time; +import org.apache.flink.util.Preconditions; + +/** + * An implementation of {@link RetryStrategy} that retries at a fixed delay. + */ +public class FixedRetryStrategy implements RetryStrategy { + private final int remainingRetries; + private final Time retryDelay; + + /** + * @param remainingRetries number of times to retry + * @param retryDelay delay between retries + */ + public FixedRetryStrategy(int remainingRetries, Time retryDelay) { Review comment: Ditto. ---------------------------------------------------------------- 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: us...@infra.apache.org