public class SlotSharingSlotAllocator extends Object implements SlotAllocator
SlotAllocator
implementation that supports slot sharing.Modifier and Type | Method and Description |
---|---|
ResourceCounter |
calculateRequiredSlots(Iterable<JobInformation.VertexInformation> vertices)
Calculates the total resources required for scheduling the given vertices.
|
static SlotSharingSlotAllocator |
createSlotSharingSlotAllocator(ReserveSlotFunction reserveSlot,
FreeSlotFunction freeSlotFunction,
IsSlotAvailableAndFreeFunction isSlotAvailableAndFreeFunction) |
Optional<VertexParallelismWithSlotSharing> |
determineParallelism(JobInformation jobInformation,
Collection<? extends SlotInfo> freeSlots)
Determines the parallelism at which the vertices could be scheduled given the collection of
slots.
|
Optional<ReservedSlots> |
tryReserveResources(VertexParallelism vertexParallelism)
Reserves slots according to the given assignment if possible.
|
public static SlotSharingSlotAllocator createSlotSharingSlotAllocator(ReserveSlotFunction reserveSlot, FreeSlotFunction freeSlotFunction, IsSlotAvailableAndFreeFunction isSlotAvailableAndFreeFunction)
public ResourceCounter calculateRequiredSlots(Iterable<JobInformation.VertexInformation> vertices)
SlotAllocator
calculateRequiredSlots
in interface SlotAllocator
vertices
- vertices to schedulepublic Optional<VertexParallelismWithSlotSharing> determineParallelism(JobInformation jobInformation, Collection<? extends SlotInfo> freeSlots)
SlotAllocator
SlotAllocator.calculateRequiredSlots(Iterable)
returned.
If a VertexParallelism
is returned then it covers all vertices contained in the
given job information.
Implementations of this method must be side-effect free. There is no guarantee that the
result of this method is ever passed to SlotAllocator.tryReserveResources(VertexParallelism)
.
determineParallelism
in interface SlotAllocator
jobInformation
- information about the job graphfreeSlots
- slots to consider for determining the parallelismpublic Optional<ReservedSlots> tryReserveResources(VertexParallelism vertexParallelism)
SlotAllocator
Optional.empty()
.tryReserveResources
in interface SlotAllocator
vertexParallelism
- information on how slots should be assigned to the slotsOptional.empty()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.