seojangho commented on a change in pull request #2: [NEMO-7] Intra-TaskGroup 
pipelining
URL: https://github.com/apache/incubator-nemo/pull/2#discussion_r172762523
 
 

 ##########
 File path: 
compiler/frontend/spark/src/main/java/edu/snu/nemo/compiler/frontend/spark/transform/ReduceByKeyTransform.java
 ##########
 @@ -42,24 +46,29 @@ public ReduceByKeyTransform(final Function2<V, V, V> func) 
{
   }
 
   @Override
-  public void prepare(final Context context, final OutputCollector<Tuple2<K, 
V>> outputCollector) {
-    this.oc = outputCollector;
+  public void prepare(final Context context, final Pipe<Tuple2<K, V>> p) {
+    this.pipe = p;
   }
 
   @Override
-  public void onData(final Iterator<Tuple2<K, V>> elements, final String 
srcVertexId) {
-    elements.forEachRemaining(element -> {
-      keyToValues.putIfAbsent(element._1, new ArrayList<>());
-      keyToValues.get(element._1).add(element._2);
-    });
+  public void onData(final Object element) {
+    K key = ((Tuple2<K, V>) element)._1;
 
 Review comment:
   Add `final` modifier?

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