polarcoke2 commented on a change in pull request #289: NEMO-433: Improvement of 
Task Metrics and Collecting Them For Sampling
URL: https://github.com/apache/incubator-nemo/pull/289#discussion_r388126384
 
 

 ##########
 File path: 
runtime/common/src/main/java/org/apache/nemo/runtime/common/plan/StageEdge.java
 ##########
 @@ -155,15 +156,26 @@ public int hashCode() {
   }
 
   /**
+   * get keyRanges for shuffle edge.
+   * If the destination vertex is enabled for dynamic task sizing,
+   * @return {@link 
org.apache.nemo.common.ir.edge.executionproperty.SubPartitionSetProperty} value.
+   * Else,
    * @return {@link 
org.apache.nemo.common.ir.edge.executionproperty.PartitionSetProperty} value.
+   * If both not exists, return default partition set made from parallelism.
    */
   public List<KeyRange> getKeyRanges() {
     final ArrayList<KeyRange> defaultPartitionSet = new ArrayList<>();
+    final List<KeyRange> keyRanges;
     for (int taskIndex = 0; taskIndex < getDst().getParallelism(); 
taskIndex++) {
       defaultPartitionSet.add(taskIndex, HashRange.of(taskIndex, taskIndex + 
1));
     }
-    final List<KeyRange> keyRanges = getExecutionProperties()
-      .get(PartitionSetProperty.class).orElse(defaultPartitionSet);
+    if (getDst().getEnableDynamicTaskSizing()) {
+      keyRanges = getExecutionProperties()
+        .get(SubPartitionSetProperty.class).orElse(defaultPartitionSet); // 
orElseThrow?
 
 Review comment:
   thanks!

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to