You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "AMOOOMA (via GitHub)" <gi...@apache.org> on 2023/05/02 19:10:13 UTC

[GitHub] [beam] AMOOOMA commented on a diff in pull request #26477: Report source bytes processed for custom sources

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


##########
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();
+        } catch (Exception e) {
+          // ignore

Review Comment:
   Done.



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org