You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nemo.apache.org by GitBox <gi...@apache.org> on 2018/08/22 02:04:38 UTC

[GitHub] sanha commented on a change in pull request #112: [NEMO-179] Delayed Task Cloning

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

 ##########
 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
+          || states.stream().anyMatch(curState -> curState.equals(TaskState.State.COMPLETE)); // one of them is COMPLETE
+      })
       .filter(bool -> bool.equals(true))
 
 Review comment:
   Is this needed?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services