public class SegmentPartitionFileWriter extends Object implements PartitionFileWriter
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.
PartitionFileWriter.SegmentBufferContext, PartitionFileWriter.SubpartitionBufferContext| 限定符和类型 | 方法和说明 |
|---|---|
void |
release()
Release all the resources of the
PartitionFileWriter. |
CompletableFuture<Void> |
write(TieredStoragePartitionId partitionId,
List<PartitionFileWriter.SubpartitionBufferContext> buffersToWrite)
Write the buffers to the partition file.
|
public CompletableFuture<Void> write(TieredStoragePartitionId partitionId, List<PartitionFileWriter.SubpartitionBufferContext> buffersToWrite)
PartitionFileWriterwrite 在接口中 PartitionFileWriterpartitionId - the partition idbuffersToWrite - the buffers to be written to the partition fileCompletableFuture is completed, the written process is completed.public void release()
PartitionFileWriterPartitionFileWriter.release 在接口中 PartitionFileWriterCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.