Class SharingPhysicalSlotRequestBulk
- java.lang.Object
-
- org.apache.flink.runtime.scheduler.SharingPhysicalSlotRequestBulk
-
- All Implemented Interfaces:
PhysicalSlotRequestBulk
public class SharingPhysicalSlotRequestBulk extends Object implements PhysicalSlotRequestBulk
Implementation ofPhysicalSlotRequestBulk
forSlotSharingExecutionSlotAllocator
.The bulk tracks the pending and fulfilled requests by the
ExecutionSlotSharingGroup
for which the physical slot is being allocated.SlotSharingExecutionSlotAllocator
callsmarkFulfilled(ExecutionSlotSharingGroup, AllocationID)
to move a pending request to fulfilled.Additionally the bulk keeps execution lists for each
ExecutionSlotSharingGroup
they belong to. If thecancel(Throwable)
method is called (due to fulfillability check timeout inPhysicalSlotRequestBulkChecker
) then the bulk calls back theSlotSharingExecutionSlotAllocator
to cancel all logical slots requests for executions of all bulk'sExecutionSlotSharingGroup
s.
-
-
Constructor Summary
Constructors Constructor Description SharingPhysicalSlotRequestBulk(Map<ExecutionSlotSharingGroup,List<ExecutionVertexID>> executions, Map<ExecutionSlotSharingGroup,ResourceProfile> pendingRequests, BiConsumer<ExecutionVertexID,Throwable> logicalSlotRequestCanceller)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancel(Throwable cause)
Cancels all requests of this bulk.Set<AllocationID>
getAllocationIdsOfFulfilledRequests()
ReturnsAllocationID
s of fulfilled physical slot requests.Collection<ResourceProfile>
getPendingRequests()
ReturnsResourceProfile
s of pending physical slot requests.void
markFulfilled(ExecutionSlotSharingGroup group, AllocationID allocationId)
Moves a pending request to fulfilled.
-
-
-
Constructor Detail
-
SharingPhysicalSlotRequestBulk
public SharingPhysicalSlotRequestBulk(Map<ExecutionSlotSharingGroup,List<ExecutionVertexID>> executions, Map<ExecutionSlotSharingGroup,ResourceProfile> pendingRequests, BiConsumer<ExecutionVertexID,Throwable> logicalSlotRequestCanceller)
-
-
Method Detail
-
getPendingRequests
public Collection<ResourceProfile> getPendingRequests()
Description copied from interface:PhysicalSlotRequestBulk
ReturnsResourceProfile
s of pending physical slot requests.If a request is pending, it is not fulfilled and vice versa.
PhysicalSlotRequestBulk.getAllocationIdsOfFulfilledRequests()
should not return a pending request.- Specified by:
getPendingRequests
in interfacePhysicalSlotRequestBulk
-
getAllocationIdsOfFulfilledRequests
public Set<AllocationID> getAllocationIdsOfFulfilledRequests()
Description copied from interface:PhysicalSlotRequestBulk
ReturnsAllocationID
s of fulfilled physical slot requests.If a request is fulfilled, it is not pending and vice versa.
PhysicalSlotRequestBulk.getPendingRequests()
should not return a fulfilled request.- Specified by:
getAllocationIdsOfFulfilledRequests
in interfacePhysicalSlotRequestBulk
-
cancel
public void cancel(Throwable cause)
Description copied from interface:PhysicalSlotRequestBulk
Cancels all requests of this bulk.Canceled bulk is not valid and should not be used afterwards.
- Specified by:
cancel
in interfacePhysicalSlotRequestBulk
-
markFulfilled
public void markFulfilled(ExecutionSlotSharingGroup group, AllocationID allocationId)
Moves a pending request to fulfilled.- Parameters:
group
-ExecutionSlotSharingGroup
of the pending requestallocationId
-AllocationID
of the fulfilled request
-
-