johnyangk commented on a change in pull request #72: [Nemo-59] Skewed
data-aware executor allocation
URL: https://github.com/apache/incubator-nemo/pull/72#discussion_r200861904
##########
File path:
runtime/common/src/main/java/edu/snu/nemo/runtime/common/optimizer/pass/runtime/DataSkewRuntimePass.java
##########
@@ -75,52 +81,75 @@ public PhysicalPlan apply(final PhysicalPlan originalPlan,
.collect(Collectors.toList());
// Get number of evaluators of the next stage (number of blocks).
- final Integer taskListSize =
optimizationEdges.stream().findFirst().orElseThrow(() ->
+ final Integer reducerTaskNum =
optimizationEdges.stream().findFirst().orElseThrow(() ->
new RuntimeException("optimization edges are
empty")).getDst().getTaskIds().size();
// Calculate keyRanges.
- final List<KeyRange> keyRanges = calculateHashRanges(metricData.right(),
taskListSize);
+ final List<KeyRange> keyRanges = calculateHashRanges(metricData.right(),
reducerTaskNum);
// Overwrite the previously assigned hash value range in the physical DAG
with the new range.
optimizationEdges.forEach(optimizationEdge -> {
// Update the information.
- final List<KeyRange> taskIdxToHashRange = new ArrayList<>();
- IntStream.range(0, taskListSize).forEach(i ->
taskIdxToHashRange.add(keyRanges.get(i)));
+ final Map<Integer, KeyRange> taskIdxToHashRange = new HashMap<>();
+ for (int taskIdx = 0; taskIdx < reducerTaskNum; taskIdx++) {
+ taskIdxToHashRange.put(taskIdx, keyRanges.get(taskIdx));
+ }
optimizationEdge.setTaskIdxToKeyRange(taskIdxToHashRange);
});
return new PhysicalPlan(originalPlan.getId(), physicalDAGBuilder.build());
}
+ private boolean containsSkewedHash(final List<Integer> skewedHashes,
Review comment:
Can you provide a definition of the 'skewed hash' in the class-level comment?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services