Skip to content

Adds bytes read reporting for SDF. - #40639

Open
acrites wants to merge 5 commits into
apache:masterfrom
acrites:is_splittable_fn
Open

acrites wants to merge 5 commits into
apache:masterfrom
acrites:is_splittable_fn

Conversation

@acrites

@acrites acrites commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

SDF's SplittableProcessFn's report their backlog for autoscaling, so we need to also report their bytes processed for autoscaling to correctly compute time to clear backlog.

SplittableProcessFn's are tagged when constructing MapTaskExecutors and their output coders are attached to the ParDoOperation so the counter values can be updated while processing.

Also adds tests for the new code.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📋 Review Summary

This PR enables reporting of bytes processed for Splittable DoFns (SplittableProcessFn) in the Dataflow streaming worker so that autoscaling can accurately estimate backlog clearance time alongside SDF backlog reporting. The implementation cleanly propagates the output coder to ParDoOperation, attaches the byte counter in ComputationWorkExecutorFactory, and aggregates the processed bytes in StreamingModeExecutionContext with thorough unit test coverage.

🔍 General Feedback

  • The changes are well-structured, adhere to existing worker conventions, and include comprehensive unit tests across IntrinsicMapTaskExecutorFactoryTest, MapTaskExecutorTest, ComputationWorkExecutorFactoryTest, and StreamingModeExecutionContextTest.
  • Calling getAndReset() on the shared Counter when multiple SDF ParDoOperations exist in the same MapTask works safely (since the first operation drains the shared counter and subsequent ones return 0), and the added comment in StreamingModeExecutionContext helpful documents the existing interaction with StreamingWorkerStatusReporter.

💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.

@codecov

codecov Bot commented Oct 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.69767% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.03%. Comparing base (76f6e6d) to head (293c6ac).
⚠️ Report is 215 commits behind head on master.

Files with missing lines Patch % Lines
...dataflow/worker/StreamingModeExecutionContext.java 90.00% 0 Missing and 2 partials ⚠️
...taflow/worker/IntrinsicMapTaskExecutorFactory.java 88.88% 0 Missing and 1 partial ⚠️
...low/worker/util/common/worker/MapTaskExecutor.java 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             master   #40639       +/-   ##
=============================================
+ Coverage     56.16%   76.03%   +19.86%     
- Complexity     2288     2301       +13     
=============================================
  Files          1124      259      -865     
  Lines        178336    14490   -163846     
  Branches       1489     1496        +7     
=============================================
- Hits         100170    11018    -89152     
+ Misses        75645     2766    -72879     
+ Partials       2521      706     -1815     
Flag Coverage Δ
go ?
java 76.03% <90.69%> (+0.25%) ⬆️
python ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @kennknowles added as fallback since no labels match configuration
Backup reviewer: damccorm (if the main reviewer is unresponsive, you can escalate to them by tagging their username)

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant