Class RemoteTierConsumerAgent
- java.lang.Object
-
- org.apache.flink.runtime.io.network.partition.hybrid.tiered.tier.remote.RemoteTierConsumerAgent
-
- All Implemented Interfaces:
AvailabilityNotifier,TierConsumerAgent
public class RemoteTierConsumerAgent extends Object implements TierConsumerAgent, AvailabilityNotifier
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, TieredStorageInputChannelId inputChannelId)Notify that the data for the specific partition and input channel is available in tiered storage.voidnotifyAvailable(TieredStoragePartitionId partitionId, TieredStorageSubpartitionId subpartitionId)Notify that the data from the specific partition and subpartition is available in tiered storage.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.voidstart()Start the consumer agent.
-
-
-
Constructor Detail
-
RemoteTierConsumerAgent
public RemoteTierConsumerAgent(List<TieredStorageConsumerSpec> tieredStorageConsumerSpecs, RemoteStorageScanner remoteStorageScanner, PartitionFileReader partitionFileReader, int bufferSizeBytes)
-
-
Method Detail
-
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.
-
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)
Description copied from interface:AvailabilityNotifierNotify that the data from the specific partition and subpartition is available in tiered storage.- Specified by:
notifyAvailablein interfaceAvailabilityNotifier- Parameters:
partitionId- the partition id.subpartitionId- the subpartition id.
-
notifyAvailable
public void notifyAvailable(TieredStoragePartitionId partitionId, TieredStorageInputChannelId inputChannelId)
Description copied from interface:AvailabilityNotifierNotify that the data for the specific partition and input channel is available in tiered storage.- Specified by:
notifyAvailablein interfaceAvailabilityNotifier- Parameters:
partitionId- the partition id.inputChannelId- the input channel id.
-
-