Class LocationPreferenceSlotSelectionStrategy
- java.lang.Object
-
- org.apache.flink.runtime.jobmaster.slotpool.LocationPreferenceSlotSelectionStrategy
-
- All Implemented Interfaces:
SlotSelectionStrategy
public abstract class LocationPreferenceSlotSelectionStrategy extends Object implements SlotSelectionStrategy
This class implements aSlotSelectionStrategy
that is based on location preference hints.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.flink.runtime.jobmaster.slotpool.SlotSelectionStrategy
SlotSelectionStrategy.SlotInfoAndLocality
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract double
calculateCandidateScore(int localWeigh, int hostLocalWeigh, Supplier<Double> taskExecutorUtilizationSupplier)
static LocationPreferenceSlotSelectionStrategy
createDefault()
static LocationPreferenceSlotSelectionStrategy
createEvenlySpreadOut()
Optional<SlotSelectionStrategy.SlotInfoAndLocality>
selectBestSlotForProfile(FreeSlotTracker freeSlotTracker, SlotProfile slotProfile)
Selects the bestSlotInfo
w.r.t. a certain selection criterion from the provided list of available slots and considering the givenSlotProfile
that describes the requirements.protected abstract Optional<SlotSelectionStrategy.SlotInfoAndLocality>
selectWithoutLocationPreference(FreeSlotTracker freeSlotTracker, ResourceProfile resourceProfile)
-
-
-
Method Detail
-
selectBestSlotForProfile
public Optional<SlotSelectionStrategy.SlotInfoAndLocality> selectBestSlotForProfile(@Nonnull FreeSlotTracker freeSlotTracker, @Nonnull SlotProfile slotProfile)
Description copied from interface:SlotSelectionStrategy
Selects the bestSlotInfo
w.r.t. a certain selection criterion from the provided list of available slots and considering the givenSlotProfile
that describes the requirements.- Specified by:
selectBestSlotForProfile
in 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.
-
selectWithoutLocationPreference
@Nonnull protected abstract Optional<SlotSelectionStrategy.SlotInfoAndLocality> selectWithoutLocationPreference(@Nonnull FreeSlotTracker freeSlotTracker, @Nonnull ResourceProfile resourceProfile)
-
calculateCandidateScore
protected abstract double calculateCandidateScore(int localWeigh, int hostLocalWeigh, Supplier<Double> taskExecutorUtilizationSupplier)
-
createDefault
public static LocationPreferenceSlotSelectionStrategy createDefault()
-
createEvenlySpreadOut
public static LocationPreferenceSlotSelectionStrategy createEvenlySpreadOut()
-
-