Github user StefanRRichter commented on a diff in the pull request:

    https://github.com/apache/flink/pull/2746#discussion_r86552393
  
    --- Diff: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/StateAssignmentOperation.java
 ---
    @@ -63,164 +63,170 @@ public StateAssignmentOperation(
        public boolean assignStates() throws Exception {
     
                for (Map.Entry<JobVertexID, TaskState> taskGroupStateEntry : 
latest.getTaskStates().entrySet()) {
    +
                        TaskState taskState = taskGroupStateEntry.getValue();
                        ExecutionJobVertex executionJobVertex = 
tasks.get(taskGroupStateEntry.getKey());
     
    -                   if (executionJobVertex != null) {
    -                           // check that the number of key groups have not 
changed
    -                           if (taskState.getMaxParallelism() != 
executionJobVertex.getMaxParallelism()) {
    -                                   throw new IllegalStateException("The 
maximum parallelism (" +
    -                                                   
taskState.getMaxParallelism() + ") with which the latest " +
    -                                                   "checkpoint of the 
execution job vertex " + executionJobVertex +
    -                                                   " has been taken and 
the current maximum parallelism (" +
    -                                                   
executionJobVertex.getMaxParallelism() + ") changed. This " +
    -                                                   "is currently not 
supported.");
    +                   if (executionJobVertex == null) {
    --- End diff --
    
    The code should do the same, I just found the if-nesting was a little deep 
and checking the preconditions first makes it more readable imo.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to