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)
SlotAllocatorcalculateRequiredSlots in interface SlotAllocatorvertices - vertices to schedulepublic Optional<VertexParallelismWithSlotSharing> determineParallelism(JobInformation jobInformation, Collection<? extends SlotInfo> freeSlots)
SlotAllocatorSlotAllocator.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 SlotAllocatorjobInformation - information about the job graphfreeSlots - slots to consider for determining the parallelismpublic Optional<ReservedSlots> tryReserveResources(VertexParallelism vertexParallelism)
SlotAllocatorOptional.empty().tryReserveResources in interface SlotAllocatorvertexParallelism - information on how slots should be assigned to the slotsOptional.empty()Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.