Skip to content

Commit

Permalink
[FLINK-14600][runtime] Change type of field ExecutionGraph#verticesFi…
Browse files Browse the repository at this point in the history
…nished to int

This closes apache#10080.
  • Loading branch information
yanghua authored and GJL committed Nov 6, 2019
1 parent 9b43f13 commit a9eff45
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;

import static org.apache.flink.util.Preconditions.checkNotNull;
Expand Down Expand Up @@ -268,7 +267,7 @@ public class ExecutionGraph implements AccessExecutionGraph {

// ------ Execution status and progress. These values are volatile, and accessed under the lock -------

private final AtomicInteger verticesFinished;
private int verticesFinished;

/** Current status of the job execution. */
private volatile JobStatus state = JobStatus.CREATED;
Expand Down Expand Up @@ -481,8 +480,6 @@ public ExecutionGraph(
this.restartStrategy = restartStrategy;
this.kvStateLocationRegistry = new KvStateLocationRegistry(jobInformation.getJobId(), getAllVertices());

this.verticesFinished = new AtomicInteger();

this.globalModVersion = 1L;

// the failover strategy must be instantiated last, so that the execution graph
Expand Down Expand Up @@ -1381,7 +1378,7 @@ private void initFailureCause(Throwable t) {
*/
void vertexFinished() {
assertRunningInJobMasterMainThread();
final int numFinished = verticesFinished.incrementAndGet();
final int numFinished = ++verticesFinished;
if (numFinished == numVerticesTotal) {
// done :-)

Expand Down Expand Up @@ -1412,7 +1409,7 @@ void vertexFinished() {

void vertexUnFinished() {
assertRunningInJobMasterMainThread();
verticesFinished.getAndDecrement();
verticesFinished--;
}

/**
Expand Down

0 comments on commit a9eff45

Please sign in to comment.