[ 
https://issues.apache.org/jira/browse/BEAM-7987?focusedWorklogId=295963&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-295963
 ]

ASF GitHub Bot logged work on BEAM-7987:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 16/Aug/19 02:35
            Start Date: 16/Aug/19 02:35
    Worklog Time Spent: 10m 
      Work Description: lukecwik commented on pull request #9336: [BEAM-7987] 
Drop empty Windmill workitem in WindowingWindmillReader
URL: https://github.com/apache/beam/pull/9336#discussion_r314565268
 
 

 ##########
 File path: 
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/WindowingWindmillReader.java
 ##########
 @@ -116,31 +117,54 @@
     final WorkItem workItem = context.getWork();
     KeyedWorkItem<K, T> keyedWorkItem =
         new WindmillKeyedWorkItem<>(key, workItem, windowCoder, windowsCoder, 
valueCoder);
+    final boolean isEmptyWorkItem =
+        (Iterables.isEmpty(keyedWorkItem.timersIterable())
+            && Iterables.isEmpty(keyedWorkItem.elementsIterable()));
     final WindowedValue<KeyedWorkItem<K, T>> value = new 
ValueInEmptyWindows<>(keyedWorkItem);
 
-    return new NativeReaderIterator<WindowedValue<KeyedWorkItem<K, T>>>() {
-      private WindowedValue<KeyedWorkItem<K, T>> current;
-
-      @Override
-      public boolean start() throws IOException {
-        current = value;
-        return true;
-      }
+    // Return a non-op iterator when current workitem is an empty workitem.
 
 Review comment:
   ```suggestion
       // Return a noop iterator when current workitem is an empty workitem.
   ```
 
----------------------------------------------------------------
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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 295963)
    Time Spent: 0.5h  (was: 20m)

> WindowingWindmillReader should not start to read from an empty windmill 
> workitem
> --------------------------------------------------------------------------------
>
>                 Key: BEAM-7987
>                 URL: https://issues.apache.org/jira/browse/BEAM-7987
>             Project: Beam
>          Issue Type: Bug
>          Components: runner-dataflow
>            Reporter: Boyuan Zhang
>            Assignee: Boyuan Zhang
>            Priority: Major
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> WindowingWindmillReader should expect that a windmill workitem has either 
> timers or elements.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Reply via email to