Class SegmentPartitionFileWriter

java.lang.Object
org.apache.flink.runtime.io.network.partition.hybrid.tiered.file.SegmentPartitionFileWriter
All Implemented Interfaces:
PartitionFileWriter

public class SegmentPartitionFileWriter extends Object implements PartitionFileWriter
The implementation of PartitionFileWriter with segment file mode. In this mode, each segment of one subpartition is written to an independent file.

After finishing writing a segment, a segment-finish file is written to ensure the downstream reads only when the entire segment file is written, avoiding partial data reads. The downstream can determine if the current segment is complete by checking for the existence of the segment-finish file.

To minimize the number of files, each subpartition keeps only a single segment-finish file. For instance, if segment-finish file 5 exists, it indicates that segments 1 to 5 have all been finished.