Class SlotProfile
- java.lang.Object
-
- org.apache.flink.runtime.clusterframework.types.SlotProfile
-
public class SlotProfile extends Object
A slot profile describes the profile of a slot into which a task wants to be scheduled. The profile contains attributes such as resource or locality constraints, some of which may be hard or soft. It also contains the information of resources for the physical slot to host this task slot, which can be used to allocate a physical slot when no physical slot is available for this task slot. A matcher can be generated to filter out candidate slots by matching theirSlotContext
against the slot profile and, potentially, further requirements.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ResourceProfile
getPhysicalSlotResourceProfile()
Returns the desired resource profile for the physical slot to host this task slot.Collection<AllocationID>
getPreferredAllocations()
Returns the desired allocation ids for the slot.Collection<TaskManagerLocation>
getPreferredLocations()
Returns the preferred locations for the slot.Set<AllocationID>
getReservedAllocations()
Returns a set of all reserved allocation ids from the execution graph.ResourceProfile
getTaskResourceProfile()
Returns the desired resource profile for the task slot.static SlotProfile
priorAllocation(ResourceProfile taskResourceProfile, ResourceProfile physicalSlotResourceProfile, Collection<TaskManagerLocation> preferredLocations, Collection<AllocationID> priorAllocations, Set<AllocationID> reservedAllocations)
Returns a slot profile for the given resource profile, prior allocations and all prior allocation ids from the whole execution graph.String
toString()
-
-
-
Method Detail
-
getTaskResourceProfile
public ResourceProfile getTaskResourceProfile()
Returns the desired resource profile for the task slot.
-
getPhysicalSlotResourceProfile
public ResourceProfile getPhysicalSlotResourceProfile()
Returns the desired resource profile for the physical slot to host this task slot.
-
getPreferredLocations
public Collection<TaskManagerLocation> getPreferredLocations()
Returns the preferred locations for the slot.
-
getPreferredAllocations
public Collection<AllocationID> getPreferredAllocations()
Returns the desired allocation ids for the slot.
-
getReservedAllocations
public Set<AllocationID> getReservedAllocations()
Returns a set of all reserved allocation ids from the execution graph. It will used byPreviousAllocationSlotSelectionStrategy
to support local recovery. In this case, a vertex cannot take an reserved allocation unless it exactly prefers that allocation.This is optional and can be empty if unused.
-
priorAllocation
public static SlotProfile priorAllocation(ResourceProfile taskResourceProfile, ResourceProfile physicalSlotResourceProfile, Collection<TaskManagerLocation> preferredLocations, Collection<AllocationID> priorAllocations, Set<AllocationID> reservedAllocations)
Returns a slot profile for the given resource profile, prior allocations and all prior allocation ids from the whole execution graph.- Parameters:
taskResourceProfile
- specifying the required resources for the task slotphysicalSlotResourceProfile
- specifying the required resources for the physical slot to host this task slotpreferredLocations
- specifying the preferred locationspriorAllocations
- specifying the prior allocationsreservedAllocations
- specifying all reserved allocations- Returns:
- Slot profile with all the given information
-
-