public class PreviousAllocationSchedulingStrategy extends LocationPreferenceSchedulingStrategy
SchedulingStrategy which tries to match a slot with its previous AllocationID.
If the previous allocation cannot be found, then it returns null. If the slot has not
been scheduled before (no assigned allocation id), it will fall back to
LocationPreferenceSchedulingStrategy.| Modifier and Type | Method and Description |
|---|---|
<IN,OUT> OUT |
findMatchWithLocality(SlotProfile slotProfile,
java.util.function.Supplier<java.util.stream.Stream<IN>> candidates,
java.util.function.Function<IN,SlotInfo> contextExtractor,
java.util.function.Predicate<IN> additionalRequirementsFilter,
java.util.function.BiFunction<IN,Locality,OUT> resultProducer)
This method takes the candidate slots, extracts slot contexts from them, filters them by the profile
requirements and potentially by additional requirements, and produces a result from a match.
|
static PreviousAllocationSchedulingStrategy |
getInstance() |
doFindMatchWithLocality@Nullable public <IN,OUT> OUT findMatchWithLocality(@Nonnull SlotProfile slotProfile, @Nonnull java.util.function.Supplier<java.util.stream.Stream<IN>> candidates, @Nonnull java.util.function.Function<IN,SlotInfo> contextExtractor, @Nonnull java.util.function.Predicate<IN> additionalRequirementsFilter, @Nonnull java.util.function.BiFunction<IN,Locality,OUT> resultProducer)
SchedulingStrategyfindMatchWithLocality in interface SchedulingStrategyfindMatchWithLocality in class LocationPreferenceSchedulingStrategyIN - type of the objects against we match the profile.OUT - type of the produced output from a matching object.slotProfile - slotProfile for which to find a matching slotcandidates - stream of candidates to match against.contextExtractor - function to extract the SlotContext from the candidates.additionalRequirementsFilter - predicate to specify additional requirements for each candidate.resultProducer - function to produce a result from a matching candidate input.public static PreviousAllocationSchedulingStrategy getInstance()
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.