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,
boolean localRecoveryEnabled) |
Optional<VertexParallelism> |
determineParallelism(JobInformation jobInformation,
Collection<? extends SlotInfo> freeSlots)
Determines the parallelism at which the vertices could be scheduled given the collection of
slots.
|
Optional<JobSchedulingPlan> |
determineParallelismAndCalculateAssignment(JobInformation jobInformation,
Collection<? extends SlotInfo> slots,
JobAllocationsInformation jobAllocationsInformation)
Same as
SlotAllocator.determineParallelism(JobInformation, Collection) but additionally determine
assignment of slots to execution slot sharing groups. |
Optional<ReservedSlots> |
tryReserveResources(JobSchedulingPlan jobSchedulingPlan)
Reserves slots according to the given assignment if possible.
|
public static SlotSharingSlotAllocator createSlotSharingSlotAllocator(ReserveSlotFunction reserveSlot, FreeSlotFunction freeSlotFunction, IsSlotAvailableAndFreeFunction isSlotAvailableAndFreeFunction, boolean localRecoveryEnabled)
public ResourceCounter calculateRequiredSlots(Iterable<JobInformation.VertexInformation> vertices)
SlotAllocator
calculateRequiredSlots
in interface SlotAllocator
vertices
- vertices to schedulepublic Optional<VertexParallelism> 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(JobSchedulingPlan)
.
determineParallelism
in interface SlotAllocator
jobInformation
- information about the job graphfreeSlots
- slots to consider for determining the parallelismpublic Optional<JobSchedulingPlan> determineParallelismAndCalculateAssignment(JobInformation jobInformation, Collection<? extends SlotInfo> slots, JobAllocationsInformation jobAllocationsInformation)
SlotAllocator
SlotAllocator.determineParallelism(JobInformation, Collection)
but additionally determine
assignment of slots to execution slot sharing groups.determineParallelismAndCalculateAssignment
in interface SlotAllocator
public Optional<ReservedSlots> tryReserveResources(JobSchedulingPlan jobSchedulingPlan)
SlotAllocator
Optional.empty()
.tryReserveResources
in interface SlotAllocator
jobSchedulingPlan
- information on how slots should be assigned to the slotsOptional.empty()
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.