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 ResultSubpartitionViewcreateResultSubpartitionView(TieredStoragePartitionId partitionId, TieredStorageSubpartitionId subpartitionId, BufferAvailabilityListener availabilityListener)Create aResultSubpartitionViewfor the netty server.CompletableFuture<NettyConnectionReader>registerConsumer(TieredStoragePartitionId partitionId, TieredStorageSubpartitionId subpartitionId)TierConsumerAgentwill register toTieredStorageNettyServiceand get a future ofNettyConnectionReader.voidregisterProducer(TieredStoragePartitionId partitionId, NettyServiceProducer serviceProducer)TierProducerAgentwill provide a callback namedNettyServiceProducerto register toTieredStorageNettyService.voidsetupInputChannels(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:TieredStorageNettyServiceTierProducerAgentwill provide a callback namedNettyServiceProducerto register toTieredStorageNettyService.- Specified by:
registerProducerin interfaceTieredStorageNettyService- Parameters:
partitionId- partition id indicates the unique id ofTieredResultPartition.serviceProducer- serviceProducer is a callback fromTierProducerAgentand used to register aNettyConnectionWriterand disconnect the netty connection.
-
registerConsumer
public CompletableFuture<NettyConnectionReader> registerConsumer(TieredStoragePartitionId partitionId, TieredStorageSubpartitionId subpartitionId)
Description copied from interface:TieredStorageNettyServiceTierConsumerAgentwill register toTieredStorageNettyServiceand get a future ofNettyConnectionReader.- Specified by:
registerConsumerin 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 aResultSubpartitionViewfor 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 indicatesTieredResultPartitionandTieredStorageSubpartitionId.inputChannelProviders- it provides input channels for subpartitions.
-
-