public class PreviousAllocationSlotSelectionStrategy extends Object implements SlotSelectionStrategy
SlotSelectionStrategy
that is based on previous allocations and
falls back to using location preference hints if there is no previous allocation.SlotSelectionStrategy.SlotInfoAndLocality, SlotSelectionStrategy.SlotInfoAndResources
Modifier and Type | Method and Description |
---|---|
static PreviousAllocationSlotSelectionStrategy |
create() |
static PreviousAllocationSlotSelectionStrategy |
create(SlotSelectionStrategy fallbackSlotSelectionStrategy) |
Optional<SlotSelectionStrategy.SlotInfoAndLocality> |
selectBestSlotForProfile(Collection<SlotSelectionStrategy.SlotInfoAndResources> availableSlots,
SlotProfile slotProfile)
Selects the best
SlotInfo w.r.t. |
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.public static PreviousAllocationSlotSelectionStrategy create()
public static PreviousAllocationSlotSelectionStrategy create(SlotSelectionStrategy fallbackSlotSelectionStrategy)
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.