Class SharingPhysicalSlotRequestBulk
- java.lang.Object
-
- org.apache.flink.runtime.scheduler.SharingPhysicalSlotRequestBulk
-
- All Implemented Interfaces:
PhysicalSlotRequestBulk
public class SharingPhysicalSlotRequestBulk extends Object implements PhysicalSlotRequestBulk
Implementation ofPhysicalSlotRequestBulkforSlotSharingExecutionSlotAllocator.The bulk tracks the pending and fulfilled requests by the
ExecutionSlotSharingGroupfor which the physical slot is being allocated.SlotSharingExecutionSlotAllocatorcallsmarkFulfilled(ExecutionSlotSharingGroup, AllocationID)to move a pending request to fulfilled.Additionally the bulk keeps execution lists for each
ExecutionSlotSharingGroupthey belong to. If thecancel(Throwable)method is called (due to fulfillability check timeout inPhysicalSlotRequestBulkChecker) then the bulk calls back theSlotSharingExecutionSlotAllocatorto cancel all logical slots requests for executions of all bulk'sExecutionSlotSharingGroups.
-
-
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 voidcancel(Throwable cause)Cancels all requests of this bulk.Set<AllocationID>getAllocationIdsOfFulfilledRequests()ReturnsAllocationIDs of fulfilled physical slot requests.Collection<ResourceProfile>getPendingRequests()ReturnsResourceProfiles of pending physical slot requests.voidmarkFulfilled(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:PhysicalSlotRequestBulkReturnsResourceProfiles 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:
getPendingRequestsin interfacePhysicalSlotRequestBulk
-
getAllocationIdsOfFulfilledRequests
public Set<AllocationID> getAllocationIdsOfFulfilledRequests()
Description copied from interface:PhysicalSlotRequestBulkReturnsAllocationIDs 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:
getAllocationIdsOfFulfilledRequestsin interfacePhysicalSlotRequestBulk
-
cancel
public void cancel(Throwable cause)
Description copied from interface:PhysicalSlotRequestBulkCancels all requests of this bulk.Canceled bulk is not valid and should not be used afterwards.
- Specified by:
cancelin interfacePhysicalSlotRequestBulk
-
markFulfilled
public void markFulfilled(ExecutionSlotSharingGroup group, AllocationID allocationId)
Moves a pending request to fulfilled.- Parameters:
group-ExecutionSlotSharingGroupof the pending requestallocationId-AllocationIDof the fulfilled request
-
-