sanha commented on a change in pull request #112: [NEMO-179] Delayed Task 
Cloning
URL: https://github.com/apache/incubator-nemo/pull/112#discussion_r211817316
 
 

 ##########
 File path: 
runtime/master/src/main/java/edu/snu/nemo/runtime/master/PlanStateManager.java
 ##########
 @@ -252,18 +308,30 @@ public synchronized void onTaskStateChanged(final String 
taskId, final TaskState
     final String stageId = RuntimeIdManager.getStageIdFromTaskId(taskId);
     final List<List<TaskState>> taskStatesOfThisStage = 
stageIdToTaskAttemptStates.get(stageId);
     final long numOfCompletedTaskIndicesInThisStage = 
taskStatesOfThisStage.stream()
-      .map(attempts -> attempts.stream()
-        .map(state -> state.getStateMachine().getCurrentState())
-        .allMatch(curState -> curState.equals(TaskState.State.COMPLETE)
-          || curState.equals(TaskState.State.SHOULD_RETRY)
-          || curState.equals(TaskState.State.ON_HOLD)))
+      .map(attempts -> {
+        final List<TaskState.State> states = attempts
+          .stream()
+          .map(state -> (TaskState.State) 
state.getStateMachine().getCurrentState())
+          .collect(Collectors.toList());
+        return states.stream().allMatch(curState -> 
curState.equals(TaskState.State.ON_HOLD)) // all of them are ON_HOLD
 
 Review comment:
   However, the stage will be considered as `Completed` after all cloned tasks 
become `ON_HOLD`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services

Reply via email to