public interface SchedulingStrategy
SlotProfilethat produced the matcher object. A matching candidate is transformed into a desired result. If the matcher does not find a matching candidate, it returns null.
|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 <IN,OUT> OUT findMatchWithLocality(@Nonnull SlotProfile slotProfile, @Nonnull java.util.stream.Stream<IN> candidates, @Nonnull java.util.function.Function<IN,SlotContext> 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.
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.