Class RemoteTierConsumerAgent
- java.lang.Object
-
- org.apache.flink.runtime.io.network.partition.hybrid.tiered.tier.remote.RemoteTierConsumerAgent
-
- All Implemented Interfaces:
TierConsumerAgent
public class RemoteTierConsumerAgent extends Object implements TierConsumerAgent
The data client is used to fetch data from remote tier.
-
-
Constructor Summary
Constructors Constructor Description RemoteTierConsumerAgent(List<TieredStorageConsumerSpec> tieredStorageConsumerSpecs, RemoteStorageScanner remoteStorageScanner, PartitionFileReader partitionFileReader, int bufferSizeBytes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the consumer agent.Optional<Buffer>getNextBuffer(TieredStoragePartitionId partitionId, TieredStorageSubpartitionId subpartitionId, int segmentId)Get buffer from the consumer agent.voidnotifyAvailable(TieredStoragePartitionId partitionId, TieredStorageSubpartitionId subpartitionId)intpeekNextBufferSubpartitionId(TieredStoragePartitionId partitionId, ResultSubpartitionIndexSet indexSet)Returns the index of the subpartition where the next buffer locates, or -1 if there is no buffer available or the subpartition index does not belong to the specified indexSet.voidregisterAvailabilityNotifier(AvailabilityNotifier notifier)Register the notifier to notify the availability of a subpartition.voidsetup(TieredStorageMemoryManager memoryManager)The consumer agent may request buffers from the memory manager.voidstart()Start the consumer agent.voidupdateTierShuffleDescriptor(TieredStoragePartitionId partitionId, TieredStorageInputChannelId inputChannelId, TieredStorageSubpartitionId subpartitionId, TierShuffleDescriptor tierShuffleDescriptor)Update theTierShuffleDescriptorfor the consumer agent.
-
-
-
Constructor Detail
-
RemoteTierConsumerAgent
public RemoteTierConsumerAgent(List<TieredStorageConsumerSpec> tieredStorageConsumerSpecs, RemoteStorageScanner remoteStorageScanner, PartitionFileReader partitionFileReader, int bufferSizeBytes)
-
-
Method Detail
-
setup
public void setup(TieredStorageMemoryManager memoryManager)
Description copied from interface:TierConsumerAgentThe consumer agent may request buffers from the memory manager. Therefore, theTieredStorageMemoryManagershould be integrated into the tier consumer agent. Since the buffer pool is initialized after the creation of the client, the memory manager need to be assigned after the buffer pool becomes available.- Specified by:
setupin interfaceTierConsumerAgent
-
start
public void start()
Description copied from interface:TierConsumerAgentStart the consumer agent.- Specified by:
startin interfaceTierConsumerAgent
-
peekNextBufferSubpartitionId
public int peekNextBufferSubpartitionId(TieredStoragePartitionId partitionId, ResultSubpartitionIndexSet indexSet) throws IOException
Description copied from interface:TierConsumerAgentReturns the index of the subpartition where the next buffer locates, or -1 if there is no buffer available or the subpartition index does not belong to the specified indexSet.- Specified by:
peekNextBufferSubpartitionIdin interfaceTierConsumerAgent- Parameters:
partitionId- The index of the partition which the returned subpartition should belong to.indexSet- The indexes of the subpartitions expected.- Throws:
IOException
-
getNextBuffer
public Optional<Buffer> getNextBuffer(TieredStoragePartitionId partitionId, TieredStorageSubpartitionId subpartitionId, int segmentId)
Description copied from interface:TierConsumerAgentGet buffer from the consumer agent.- Specified by:
getNextBufferin interfaceTierConsumerAgent- Parameters:
partitionId- the id of partition.subpartitionId- the id of subpartition.segmentId- the id of segment.- Returns:
- buffer.
-
registerAvailabilityNotifier
public void registerAvailabilityNotifier(AvailabilityNotifier notifier)
Description copied from interface:TierConsumerAgentRegister the notifier to notify the availability of a subpartition.- Specified by:
registerAvailabilityNotifierin interfaceTierConsumerAgent- Parameters:
notifier- to notify availability.
-
updateTierShuffleDescriptor
public void updateTierShuffleDescriptor(TieredStoragePartitionId partitionId, TieredStorageInputChannelId inputChannelId, TieredStorageSubpartitionId subpartitionId, TierShuffleDescriptor tierShuffleDescriptor)
Description copied from interface:TierConsumerAgentUpdate theTierShuffleDescriptorfor the consumer agent.- Specified by:
updateTierShuffleDescriptorin interfaceTierConsumerAgent
-
close
public void close() throws IOExceptionDescription copied from interface:TierConsumerAgentClose the consumer agent.- Specified by:
closein interfaceTierConsumerAgent- Throws:
IOException
-
notifyAvailable
public void notifyAvailable(TieredStoragePartitionId partitionId, TieredStorageSubpartitionId subpartitionId)
-
-