AMOOOMA commented on code in PR #26477:
URL: https://github.com/apache/beam/pull/26477#discussion_r1182950224


##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/StreamingDataflowWorker.java:
##########
@@ -1400,6 +1401,23 @@ public void close() {
       // Blocks while executing work.
       executionState.getWorkExecutor().execute();
 
+      // Reports source bytes processed to workitemcommitrequest if available.
+      long sourceBytesProcessed = 0;
+      List<ElementCounter> counters =
+          ((DataflowMapTaskExecutor) executionState.getWorkExecutor())
+              .getReadOperation()
+              .receivers[0]
+              .getOutputCounters();
+      for (ElementCounter counter : counters) {
+        try {
+          sourceBytesProcessed =
+              (long) ((OutputObjectAndByteCounter) 
counter).getByteCount().getAndReset();

Review Comment:
   Added a check for counter name to make sure we are getting and resetting the 
counter in mind.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to