public abstract class LocationPreferenceSlotSelectionStrategy extends Object implements SlotSelectionStrategy
SlotSelectionStrategy
that is based on location preference hints.SlotSelectionStrategy.SlotInfoAndLocality, SlotSelectionStrategy.SlotInfoAndResources
Modifier and Type | Method and Description |
---|---|
protected abstract double |
calculateCandidateScore(int localWeigh,
int hostLocalWeigh,
double taskExecutorUtilization) |
static LocationPreferenceSlotSelectionStrategy |
createDefault() |
static LocationPreferenceSlotSelectionStrategy |
createEvenlySpreadOut() |
Optional<SlotSelectionStrategy.SlotInfoAndLocality> |
selectBestSlotForProfile(Collection<SlotSelectionStrategy.SlotInfoAndResources> availableSlots,
SlotProfile slotProfile)
Selects the best
SlotInfo w.r.t. |
protected abstract Optional<SlotSelectionStrategy.SlotInfoAndLocality> |
selectWithoutLocationPreference(Collection<SlotSelectionStrategy.SlotInfoAndResources> availableSlots,
ResourceProfile resourceProfile) |
public Optional<SlotSelectionStrategy.SlotInfoAndLocality> selectBestSlotForProfile(@Nonnull Collection<SlotSelectionStrategy.SlotInfoAndResources> availableSlots, @Nonnull SlotProfile slotProfile)
SlotSelectionStrategy
SlotInfo
w.r.t. a certain selection criterion from the provided list
of available slots and considering the given SlotProfile
that describes the
requirements.selectBestSlotForProfile
in interface SlotSelectionStrategy
availableSlots
- a list of the available slots together with their remaining resources
to select from.slotProfile
- a slot profile, describing requirements for the slot selection.@Nonnull protected abstract Optional<SlotSelectionStrategy.SlotInfoAndLocality> selectWithoutLocationPreference(@Nonnull Collection<SlotSelectionStrategy.SlotInfoAndResources> availableSlots, @Nonnull ResourceProfile resourceProfile)
protected abstract double calculateCandidateScore(int localWeigh, int hostLocalWeigh, double taskExecutorUtilization)
public static LocationPreferenceSlotSelectionStrategy createDefault()
public static LocationPreferenceSlotSelectionStrategy createEvenlySpreadOut()
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.