public enum LeastUtilizationSlotMatchingStrategy extends Enum<LeastUtilizationSlotMatchingStrategy> implements SlotMatchingStrategy
SlotMatchingStrategy
which picks a matching slot from a TaskExecutor with the least
utilization.Enum Constant and Description |
---|
INSTANCE |
Modifier and Type | Method and Description |
---|---|
<T extends TaskManagerSlotInformation> |
findMatchingSlot(ResourceProfile requestedProfile,
Collection<T> freeSlots,
java.util.function.Function<InstanceID,Integer> numberRegisteredSlotsLookup)
Finds a matching slot for the requested
ResourceProfile given the collection of free
slots and the total number of slots per TaskExecutor. |
static LeastUtilizationSlotMatchingStrategy |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static LeastUtilizationSlotMatchingStrategy[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final LeastUtilizationSlotMatchingStrategy INSTANCE
public static LeastUtilizationSlotMatchingStrategy[] values()
for (LeastUtilizationSlotMatchingStrategy c : LeastUtilizationSlotMatchingStrategy.values()) System.out.println(c);
public static LeastUtilizationSlotMatchingStrategy valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic <T extends TaskManagerSlotInformation> Optional<T> findMatchingSlot(ResourceProfile requestedProfile, Collection<T> freeSlots, java.util.function.Function<InstanceID,Integer> numberRegisteredSlotsLookup)
SlotMatchingStrategy
ResourceProfile
given the collection of free
slots and the total number of slots per TaskExecutor.findMatchingSlot
in interface SlotMatchingStrategy
requestedProfile
- to find a matching slot forfreeSlots
- collection of free slotsnumberRegisteredSlotsLookup
- lookup for the number of registered slotsOptional.empty()
if there is noneCopyright © 2014–2021 The Apache Software Foundation. All rights reserved.