sanha commented on a change in pull request #115: [NEMO-96] Modularize 
DataSkewPolicy to use MetricVertex and BarrierVertex
URL: https://github.com/apache/incubator-nemo/pull/115#discussion_r214386899
 
 

 ##########
 File path: 
runtime/executor/src/main/java/edu/snu/nemo/runtime/executor/datatransfer/OutputCollectorImpl.java
 ##########
 @@ -25,22 +28,30 @@
  * @param <O> output type.
  */
 public final class OutputCollectorImpl<O> implements OutputCollector<O> {
+  private static final Logger LOG = 
LoggerFactory.getLogger(OutputCollectorImpl.class.getName());
   private final Set<String> mainTagOutputChildren;
   // Use ArrayList (not Queue) to allow 'null' values
   private final ArrayList<O> mainTagElements;
-  private final Map<String, ArrayList<Object>> additionalTagElementsMap;
+  // Key: Pair of tag and destination vertex id
+  // Value: data elements which will be input to the tagged destination vertex
+  private final Map<Pair<String, String>, ArrayList<Object>> 
additionalTaggedChildToElementsMap;
 
   /**
    * Constructor of a new OutputCollectorImpl with tagged outputs.
    * @param mainChildren   main children vertices
-   * @param taggedChildren additional children vertices
+   * @param tagToChildren additional children vertices
    */
   public OutputCollectorImpl(final Set<String> mainChildren,
-                             final List<String> taggedChildren) {
+                             final Map<String, String> tagToChildren) {
     this.mainTagOutputChildren = mainChildren;
     this.mainTagElements = new ArrayList<>(1);
-    this.additionalTagElementsMap = new HashMap<>();
-    taggedChildren.forEach(child -> this.additionalTagElementsMap.put(child, 
new ArrayList<>(1)));
+    this.additionalTaggedChildToElementsMap = new HashMap<>();
+    tagToChildren.forEach((tag, child) ->
+      this.additionalTaggedChildToElementsMap.put(Pair.of(tag, child), new 
ArrayList<>(1)));
+  }
+
+  public Map<Pair<String, String>, ArrayList<Object>> 
getAdditionalTaggedChildToElementsMap() {
 
 Review comment:
   Please add a comment for this public method

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

Reply via email to