Class ResultPartitionManager
- java.lang.Object
-
- org.apache.flink.runtime.io.network.partition.ResultPartitionManager
-
- All Implemented Interfaces:
ResultPartitionProvider
public class ResultPartitionManager extends Object implements ResultPartitionProvider
The result partition manager keeps track of all currently produced/consumed partitions of a task manager.
-
-
Constructor Summary
Constructors Constructor Description ResultPartitionManager()ResultPartitionManager(int partitionListenerTimeout, org.apache.flink.util.concurrent.ScheduledExecutor scheduledExecutor)
-
Method Summary
-
-
-
Method Detail
-
registerResultPartition
public void registerResultPartition(ResultPartition partition) throws IOException
- Throws:
IOException
-
createSubpartitionView
public ResultSubpartitionView createSubpartitionView(ResultPartitionID partitionId, ResultSubpartitionIndexSet subpartitionIndexSet, BufferAvailabilityListener availabilityListener) throws IOException
Description copied from interface:ResultPartitionProviderReturns the requested intermediate result partition input view.- Specified by:
createSubpartitionViewin interfaceResultPartitionProvider- Throws:
IOException
-
createSubpartitionViewOrRegisterListener
public Optional<ResultSubpartitionView> createSubpartitionViewOrRegisterListener(ResultPartitionID partitionId, ResultSubpartitionIndexSet subpartitionIndexSet, BufferAvailabilityListener availabilityListener, PartitionRequestListener partitionRequestListener) throws IOException
Description copied from interface:ResultPartitionProviderIf the upstream task's partition has been registered, returns the result subpartition input view immediately, otherwise register the listener and return empty.- Specified by:
createSubpartitionViewOrRegisterListenerin interfaceResultPartitionProvider- Parameters:
partitionId- the result partition idsubpartitionIndexSet- the index setavailabilityListener- the buffer availability listenerpartitionRequestListener- the partition request listener- Returns:
- the result subpartition view
- Throws:
IOException- the thrown exception
-
releasePartitionRequestListener
public void releasePartitionRequestListener(PartitionRequestListener listener)
Description copied from interface:ResultPartitionProviderRelease the given listener in this result partition provider.- Specified by:
releasePartitionRequestListenerin interfaceResultPartitionProvider- Parameters:
listener- the given listener
-
releasePartition
public void releasePartition(ResultPartitionID partitionId, Throwable cause)
-
shutdown
public void shutdown()
-
getListenerManagers
@VisibleForTesting public Map<ResultPartitionID,PartitionRequestListenerManager> getListenerManagers()
-
getUnreleasedPartitions
public Collection<ResultPartitionID> getUnreleasedPartitions()
-
getMetricsOfPartition
public Optional<ShuffleMetrics> getMetricsOfPartition(ResultPartitionID partitionId)
-
-