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 aSlotSelectionStrategythat 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 doublecalculateCandidateScore(int localWeigh, int hostLocalWeigh, Supplier<Double> taskExecutorUtilizationSupplier)static LocationPreferenceSlotSelectionStrategycreateDefault()static LocationPreferenceSlotSelectionStrategycreateEvenlySpreadOut()Optional<SlotSelectionStrategy.SlotInfoAndLocality>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.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: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.
-
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()
-
-