Skip to content

[Dataflow Streaming] [Multi Key] Flush streaming sinks at key boundaries and bundle completion - #39961

Draft
arunpandianp wants to merge 2 commits into
apache:masterfrom
arunpandianp:flushWindmillSink
Draft

[Dataflow Streaming] [Multi Key] Flush streaming sinks at key boundaries and bundle completion#39961
arunpandianp wants to merge 2 commits into
apache:masterfrom
arunpandianp:flushWindmillSink

Conversation

@arunpandianp

Copy link
Copy Markdown
Contributor

No description provided.

…ies and bundle completion

When multi-key bundling is enabled in Dataflow Streaming Engine,
outputs (productions) emitted during a key's processElement lifecycle
must be attributed to that specific key's WorkItemCommitRequest, while
outputs emitted during DoFn finishBundle must be attributed to the
bundle-level MultiKeyWorkItemCommitRequest.

This change:
1. Adds finishKey(@nullable Object key) to the SinkWriter interface
   and implements it across streaming sinks (WindmillSink, PubsubSink,
   PubsubDynamicSink) and non-streaming sinks.
2. In WindmillSink, PubsubSink, and PubsubDynamicSink:
   - When multi-key bundles are enabled: flushes to the active key's commit builder
     in finishKey; flushes remaining finishBundle outputs to bundle-level
     outputs (bundleOutputMessages / bundlePubsubMessages) in close().
   - When multi-key bundles are disabled: finishKey does not flush; close() flushes
     all outputs directly into the single key's commit request.
   - Updates abort() to cleanly discard buffered messages and reset
     internal streams without flushing.
3. In StreamingModeExecutionContext and StreamingWorkScheduler, tracks
   bundleOutputMessages and bundlePubsubMessages and attaches them to
   MultiKeyWorkItemCommitRequest.
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