public class DefaultSlotTracker extends Object
Constructor and Description |
---|
DefaultSlotTracker() |
Modifier and Type | Method and Description |
---|---|
void |
addSlot(SlotID slotId,
ResourceProfile resourceProfile,
TaskExecutorConnection taskManagerConnection,
JobID assignedJob)
Adds the given slot to this tracker.
|
Collection<TaskManagerSlotInformation> |
getFreeSlots()
Returns a view over free slots.
|
Collection<TaskExecutorConnection> |
getTaskExecutorsWithAllocatedSlotsForJob(JobID jobId)
Returns all task executors that have at least 1 pending/completed allocation for the given
job.
|
void |
notifyAllocationComplete(SlotID slotId,
JobID jobId)
Notifies the tracker that the allocation for the given slot, for the given job, has completed
successfully.
|
void |
notifyAllocationStart(SlotID slotId,
JobID jobId)
Notifies the tracker that the allocation for the given slot, for the given job, has started.
|
void |
notifyFree(SlotID slotId)
Notifies the tracker that the given slot was freed.
|
boolean |
notifySlotStatus(Iterable<SlotStatus> slotStatuses)
Notifies the tracker about the slot statuses.
|
void |
registerSlotStatusUpdateListener(org.apache.flink.runtime.resourcemanager.slotmanager.SlotStatusUpdateListener slotStatusUpdateListener)
Registers the given listener with this tracker.
|
void |
removeSlots(Iterable<SlotID> slotsToRemove)
Removes the given set of slots from the slot manager.
|
public void registerSlotStatusUpdateListener(org.apache.flink.runtime.resourcemanager.slotmanager.SlotStatusUpdateListener slotStatusUpdateListener)
slotStatusUpdateListener
- listener to registerpublic void addSlot(SlotID slotId, ResourceProfile resourceProfile, TaskExecutorConnection taskManagerConnection, @Nullable JobID assignedJob)
slotId
- ID of the slotresourceProfile
- resource of the slottaskManagerConnection
- connection to the hosting task executorassignedJob
- job that the slot is allocated for, or null if it is freepublic void removeSlots(Iterable<SlotID> slotsToRemove)
slotsToRemove
- identifying the slots to remove from the slot managerpublic void notifyFree(SlotID slotId)
slotId
- slot being freedpublic void notifyAllocationStart(SlotID slotId, JobID jobId)
slotId
- slot being allocatedjobId
- job for which the slot is being allocatedpublic void notifyAllocationComplete(SlotID slotId, JobID jobId)
slotId
- slot being allocatedjobId
- job for which the slot is being allocatedpublic boolean notifySlotStatus(Iterable<SlotStatus> slotStatuses)
slotStatuses
- slot statuespublic Collection<TaskManagerSlotInformation> getFreeSlots()
public Collection<TaskExecutorConnection> getTaskExecutorsWithAllocatedSlotsForJob(JobID jobId)
jobId
- the job for which the task executors must have a slotCopyright © 2014–2023 The Apache Software Foundation. All rights reserved.