Rui Fan created FLINK-40359:
-------------------------------

             Summary: Split FetchedChannelStateReader into drain-side and 
checkpoint-side interfaces
                 Key: FLINK-40359
                 URL: https://issues.apache.org/jira/browse/FLINK-40359
             Project: Flink
          Issue Type: Technical Debt
          Components: Runtime / Checkpointing
    Affects Versions: 2.4.0
            Reporter: Rui Fan
            Assignee: Rui Fan


FetchedChannelStateReader currently serves two call sites: the drain path, which
reads segments into the input channels, commits what it delivered and derives
snapshots; and the checkpoint path, which only replays the segments of a 
snapshot
into the checkpoint stream. commit() and snapshot() are meaningless on the
checkpoint path, but nothing prevents calling them — the rule only exists in
javadoc.

Proposal: a read-only interface for the checkpoint path, and a drain-side
interface extending it with commit() and snapshot(), so the constraint is 
enforced
by the compiler. The implementation can stay shared (inheritance or 
encapsulation).

One thing to settle while implementing: commit() sits on SpillSegment, so hiding
it from the checkpoint path requires either a generic reader, a second segment
type, or moving commit() up onto the drain-side reader.

Refactoring only, no functional change.

 

More details can be found from 
https://github.com/apache/flink/pull/28661#discussion_r3693955957



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to