[FLINK-32695] [Tests] Migrated TimestampITCase to SourceV2 #26865
+382
−152
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is the purpose of the change
This PR migrates all legacy SourceFunction usages in TimestampITCase to the modern FLIP-27 Source V2 API
Brief change log
-Replaced all env.addSource(...) usages with env.fromSource(...) using Source V2
-Introduced timestampSource(...) factory and unified MyTimestampSourceV2 + MyTimestampSourceInfiniteV2
-Consolidated MyTimestampSourceReader and MyTimestampSourceInfiniteReader into a single TimestampSourceReader
-Replaced MySourceSplit and MySourceSplitSerializer with singleton-style instances (SPLIT, SPLIT_SERIALIZER)
-Migrated tests like testTimestampExtractorWithDecreasingCustomWatermarkEmit and testTimestampExtractorWithLongMaxWatermarkFromSource to use either DataGeneratorSource or simplified Source V2
-Added rate limiting in DataGeneratorSource where applicable to allow watermarks to be emitted
Verifying this change
Existing tests already cover the migrated logic:
-TimestampITCase: All tests were adapted to use Source V2
Test coverage includes:
-testWatermarkPropagation, testTimestampHandling, testDisabledTimestamps
-Tests involving auto watermark interval and custom watermark generators
-Final watermark emission and out-of-order timestamp handling
All tests pass without behavioral changes.
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: noDocumentation