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

 ##########
 File path: 
runtime/master/src/main/java/edu/snu/nemo/runtime/master/PlanStateManager.java
 ##########
 @@ -169,16 +181,21 @@ private void initializeComputationStates() {
     final Stage stage = physicalPlan.getStageDAG().getVertexById(stageId);
     for (int taskIndex = 0; taskIndex < stage.getParallelism(); taskIndex++) {
       final List<TaskState> attemptStatesForThisTaskIndex =
-        stageIdToTaskAttemptStates.get(stage.getId()).get(taskIndex);
+        stageIdToTaskAttemptStates.get(stageId).get(taskIndex);
 
       // If one of the attempts is COMPLETE, do not schedule
       if (attemptStatesForThisTaskIndex
         .stream()
         .noneMatch(state -> 
state.getStateMachine().getCurrentState().equals(TaskState.State.COMPLETE))) {
 
         // (Step 1) Create new READY attempts, as many as
-        // # of clones - # of 'not-done' attempts)
-        final int numOfClones = 
stage.getPropertyValue(ClonedSchedulingProperty.class).orElse(1);
+        // # of clones - # of 'not-done' attempts
+        stageIdToTaskIndexToNumOfClones.putIfAbsent(stageId, new HashMap<>());
+        final Optional<ClonedSchedulingProperty.CloneConf> cloneConf =
+          stage.getPropertyValue(ClonedSchedulingProperty.class);
+        final int numOfClones = cloneConf.isPresent() && 
cloneConf.get().isUpFrontCloning()
+          ? 2
+          : stageIdToTaskIndexToNumOfClones.get(stageId).getOrDefault(stageId, 
1);
 
 Review comment:
   Why the default value is 2 when the `cloneConf` is absent but 1 when the 
value of `stageIdToTaskIndexToNumOfClones` is absent?

----------------------------------------------------------------
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