public class FineGrainedTaskManagerTracker extends Object
TaskManagerTracker
supporting fine-grained resource management.Constructor and Description |
---|
FineGrainedTaskManagerTracker() |
Modifier and Type | Method and Description |
---|---|
void |
addPendingTaskManager(PendingTaskManager pendingTaskManager)
Add a new pending task manager.
|
void |
addTaskManager(TaskExecutorConnection taskExecutorConnection,
ResourceProfile totalResourceProfile,
ResourceProfile defaultSlotResourceProfile)
Register a new task manager.
|
void |
addUnWantedTaskManager(InstanceID instanceId)
Add an unwanted task manager.
|
void |
clear()
Removes all state from the tracker.
|
void |
clearPendingAllocationsOfJob(JobID jobId)
Clear all previous pending slot allocation records for the given job.
|
Optional<TaskManagerSlotInformation> |
getAllocatedOrPendingSlot(AllocationID allocationId)
Get the
TaskManagerSlotInformation of the allocated slot with the given allocationId. |
ResourceProfile |
getFreeResource()
Get profile of total free resources.
|
ResourceProfile |
getFreeResourceOf(InstanceID instanceId)
Get profile of free resources from the TaskManager with the given instance id.
|
int |
getNumberFreeSlots()
Get total number of free slots.
|
int |
getNumberFreeSlotsOf(InstanceID instanceId)
Get number of free slots from the TaskManager with the given instance id.
|
int |
getNumberRegisteredSlots()
Get total number of registered slots.
|
int |
getNumberRegisteredSlotsOf(InstanceID instanceId)
Get number of registered slots from the TaskManager with the given instance id.
|
Map<JobID,ResourceCounter> |
getPendingAllocationsOfPendingTaskManager(PendingTaskManagerId pendingTaskManagerId)
Get the pending allocations of the given pending task manager.
|
ResourceProfile |
getPendingResource()
Get profile of total pending resources.
|
Collection<PendingTaskManager> |
getPendingTaskManagers()
Get all pending task managers.
|
Collection<PendingTaskManager> |
getPendingTaskManagersByTotalAndDefaultSlotResourceProfile(ResourceProfile totalResourceProfile,
ResourceProfile defaultSlotResourceProfile)
Get all pending task managers with given total and default slot profile.
|
ResourceProfile |
getRegisteredResource()
Get profile of total registered resources.
|
ResourceProfile |
getRegisteredResourceOf(InstanceID instanceId)
Get profile of registered resources from the TaskManager with the given instance id.
|
Optional<TaskManagerInfo> |
getRegisteredTaskManager(InstanceID instanceId)
Get the
TaskManagerInfo of a registered task manager with the given instanceId |
Collection<? extends TaskManagerInfo> |
getRegisteredTaskManagers()
Get the
TaskManagerInfo s of all registered task managers. |
Map<InstanceID,WorkerResourceSpec> |
getUnWantedTaskManager()
Get unwanted task managers.
|
void |
notifySlotStatus(AllocationID allocationId,
JobID jobId,
InstanceID instanceId,
ResourceProfile resourceProfile,
org.apache.flink.runtime.resourcemanager.slotmanager.SlotState slotState)
Notifies the tracker about the slot status.
|
Map<JobID,ResourceCounter> |
removePendingTaskManager(PendingTaskManagerId pendingTaskManagerId)
Remove a pending task manager and it associated allocation records.
|
void |
removeTaskManager(InstanceID instanceId)
Unregister a task manager with the given instance id.
|
void |
replaceAllPendingAllocations(Map<PendingTaskManagerId,Map<JobID,ResourceCounter>> pendingSlotAllocations)
Clear all previous pending slot allocation records if any, and record new pending slot
allocations.
|
public void replaceAllPendingAllocations(Map<PendingTaskManagerId,Map<JobID,ResourceCounter>> pendingSlotAllocations)
pendingSlotAllocations
- new pending slot allocations be recordedpublic void clearPendingAllocationsOfJob(JobID jobId)
jobId
- of the given jobpublic void addTaskManager(TaskExecutorConnection taskExecutorConnection, ResourceProfile totalResourceProfile, ResourceProfile defaultSlotResourceProfile)
taskExecutorConnection
- of the new task managertotalResourceProfile
- of the new task managerdefaultSlotResourceProfile
- of the new task managerpublic void removeTaskManager(InstanceID instanceId)
instanceId
- of the task managerpublic void addUnWantedTaskManager(InstanceID instanceId)
instanceId
- identifier of task manager.public Map<InstanceID,WorkerResourceSpec> getUnWantedTaskManager()
public void addPendingTaskManager(PendingTaskManager pendingTaskManager)
pendingTaskManager
- to be addedpublic Map<JobID,ResourceCounter> removePendingTaskManager(PendingTaskManagerId pendingTaskManagerId)
pendingTaskManagerId
- of the pending task managerpublic void notifySlotStatus(AllocationID allocationId, JobID jobId, InstanceID instanceId, ResourceProfile resourceProfile, org.apache.flink.runtime.resourcemanager.slotmanager.SlotState slotState)
allocationId
- of the slotjobId
- of the slotinstanceId
- of the slotresourceProfile
- of the slotslotState
- of the slotpublic Map<JobID,ResourceCounter> getPendingAllocationsOfPendingTaskManager(PendingTaskManagerId pendingTaskManagerId)
pendingTaskManagerId
- of the pending task managerpublic Collection<? extends TaskManagerInfo> getRegisteredTaskManagers()
TaskManagerInfo
s of all registered task managers.TaskManagerInfo
s of all registered task managers.public Optional<TaskManagerInfo> getRegisteredTaskManager(InstanceID instanceId)
TaskManagerInfo
of a registered task manager with the given instanceIdinstanceId
- of the task managerTaskManagerInfo
, if find, of the task managerpublic Optional<TaskManagerSlotInformation> getAllocatedOrPendingSlot(AllocationID allocationId)
TaskManagerSlotInformation
of the allocated slot with the given allocationId.allocationId
- of the slotTaskManagerSlotInformation
, if find, of the slotpublic Collection<PendingTaskManager> getPendingTaskManagers()
PendingTaskManager
s.public Collection<PendingTaskManager> getPendingTaskManagersByTotalAndDefaultSlotResourceProfile(ResourceProfile totalResourceProfile, ResourceProfile defaultSlotResourceProfile)
totalResourceProfile
- of the pending task managerdefaultSlotResourceProfile
- of the pending task managerpublic int getNumberRegisteredSlots()
ClusterResourceStatisticsProvider
public int getNumberRegisteredSlotsOf(InstanceID instanceId)
ClusterResourceStatisticsProvider
public int getNumberFreeSlots()
ClusterResourceStatisticsProvider
public int getNumberFreeSlotsOf(InstanceID instanceId)
ClusterResourceStatisticsProvider
public ResourceProfile getRegisteredResource()
ClusterResourceStatisticsProvider
public ResourceProfile getRegisteredResourceOf(InstanceID instanceId)
ClusterResourceStatisticsProvider
public ResourceProfile getFreeResource()
ClusterResourceStatisticsProvider
public ResourceProfile getFreeResourceOf(InstanceID instanceId)
ClusterResourceStatisticsProvider
public ResourceProfile getPendingResource()
ClusterResourceStatisticsProvider
public void clear()
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.