Class DiskIOScheduler
java.lang.Object
org.apache.flink.runtime.io.network.partition.hybrid.tiered.tier.disk.DiskIOScheduler
- All Implemented Interfaces:
Runnable,BufferRecycler,NettyServiceProducer
public class DiskIOScheduler
extends Object
implements Runnable, BufferRecycler, NettyServiceProducer
The
DiskIOScheduler is a scheduler that controls the reading of data from shuffle files.
It ensures the correct order of buffers in each subpartition during file reading. The scheduler
implements the NettyServiceProducer interface to send the buffers to the Netty server
through the NettyConnectionWriter.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.flink.runtime.io.network.buffer.BufferRecycler
BufferRecycler.DummyBufferRecycler -
Constructor Summary
ConstructorsConstructorDescriptionDiskIOScheduler(TieredStoragePartitionId partitionId, BatchShuffleReadBufferPool bufferPool, ScheduledExecutorService ioExecutor, int maxRequestedBuffers, Duration bufferRequestTimeout, BiFunction<Integer, Integer, Integer> segmentIdGetter, PartitionFileReader partitionFileReader) -
Method Summary
Modifier and TypeMethodDescriptionvoidNettyConnectionWriterrelated to a connection id will be notified when the netty connection is broken.voidconnectionEstablished(TieredStorageSubpartitionId subpartitionId, NettyConnectionWriter nettyConnectionWriter) NettyConnectionWriterwill be created when a netty connection is established for a subpartition.voidrecycle(org.apache.flink.core.memory.MemorySegment segment) Recycles theMemorySegmentto its originalBufferPoolinstance.voidrelease()voidrun()
-
Constructor Details
-
DiskIOScheduler
public DiskIOScheduler(TieredStoragePartitionId partitionId, BatchShuffleReadBufferPool bufferPool, ScheduledExecutorService ioExecutor, int maxRequestedBuffers, Duration bufferRequestTimeout, BiFunction<Integer, Integer, Integer> segmentIdGetter, PartitionFileReader partitionFileReader)
-
-
Method Details
-
run
public void run() -
connectionEstablished
public void connectionEstablished(TieredStorageSubpartitionId subpartitionId, NettyConnectionWriter nettyConnectionWriter) Description copied from interface:NettyServiceProducerNettyConnectionWriterwill be created when a netty connection is established for a subpartition.- Specified by:
connectionEstablishedin interfaceNettyServiceProducer- Parameters:
subpartitionId- subpartition id indicates the id of subpartition.nettyConnectionWriter- writer is used to write buffers to netty connection.
-
connectionBroken
Description copied from interface:NettyServiceProducerNettyConnectionWriterrelated to a connection id will be notified when the netty connection is broken.- Specified by:
connectionBrokenin interfaceNettyServiceProducer- Parameters:
id- connection id is the id of connection.
-
recycle
public void recycle(org.apache.flink.core.memory.MemorySegment segment) Description copied from interface:BufferRecyclerRecycles theMemorySegmentto its originalBufferPoolinstance.- Specified by:
recyclein interfaceBufferRecycler- Parameters:
segment- The memory segment to be recycled.
-
release
public void release()
-