Eliaaazzz opened a new pull request, #39461:
URL: https://github.com/apache/beam/pull/39461
Routes `fileio.MatchContinuously` through the `Watch` transform when
deduplication is enabled.
**Stacked on #39023.** That PR adds `Watch` itself and is still open, so its
three commits currently show up here too. Only the last commit, "[Python]
Refactor MatchContinuously onto the Watch transform", is new in this PR. Once
#39023 merges this reduces to a single commit.
### What changes
The polling loop and the set of already-matched file ids move into the
splittable DoFn restriction. The per-key state DoFns `_RemoveDuplicates` and
`_RemoveOldDuplicates` are removed, since `Watch` performs the deduplication.
`has_deduplication=False` keeps the previous `PeriodicImpulse` behaviour, so
that path is unchanged.
### Behaviour change worth calling out
Because the matched ids are part of the restriction, a runner with
checkpointing enabled restores them after a restart and does not reprocess
files. The class docstring previously stated the opposite, that already
processed files are reprocessed on restart, which was accurate for the earlier
memory-only implementation. The docstring is updated in this PR.
### Validation
Fault tolerance on Flink 1.20 with checkpointing enabled: two files present
at start, two added while running, then the TaskManager was killed mid stream.
The JobManager restored the job from checkpoint 3 and every file was still
emitted exactly once, with no reprocessing.
```
Completed checkpoint 3 for job 15502720... (56814 bytes)
Job beam-watch-matchcontinuously switched from state RUNNING to RESTARTING
Job beam-watch-matchcontinuously switched from state RESTARTING to RUNNING
Restoring job 15502720... from Checkpoint 3
```
Also exercised on Dataflow Runner v2 reading a real GCS prefix: files
present at startup and files added to the bucket mid run were each emitted
exactly once.
Unit tests: `watch_test.py` 28 passed, `fileio_test.py` MatchContinuously
tests 8 passed. Formatted with yapf 0.43.0 and isort 7.0.0.
------------------------
Thank you for your contribution! Follow this checklist to help us
incorporate your contribution quickly and easily:
- [ ] [**Choose
reviewer(s)**](https://beam.apache.org/contribute/#make-your-change) and
mention them in a comment (`R: @username`).
- [ ] Mention the appropriate issue in your description (for example:
`addresses #123`), if applicable. This will automatically add a link to the
pull request in the issue. If you would like the issue to automatically close
on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead.
- [ ] Update `CHANGES.md` with noteworthy changes.
- [ ] If this contribution is large, please file an Apache [Individual
Contributor License Agreement](https://cla.apache.org/).
See the [Contributor Guide](https://beam.apache.org/contribute) for more
tips on [how to make review process
smoother](https://github.com/apache/beam/blob/master/CONTRIBUTING.md#make-the-reviewers-job-easier).
To check the build health, please visit
[https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md](https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md)
--
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]