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 a
SlotSelectionStrategy 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
Modifier and TypeMethodDescriptionprotected abstract doublecalculateCandidateScore(int localWeigh, int hostLocalWeigh, Supplier<Double> taskExecutorUtilizationSupplier) 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 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.
-
selectWithoutLocationPreference
@Nonnull protected abstract Optional<SlotSelectionStrategy.SlotInfoAndLocality> selectWithoutLocationPreference(@Nonnull FreeSlotTracker freeSlotTracker, @Nonnull ResourceProfile resourceProfile) -
calculateCandidateScore
-
createDefault
-
createEvenlySpreadOut
-