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 their SlotContext against the slot profile and, potentially, further requirements.
  • Method Details

    • 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 by PreviousAllocationSlotSelectionStrategy 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 slot
      physicalSlotResourceProfile - specifying the required resources for the physical slot to host this task slot
      preferredLocations - specifying the preferred locations
      priorAllocations - specifying the prior allocations
      reservedAllocations - specifying all reserved allocations
      Returns:
      Slot profile with all the given information
    • toString

      public String toString()
      Overrides:
      toString in class Object