public abstract class LocationPreferenceSlotSelectionStrategy extends Object implements SlotSelectionStrategy
SlotSelectionStrategy
that is based on location preference hints.SlotSelectionStrategy.SlotInfoAndLocality
Modifier and Type | Method and Description |
---|---|
protected abstract double |
calculateCandidateScore(int localWeigh,
int hostLocalWeigh,
Supplier<Double> taskExecutorUtilizationSupplier) |
static LocationPreferenceSlotSelectionStrategy |
createDefault() |
static LocationPreferenceSlotSelectionStrategy |
createEvenlySpreadOut() |
Optional<SlotSelectionStrategy.SlotInfoAndLocality> |
selectBestSlotForProfile(FreeSlotInfoTracker freeSlotInfoTracker,
SlotProfile slotProfile)
Selects the best
SlotInfo w.r.t. a certain selection criterion from the provided list
of available slots and considering the given SlotProfile that describes the
requirements. |
protected abstract Optional<SlotSelectionStrategy.SlotInfoAndLocality> |
selectWithoutLocationPreference(FreeSlotInfoTracker freeSlotInfoTracker,
ResourceProfile resourceProfile) |
public Optional<SlotSelectionStrategy.SlotInfoAndLocality> selectBestSlotForProfile(@Nonnull FreeSlotInfoTracker freeSlotInfoTracker, @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
freeSlotInfoTracker
- 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 FreeSlotInfoTracker freeSlotInfoTracker, @Nonnull ResourceProfile resourceProfile)
protected abstract double calculateCandidateScore(int localWeigh, int hostLocalWeigh, Supplier<Double> taskExecutorUtilizationSupplier)
public static LocationPreferenceSlotSelectionStrategy createDefault()
public static LocationPreferenceSlotSelectionStrategy createEvenlySpreadOut()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.