johnyangk commented on a change in pull request #63: [NEMO-124] Support 
DoFn#output(tag, output)
URL: https://github.com/apache/incubator-nemo/pull/63#discussion_r199433142
 
 

 ##########
 File path: 
runtime/executor/src/main/java/edu/snu/nemo/runtime/executor/datatransfer/OutputCollectorImpl.java
 ##########
 @@ -61,6 +100,21 @@ public O remove() {
    * @return true if this OutputCollector is empty.
    */
   public boolean isEmpty() {
-    return outputQueue.isEmpty();
+    return mainTagOutputQueue.isEmpty();
+  }
+
+  /**
+   * Check if this OutputCollector is empty.
+   *
+   * @param tag output tag
+   * @return true if this OutputCollector is empty.
+   */
+  public boolean isEmpty(final String tag) {
+    if (this.additionalTagOutputQueues.get(tag) == null) {
+      return isEmpty();
+    } else {
+      // Note that string hash can be cached, thus accessing additional output 
queues can be fast.
 
 Review comment:
   string hash can be cached -> String#hashCode() is cached

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