Class SlotProfile
java.lang.Object
org.apache.flink.runtime.clusterframework.types.SlotProfile
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 their
SlotContext against the slot profile and, potentially, further requirements.-
Method Summary
Modifier and TypeMethodDescriptionReturns the desired resource profile for the physical slot to host this task slot.Returns the desired allocation ids for the slot.Returns the preferred locations for the slot.Returns a set of all reserved allocation ids from the execution graph.Returns the desired resource profile for the task slot.static SlotProfilepriorAllocation(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.toString()
-
Method Details
-
getTaskResourceProfile
Returns the desired resource profile for the task slot. -
getPhysicalSlotResourceProfile
Returns the desired resource profile for the physical slot to host this task slot. -
getPreferredLocations
Returns the preferred locations for the slot. -
getPreferredAllocations
Returns the desired allocation ids for the slot. -
getReservedAllocations
Returns a set of all reserved allocation ids from the execution graph. It will used byPreviousAllocationSlotSelectionStrategyto 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
-
toString
-