public class DefaultFreeSlotInfoTracker extends Object implements FreeSlotInfoTracker
FreeSlotInfoTracker.| Constructor and Description |
|---|
DefaultFreeSlotInfoTracker(Set<AllocationID> freeSlots,
java.util.function.Function<AllocationID,SlotInfo> slotInfoLookup,
java.util.function.Function<AllocationID,AllocatedSlotPool.FreeSlotInfo> freeSlotInfoLookup,
java.util.function.Function<ResourceID,Double> taskExecutorUtilizationLookup) |
| Modifier and Type | Method and Description |
|---|---|
DefaultFreeSlotInfoTracker |
createNewFreeSlotInfoTrackerWithoutBlockedSlots(Set<AllocationID> blockedSlots)
Create a new free slot tracker without blocked slots.
|
Set<AllocationID> |
getAvailableSlots()
Get allocation id of all available slots.
|
Collection<SlotInfo> |
getFreeSlotsInformation()
Returns a list of
SlotInfo objects about all slots that are currently available in
the slot pool. |
Collection<AllocatedSlotPool.FreeSlotInfo> |
getFreeSlotsWithIdleSinceInformation()
Returns a list of
AllocatedSlotPool.FreeSlotInfo objects about all slots with slot
idle since that are currently available in the slot pool. |
SlotInfo |
getSlotInfo(AllocationID allocationId)
Get slot info by allocation id, this slot must exist.
|
double |
getTaskExecutorUtilization(SlotInfo slotInfo)
Get task executor utilization of this slot.
|
void |
reserveSlot(AllocationID allocationId)
Reserve free slot when it is used.
|
public DefaultFreeSlotInfoTracker(Set<AllocationID> freeSlots, java.util.function.Function<AllocationID,SlotInfo> slotInfoLookup, java.util.function.Function<AllocationID,AllocatedSlotPool.FreeSlotInfo> freeSlotInfoLookup, java.util.function.Function<ResourceID,Double> taskExecutorUtilizationLookup)
public Set<AllocationID> getAvailableSlots()
FreeSlotInfoTrackergetAvailableSlots in interface FreeSlotInfoTrackerpublic SlotInfo getSlotInfo(AllocationID allocationId)
FreeSlotInfoTrackergetSlotInfo in interface FreeSlotInfoTrackerallocationId - to get SlotInfopublic Collection<AllocatedSlotPool.FreeSlotInfo> getFreeSlotsWithIdleSinceInformation()
FreeSlotInfoTrackerAllocatedSlotPool.FreeSlotInfo objects about all slots with slot
idle since that are currently available in the slot pool.getFreeSlotsWithIdleSinceInformation in interface FreeSlotInfoTrackerAllocatedSlotPool.FreeSlotInfo objects about all slots with slot
idle since that are currently available in the slot pool.public Collection<SlotInfo> getFreeSlotsInformation()
FreeSlotInfoTrackerSlotInfo objects about all slots that are currently available in
the slot pool.getFreeSlotsInformation in interface FreeSlotInfoTrackerSlotInfo objects about all slots that are currently available in
the slot pool.public double getTaskExecutorUtilization(SlotInfo slotInfo)
FreeSlotInfoTrackergetTaskExecutorUtilization in interface FreeSlotInfoTrackerslotInfo - to get task executor utilizationpublic void reserveSlot(AllocationID allocationId)
FreeSlotInfoTrackerreserveSlot in interface FreeSlotInfoTrackerallocationId - to reservepublic DefaultFreeSlotInfoTracker createNewFreeSlotInfoTrackerWithoutBlockedSlots(Set<AllocationID> blockedSlots)
FreeSlotInfoTrackercreateNewFreeSlotInfoTrackerWithoutBlockedSlots in interface FreeSlotInfoTrackerblockedSlots - slots that should not be usedCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.