Class FineGrainedTaskManagerTracker
- java.lang.Object
-
- org.apache.flink.runtime.resourcemanager.slotmanager.FineGrainedTaskManagerTracker
-
- All Implemented Interfaces:
ClusterResourceStatisticsProvider
public class FineGrainedTaskManagerTracker extends Object
Implementation ofTaskManagerTrackersupporting fine-grained resource management.
-
-
Constructor Summary
Constructors Constructor Description FineGrainedTaskManagerTracker()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPendingTaskManager(PendingTaskManager pendingTaskManager)voidaddTaskManager(TaskExecutorConnection taskExecutorConnection, ResourceProfile totalResourceProfile, ResourceProfile defaultSlotResourceProfile)voidaddUnWantedTaskManager(InstanceID instanceId)voidclear()voidclearPendingAllocationsOfJob(org.apache.flink.api.common.JobID jobId)Optional<TaskManagerSlotInformation>getAllocatedOrPendingSlot(AllocationID allocationId)ResourceProfilegetFreeResource()Get profile of total free resources.ResourceProfilegetFreeResourceOf(InstanceID instanceId)Get profile of free resources from the TaskManager with the given instance id.intgetNumberFreeSlots()Get total number of free slots.intgetNumberFreeSlotsOf(InstanceID instanceId)Get number of free slots from the TaskManager with the given instance id.intgetNumberRegisteredSlots()Get total number of registered slots.intgetNumberRegisteredSlotsOf(InstanceID instanceId)Get number of registered slots from the TaskManager with the given instance id.ResourceProfilegetPendingResource()Get profile of total pending resources.Collection<PendingTaskManager>getPendingTaskManagers()Collection<PendingTaskManager>getPendingTaskManagersByTotalAndDefaultSlotResourceProfile(ResourceProfile totalResourceProfile, ResourceProfile defaultSlotResourceProfile)ResourceProfilegetRegisteredResource()Get profile of total registered resources.ResourceProfilegetRegisteredResourceOf(InstanceID instanceId)Get profile of registered resources from the TaskManager with the given instance id.Optional<TaskManagerInfo>getRegisteredTaskManager(InstanceID instanceId)Collection<? extends TaskManagerInfo>getRegisteredTaskManagers()Collection<TaskManagerInfo>getTaskManagersWithAllocatedSlotsForJob(org.apache.flink.api.common.JobID jobId)Map<InstanceID,WorkerResourceSpec>getUnWantedTaskManager()voidnotifySlotStatus(AllocationID allocationId, org.apache.flink.api.common.JobID jobId, InstanceID instanceId, ResourceProfile resourceProfile, org.apache.flink.runtime.resourcemanager.slotmanager.SlotState slotState)Map<org.apache.flink.api.common.JobID,ResourceCounter>removePendingTaskManager(PendingTaskManagerId pendingTaskManagerId)voidremoveTaskManager(InstanceID instanceId)voidreplaceAllPendingAllocations(Map<PendingTaskManagerId,Map<org.apache.flink.api.common.JobID,ResourceCounter>> pendingSlotAllocations)
-
-
-
Method Detail
-
replaceAllPendingAllocations
public void replaceAllPendingAllocations(Map<PendingTaskManagerId,Map<org.apache.flink.api.common.JobID,ResourceCounter>> pendingSlotAllocations)
-
clearPendingAllocationsOfJob
public void clearPendingAllocationsOfJob(org.apache.flink.api.common.JobID jobId)
-
addTaskManager
public void addTaskManager(TaskExecutorConnection taskExecutorConnection, ResourceProfile totalResourceProfile, ResourceProfile defaultSlotResourceProfile)
-
removeTaskManager
public void removeTaskManager(InstanceID instanceId)
-
addUnWantedTaskManager
public void addUnWantedTaskManager(InstanceID instanceId)
-
getUnWantedTaskManager
public Map<InstanceID,WorkerResourceSpec> getUnWantedTaskManager()
-
addPendingTaskManager
public void addPendingTaskManager(PendingTaskManager pendingTaskManager)
-
removePendingTaskManager
public Map<org.apache.flink.api.common.JobID,ResourceCounter> removePendingTaskManager(PendingTaskManagerId pendingTaskManagerId)
-
getTaskManagersWithAllocatedSlotsForJob
public Collection<TaskManagerInfo> getTaskManagersWithAllocatedSlotsForJob(org.apache.flink.api.common.JobID jobId)
-
notifySlotStatus
public void notifySlotStatus(AllocationID allocationId, org.apache.flink.api.common.JobID jobId, InstanceID instanceId, ResourceProfile resourceProfile, org.apache.flink.runtime.resourcemanager.slotmanager.SlotState slotState)
-
getRegisteredTaskManagers
public Collection<? extends TaskManagerInfo> getRegisteredTaskManagers()
-
getRegisteredTaskManager
public Optional<TaskManagerInfo> getRegisteredTaskManager(InstanceID instanceId)
-
getAllocatedOrPendingSlot
public Optional<TaskManagerSlotInformation> getAllocatedOrPendingSlot(AllocationID allocationId)
-
getPendingTaskManagers
public Collection<PendingTaskManager> getPendingTaskManagers()
-
getPendingTaskManagersByTotalAndDefaultSlotResourceProfile
public Collection<PendingTaskManager> getPendingTaskManagersByTotalAndDefaultSlotResourceProfile(ResourceProfile totalResourceProfile, ResourceProfile defaultSlotResourceProfile)
-
getNumberRegisteredSlots
public int getNumberRegisteredSlots()
Description copied from interface:ClusterResourceStatisticsProviderGet total number of registered slots.- Specified by:
getNumberRegisteredSlotsin interfaceClusterResourceStatisticsProvider
-
getNumberRegisteredSlotsOf
public int getNumberRegisteredSlotsOf(InstanceID instanceId)
Description copied from interface:ClusterResourceStatisticsProviderGet number of registered slots from the TaskManager with the given instance id.- Specified by:
getNumberRegisteredSlotsOfin interfaceClusterResourceStatisticsProvider
-
getNumberFreeSlots
public int getNumberFreeSlots()
Description copied from interface:ClusterResourceStatisticsProviderGet total number of free slots.- Specified by:
getNumberFreeSlotsin interfaceClusterResourceStatisticsProvider
-
getNumberFreeSlotsOf
public int getNumberFreeSlotsOf(InstanceID instanceId)
Description copied from interface:ClusterResourceStatisticsProviderGet number of free slots from the TaskManager with the given instance id.- Specified by:
getNumberFreeSlotsOfin interfaceClusterResourceStatisticsProvider
-
getRegisteredResource
public ResourceProfile getRegisteredResource()
Description copied from interface:ClusterResourceStatisticsProviderGet profile of total registered resources.- Specified by:
getRegisteredResourcein interfaceClusterResourceStatisticsProvider
-
getRegisteredResourceOf
public ResourceProfile getRegisteredResourceOf(InstanceID instanceId)
Description copied from interface:ClusterResourceStatisticsProviderGet profile of registered resources from the TaskManager with the given instance id.- Specified by:
getRegisteredResourceOfin interfaceClusterResourceStatisticsProvider
-
getFreeResource
public ResourceProfile getFreeResource()
Description copied from interface:ClusterResourceStatisticsProviderGet profile of total free resources.- Specified by:
getFreeResourcein interfaceClusterResourceStatisticsProvider
-
getFreeResourceOf
public ResourceProfile getFreeResourceOf(InstanceID instanceId)
Description copied from interface:ClusterResourceStatisticsProviderGet profile of free resources from the TaskManager with the given instance id.- Specified by:
getFreeResourceOfin interfaceClusterResourceStatisticsProvider
-
getPendingResource
public ResourceProfile getPendingResource()
Description copied from interface:ClusterResourceStatisticsProviderGet profile of total pending resources.- Specified by:
getPendingResourcein interfaceClusterResourceStatisticsProvider
-
clear
public void clear()
-
-