Skip to content

Exempt Apache Beam DoFn method annotations in WellKnownKeep - #6212

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_1000965637
Oct 20, 2026
Merged

copybara-service[bot] merged 1 commit into
masterfrom
test_1000965637

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

Exempt Apache Beam DoFn method annotations in WellKnownKeep

Add all Beam DoFn callback and lifecycle annotations to WellKnownKeep's EXEMPTING_METHOD_ANNOTATIONS list:

  • Timer callbacks: @ontimer, @OnTimerFamily
  • Lifecycle methods: @setup, @teardown, @OnWindowExpiration
  • Execution constraints: @RequiresStableInput, @RequiresTimeSortedInput
  • Splittable DoFn methods: @GetInitialRestriction, @SplitRestriction, @TruncateRestriction, @GetRestrictionCoder, @NewTracker, @Getsize, @GetInitialWatermarkEstimatorState, @GetWatermarkEstimatorStateCoder, @NewWatermarkEstimator

Previously only ProcessElement, StartBundle, and FinishBundle were recognized, leading to false positives in UnusedMethod and EffectivelyPrivate on methods invoked reflectively or dynamically by the Beam runner.

Add all Beam DoFn callback and lifecycle annotations to WellKnownKeep's EXEMPTING_METHOD_ANNOTATIONS list:
- Timer callbacks: @ontimer, @OnTimerFamily
- Lifecycle methods: @setup, @teardown, @OnWindowExpiration
- Execution constraints: @RequiresStableInput, @RequiresTimeSortedInput
- Splittable DoFn methods: @GetInitialRestriction, @SplitRestriction, @TruncateRestriction, @GetRestrictionCoder, @NewTracker, @Getsize, @GetInitialWatermarkEstimatorState, @GetWatermarkEstimatorStateCoder, @NewWatermarkEstimator

Previously only ProcessElement, StartBundle, and FinishBundle were recognized, leading to false positives in UnusedMethod and EffectivelyPrivate on methods invoked reflectively or dynamically by the Beam runner.

PiperOrigin-RevId: 1003345994
@copybara-service
copybara-service Bot merged commit 47eb5be into master Oct 20, 2026
8 checks passed
@copybara-service
copybara-service Bot deleted the test_1000965637 branch October 20, 2026 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant