Class DefaultFreeSlotTracker
java.lang.Object
org.apache.flink.runtime.jobmaster.slotpool.DefaultFreeSlotTracker
- All Implemented Interfaces:
FreeSlotTracker
Default implements of
FreeSlotTracker.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultFreeSlotTracker(Set<AllocationID> freeSlots, Function<AllocationID, PhysicalSlot> physicalSlotLookup, Function<AllocationID, AllocatedSlotPool.FreeSlotInfo> freeSlotInfoLookup, Function<ResourceID, Double> taskExecutorUtilizationLookup) -
Method Summary
Modifier and TypeMethodDescriptioncreateNewFreeSlotTrackerWithoutBlockedSlots(Set<AllocationID> blockedSlots) Create a new free slot tracker without blocked slots.Get allocation id of all available slots.Returns a list ofPhysicalSlotobjects about all slots that are currently available in the slot pool.Returns a list ofAllocatedSlotPool.FreeSlotInfoobjects about all slots with slot idle since that are currently available in the slot pool.getSlotInfo(AllocationID allocationId) Get slot info by allocation id, this slot must exist.doublegetTaskExecutorUtilization(SlotInfo slotInfo) Get task executor utilization of this slot.voidreserveSlot(AllocationID allocationId) Reserve free slot when it is used.
-
Constructor Details
-
DefaultFreeSlotTracker
public DefaultFreeSlotTracker(Set<AllocationID> freeSlots, Function<AllocationID, PhysicalSlot> physicalSlotLookup, Function<AllocationID, AllocatedSlotPool.FreeSlotInfo> freeSlotInfoLookup, Function<ResourceID, Double> taskExecutorUtilizationLookup)
-
-
Method Details
-
getAvailableSlots
Description copied from interface:FreeSlotTrackerGet allocation id of all available slots.- Specified by:
getAvailableSlotsin interfaceFreeSlotTracker- Returns:
- allocation id of available slots
-
getSlotInfo
Description copied from interface:FreeSlotTrackerGet slot info by allocation id, this slot must exist.- Specified by:
getSlotInfoin interfaceFreeSlotTracker- Parameters:
allocationId- to get SlotInfo- Returns:
- slot info for the allocation id
-
getFreeSlotsWithIdleSinceInformation
Description copied from interface:FreeSlotTrackerReturns a list ofAllocatedSlotPool.FreeSlotInfoobjects about all slots with slot idle since that are currently available in the slot pool.- Specified by:
getFreeSlotsWithIdleSinceInformationin interfaceFreeSlotTracker- Returns:
- a list of
AllocatedSlotPool.FreeSlotInfoobjects about all slots with slot idle since that are currently available in the slot pool.
-
getFreeSlotsInformation
Description copied from interface:FreeSlotTrackerReturns a list ofPhysicalSlotobjects about all slots that are currently available in the slot pool.- Specified by:
getFreeSlotsInformationin interfaceFreeSlotTracker- Returns:
- a list of
PhysicalSlotobjects about all slots that are currently available in the slot pool.
-
getTaskExecutorUtilization
Description copied from interface:FreeSlotTrackerGet task executor utilization of this slot.- Specified by:
getTaskExecutorUtilizationin interfaceFreeSlotTracker- Parameters:
slotInfo- to get task executor utilization- Returns:
- task executor utilization of this slot
-
reserveSlot
Description copied from interface:FreeSlotTrackerReserve free slot when it is used.- Specified by:
reserveSlotin interfaceFreeSlotTracker- Parameters:
allocationId- to reserve
-
createNewFreeSlotTrackerWithoutBlockedSlots
public DefaultFreeSlotTracker createNewFreeSlotTrackerWithoutBlockedSlots(Set<AllocationID> blockedSlots) Description copied from interface:FreeSlotTrackerCreate a new free slot tracker without blocked slots.- Specified by:
createNewFreeSlotTrackerWithoutBlockedSlotsin interfaceFreeSlotTracker- Parameters:
blockedSlots- slots that should not be used- Returns:
- the new free slot tracker
-