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()
FreeSlotInfoTracker
getAvailableSlots
in interface FreeSlotInfoTracker
public SlotInfo getSlotInfo(AllocationID allocationId)
FreeSlotInfoTracker
getSlotInfo
in interface FreeSlotInfoTracker
allocationId
- to get SlotInfopublic Collection<AllocatedSlotPool.FreeSlotInfo> getFreeSlotsWithIdleSinceInformation()
FreeSlotInfoTracker
AllocatedSlotPool.FreeSlotInfo
objects about all slots with slot
idle since that are currently available in the slot pool.getFreeSlotsWithIdleSinceInformation
in interface FreeSlotInfoTracker
AllocatedSlotPool.FreeSlotInfo
objects about all slots with slot
idle since that are currently available in the slot pool.public Collection<SlotInfo> getFreeSlotsInformation()
FreeSlotInfoTracker
SlotInfo
objects about all slots that are currently available in
the slot pool.getFreeSlotsInformation
in interface FreeSlotInfoTracker
SlotInfo
objects about all slots that are currently available in
the slot pool.public double getTaskExecutorUtilization(SlotInfo slotInfo)
FreeSlotInfoTracker
getTaskExecutorUtilization
in interface FreeSlotInfoTracker
slotInfo
- to get task executor utilizationpublic void reserveSlot(AllocationID allocationId)
FreeSlotInfoTracker
reserveSlot
in interface FreeSlotInfoTracker
allocationId
- to reservepublic DefaultFreeSlotInfoTracker createNewFreeSlotInfoTrackerWithoutBlockedSlots(Set<AllocationID> blockedSlots)
FreeSlotInfoTracker
createNewFreeSlotInfoTrackerWithoutBlockedSlots
in interface FreeSlotInfoTracker
blockedSlots
- slots that should not be usedCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.