Skip to content

Commit

Permalink
[FLINK-7808] [REST] JobDetails constructor checks size of tasksPerSta…
Browse files Browse the repository at this point in the history
…te argument

This closes apache#4800.
  • Loading branch information
zentol committed Oct 11, 2017
1 parent 891f359 commit e2ae45b
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.apache.flink.api.common.JobID;
import org.apache.flink.runtime.execution.ExecutionState;
import org.apache.flink.runtime.jobgraph.JobStatus;
import org.apache.flink.util.Preconditions;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
Expand Down Expand Up @@ -92,6 +93,8 @@ public JobDetails(
this.duration = duration;
this.status = checkNotNull(status);
this.lastUpdateTime = lastUpdateTime;
Preconditions.checkArgument(tasksPerState.length == ExecutionState.values().length,
"tasksPerState argument must be of size {}.", ExecutionState.values().length);
this.tasksPerState = checkNotNull(tasksPerState);
this.numTasks = numTasks;
}
Expand Down

0 comments on commit e2ae45b

Please sign in to comment.