Class PreviousAllocationSlotSelectionStrategy
java.lang.Object
org.apache.flink.runtime.jobmaster.slotpool.PreviousAllocationSlotSelectionStrategy
- All Implemented Interfaces:
SlotSelectionStrategy
public class PreviousAllocationSlotSelectionStrategy
extends Object
implements SlotSelectionStrategy
This class implements a
SlotSelectionStrategy that is based on previous allocations and
falls back to using location preference hints if there is no previous allocation.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.flink.runtime.jobmaster.slotpool.SlotSelectionStrategy
SlotSelectionStrategy.SlotInfoAndLocality -
Method Summary
Modifier and TypeMethodDescriptioncreate()create(SlotSelectionStrategy fallbackSlotSelectionStrategy) selectBestSlotForProfile(FreeSlotTracker freeSlotTracker, SlotProfile slotProfile) Selects the bestSlotInfow.r.t. a certain selection criterion from the provided list of available slots and considering the givenSlotProfilethat describes the requirements.
-
Method Details
-
selectBestSlotForProfile
public Optional<SlotSelectionStrategy.SlotInfoAndLocality> selectBestSlotForProfile(@Nonnull FreeSlotTracker freeSlotTracker, @Nonnull SlotProfile slotProfile) Description copied from interface:SlotSelectionStrategySelects the bestSlotInfow.r.t. a certain selection criterion from the provided list of available slots and considering the givenSlotProfilethat describes the requirements.- Specified by:
selectBestSlotForProfilein interfaceSlotSelectionStrategy- Parameters:
freeSlotTracker- a list of the available slots together with their remaining resources to select from.slotProfile- a slot profile, describing requirements for the slot selection.- Returns:
- the selected slot info with the corresponding locality hint.
-
create
-
create
public static PreviousAllocationSlotSelectionStrategy create(SlotSelectionStrategy fallbackSlotSelectionStrategy)
-