|Modifier and Type||Method and Description|
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.
@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)
IN- 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 slot
candidates- stream of candidates to match against.
contextExtractor- function to extract the
SlotContextfrom 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–2020 The Apache Software Foundation. All rights reserved.