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, ScheduledExecutor scheduledExecutor)
-
Method Summary
-
-
-
Constructor Detail
-
ResultPartitionManager
@VisibleForTesting public ResultPartitionManager()
-
ResultPartitionManager
public ResultPartitionManager(int partitionListenerTimeout, ScheduledExecutor scheduledExecutor)
-
-
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:ResultPartitionProvider
Returns the requested intermediate result partition input view.- Specified by:
createSubpartitionView
in interfaceResultPartitionProvider
- Throws:
IOException
-
createSubpartitionViewOrRegisterListener
public Optional<ResultSubpartitionView> createSubpartitionViewOrRegisterListener(ResultPartitionID partitionId, ResultSubpartitionIndexSet subpartitionIndexSet, BufferAvailabilityListener availabilityListener, PartitionRequestListener partitionRequestListener) throws IOException
Description copied from interface:ResultPartitionProvider
If the upstream task's partition has been registered, returns the result subpartition input view immediately, otherwise register the listener and return empty.- Specified by:
createSubpartitionViewOrRegisterListener
in 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:ResultPartitionProvider
Release the given listener in this result partition provider.- Specified by:
releasePartitionRequestListener
in 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)
-
-