peiyu created FLINK-41652:
-----------------------------

             Summary: Replace main-code reflection into Flink internals with 
compat adapters
                 Key: FLINK-41652
                 URL: https://issues.apache.org/jira/browse/FLINK-41652
             Project: Flink
          Issue Type: Sub-task
          Components: Flink CDC
    Affects Versions: cdc-3.7.0
            Reporter: peiyu


h2. Purpose

Remove the silent upgrade breakage points: main code currently reflects into 
{{org.apache.flink}} internals. Fluss solves the same problem structurally - 
zero Flink-internal reflection in main code, all version sensitivity in the 
compatibility layer - and that is the shape this sub-task adopts.

h2. Changes

* The three-segment {{SinkWriterOperator}} reflection in the sink operators 
(3-arg / 4-arg constructor probing, setup visibility, private {{sinkWriter}} 
field) -> per-generation {{SinkWriterOperatorAdapter}} in the compat modules 
(same-package bridge: direct access to package-private / protected members, the 
remaining field reflection concentrated in one place).
* The composer's private-field reflection on 
{{StreamExecutionEnvironment.configuration}} -> per-generation 
{{StreamExecutionEnvironmentAdapter}}; the legacy {{addSource}} call sites 
route through it as well.
* Dead reflection removed by direct calls: {{MySqlSource.metricGroup}} and the 
{{PreTransformOperator}} {{Class.forName}} probe - both APIs are stable on both 
generations.
* Legacy {{SinkFunction}} / {{SourceFunction}} call sites (moved to the legacy 
subpackage by 2.x) route through {{StreamSinkAdapter}}; 
{{RuntimeContextAdapter}}'s signature narrowed to the minimal common interface.
* 8 call-site files and 7 new/adjusted adapter classes, 17 files in total.

h2. Non-goals

No bytecode-scan guard - neither Paimon nor Fluss carries such a test, and the 
adapters are the structural fix. No behavior change (side effect: the composer 
jar becomes byte-identical across generations).

h2. Verification

Dual-generation builds + unit tests of the affected modules; the reflection 
sites are gone from the built classes.

h2. Dependencies

After the compat-layer split (the adapters live in the common modules).



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to