public class DiskIOScheduler extends Object implements Runnable, BufferRecycler, NettyServiceProducer
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.BufferRecycler.DummyBufferRecycler| Constructor and Description |
|---|
DiskIOScheduler(TieredStoragePartitionId partitionId,
BatchShuffleReadBufferPool bufferPool,
ScheduledExecutorService ioExecutor,
int maxRequestedBuffers,
java.time.Duration bufferRequestTimeout,
java.util.function.BiFunction<Integer,Integer,Integer> segmentIdGetter,
PartitionFileReader partitionFileReader) |
| Modifier and Type | Method and Description |
|---|---|
void |
connectionBroken(NettyConnectionId id)
NettyConnectionWriter related to a connection id will be notified when the netty
connection is broken. |
void |
connectionEstablished(TieredStorageSubpartitionId subpartitionId,
NettyConnectionWriter nettyConnectionWriter)
NettyConnectionWriter will be created when a netty connection is established for a
subpartition. |
void |
recycle(org.apache.flink.core.memory.MemorySegment segment)
Recycles the
MemorySegment to its original BufferPool instance. |
void |
release() |
void |
run() |
public DiskIOScheduler(TieredStoragePartitionId partitionId, BatchShuffleReadBufferPool bufferPool, ScheduledExecutorService ioExecutor, int maxRequestedBuffers, java.time.Duration bufferRequestTimeout, java.util.function.BiFunction<Integer,Integer,Integer> segmentIdGetter, PartitionFileReader partitionFileReader)
public void connectionEstablished(TieredStorageSubpartitionId subpartitionId, NettyConnectionWriter nettyConnectionWriter)
NettyServiceProducerNettyConnectionWriter will be created when a netty connection is established for a
subpartition.connectionEstablished in interface NettyServiceProducersubpartitionId - subpartition id indicates the id of subpartition.nettyConnectionWriter - writer is used to write buffers to netty connection.public void connectionBroken(NettyConnectionId id)
NettyServiceProducerNettyConnectionWriter related to a connection id will be notified when the netty
connection is broken.connectionBroken in interface NettyServiceProducerid - connection id is the id of connection.public void recycle(org.apache.flink.core.memory.MemorySegment segment)
BufferRecyclerMemorySegment to its original BufferPool instance.recycle in interface BufferRecyclersegment - The memory segment to be recycled.public void release()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.