flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zentol <...@git.apache.org>
Subject [GitHub] flink pull request #4364: [FLINK-7216] [distr. coordination] Guard against c...
Date Wed, 19 Jul 2017 09:28:17 GMT
Github user zentol commented on a diff in the pull request:

    https://github.com/apache/flink/pull/4364#discussion_r128196537
  
    --- Diff: flink-runtime/src/main/java/org/apache/flink/runtime/executiongraph/restart/ExecutionGraphRestartCallback.java
---
    @@ -19,27 +19,33 @@
     package org.apache.flink.runtime.executiongraph.restart;
     
     import org.apache.flink.runtime.executiongraph.ExecutionGraph;
    -import org.slf4j.Logger;
    -import org.slf4j.LoggerFactory;
    -
    -import java.util.concurrent.Callable;
    -
    -class ExecutionGraphRestarter {
    -	private static final Logger LOG = LoggerFactory.getLogger(ExecutionGraphRestarter.class);
    -	public static Callable<Object> restartWithDelay(final ExecutionGraph executionGraph,
final long delayBetweenRestartAttemptsInMillis) {
    -		return new Callable<Object>() {
    -			@Override
    -			public Object call() throws Exception {
    -				try {
    -					LOG.info("Delaying retry of job execution for {} ms ...", delayBetweenRestartAttemptsInMillis);
    -					// do the delay
    -					Thread.sleep(delayBetweenRestartAttemptsInMillis);
    -				} catch(InterruptedException e) {
    -					// should only happen on shutdown
    -				}
    -				executionGraph.restart();
    -				return null;
    -			}
    -		};
    +
    +import java.util.concurrent.atomic.AtomicBoolean;
    +
    +import static org.apache.flink.util.Preconditions.checkNotNull;
    +
    +/**
    + * A {@link RestartCallback} that abstracts restart calls on an {@link ExecutionGraph}.

    + * 
    + * <p>This callback implementation is one-shot; it can only be used once.
    + */
    +public class ExecutionGraphRestartCallback implements RestartCallback {
    +
    +	/** The ExecutionGraph to restart */
    +	private final ExecutionGraph execGraph;
    +
    +	/** Atomic flag to make sure this is used only once */
    --- End diff --
    
    Please add a period here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message