Class TieredStorageNettyServiceImpl
- java.lang.Object
-
- org.apache.flink.runtime.io.network.partition.hybrid.tiered.netty.TieredStorageNettyServiceImpl
-
- All Implemented Interfaces:
TieredStorageNettyService
public class TieredStorageNettyServiceImpl extends Object implements TieredStorageNettyService
The default implementation ofTieredStorageNettyService
.
-
-
Constructor Summary
Constructors Constructor Description TieredStorageNettyServiceImpl(TieredStorageResourceRegistry resourceRegistry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResultSubpartitionView
createResultSubpartitionView(TieredStoragePartitionId partitionId, TieredStorageSubpartitionId subpartitionId, BufferAvailabilityListener availabilityListener)
Create aResultSubpartitionView
for the netty server.CompletableFuture<NettyConnectionReader>
registerConsumer(TieredStoragePartitionId partitionId, TieredStorageSubpartitionId subpartitionId)
TierConsumerAgent
will register toTieredStorageNettyService
and get a future ofNettyConnectionReader
.void
registerProducer(TieredStoragePartitionId partitionId, NettyServiceProducer serviceProducer)
TierProducerAgent
will provide a callback namedNettyServiceProducer
to register toTieredStorageNettyService
.void
setupInputChannels(List<TieredStorageConsumerSpec> tieredStorageConsumerSpecs, List<Supplier<InputChannel>> inputChannelProviders)
Set up input channels inSingleInputGate
.
-
-
-
Constructor Detail
-
TieredStorageNettyServiceImpl
public TieredStorageNettyServiceImpl(TieredStorageResourceRegistry resourceRegistry)
-
-
Method Detail
-
registerProducer
public void registerProducer(TieredStoragePartitionId partitionId, NettyServiceProducer serviceProducer)
Description copied from interface:TieredStorageNettyService
TierProducerAgent
will provide a callback namedNettyServiceProducer
to register toTieredStorageNettyService
.- Specified by:
registerProducer
in interfaceTieredStorageNettyService
- Parameters:
partitionId
- partition id indicates the unique id ofTieredResultPartition
.serviceProducer
- serviceProducer is a callback fromTierProducerAgent
and used to register aNettyConnectionWriter
and disconnect the netty connection.
-
registerConsumer
public CompletableFuture<NettyConnectionReader> registerConsumer(TieredStoragePartitionId partitionId, TieredStorageSubpartitionId subpartitionId)
Description copied from interface:TieredStorageNettyService
TierConsumerAgent
will register toTieredStorageNettyService
and get a future ofNettyConnectionReader
.- Specified by:
registerConsumer
in interfaceTieredStorageNettyService
- Parameters:
partitionId
- partition id indicates the unique id ofTieredResultPartition
.subpartitionId
- subpartition id indicates the unique id of subpartition.- Returns:
- the future of netty connection reader.
-
createResultSubpartitionView
public ResultSubpartitionView createResultSubpartitionView(TieredStoragePartitionId partitionId, TieredStorageSubpartitionId subpartitionId, BufferAvailabilityListener availabilityListener)
Create aResultSubpartitionView
for the netty server.- Parameters:
partitionId
- partition id indicates the unique id ofTieredResultPartition
.subpartitionId
- subpartition id indicates the unique id of subpartition.availabilityListener
- listener is used to listen the available status of data.- Returns:
- the
TieredStorageResultSubpartitionView
.
-
setupInputChannels
public void setupInputChannels(List<TieredStorageConsumerSpec> tieredStorageConsumerSpecs, List<Supplier<InputChannel>> inputChannelProviders)
Set up input channels inSingleInputGate
. The method will be invoked by the pekko rpc thread at first, and then the methodTieredStorageNettyService.registerConsumer(TieredStoragePartitionId, TieredStorageSubpartitionId)
will be invoked by the same thread sequentially, which ensures thread safety.- Parameters:
tieredStorageConsumerSpecs
- specs indicatesTieredResultPartition
andTieredStorageSubpartitionId
.inputChannelProviders
- it provides input channels for subpartitions.
-
-