public class DefaultAllocatedSlotPool extends Object implements AllocatedSlotPool
AllocatedSlotPool
implementation.AllocatedSlotPool.AllocatedSlotsAndReservationStatus, AllocatedSlotPool.FreeSlotInfo
Constructor and Description |
---|
DefaultAllocatedSlotPool() |
Modifier and Type | Method and Description |
---|---|
void |
addSlots(Collection<org.apache.flink.runtime.jobmaster.slotpool.AllocatedSlot> slots,
long currentTime)
Adds the given collection of slots to the slot pool.
|
boolean |
containsFreeSlot(AllocationID allocationId)
Checks whether the slot pool contains a slot with the given
AllocationID and if it is
free. |
boolean |
containsSlot(AllocationID allocationId)
Checks whether the slot pool contains a slot with the given allocationId.
|
boolean |
containsSlots(ResourceID owner)
Checks whether the slot pool contains at least one slot belonging to the specified owner.
|
Optional<org.apache.flink.runtime.jobmaster.slotpool.AllocatedSlot> |
freeReservedSlot(AllocationID allocationId,
long currentTime)
Frees the reserved slot, adding it back into the set of free slots.
|
Collection<? extends SlotInfo> |
getAllSlotsInformation()
Returns information about all slots in this pool.
|
FreeSlotInfoTracker |
getFreeSlotInfoTracker()
Returns information about all currently free slots.
|
Optional<SlotInfo> |
getSlotInformation(AllocationID allocationID)
Returns slot information specified by the given allocationId.
|
Optional<org.apache.flink.runtime.jobmaster.slotpool.AllocatedSlot> |
removeSlot(AllocationID allocationId)
Removes the slot with the given allocationId from the slot pool.
|
AllocatedSlotPool.AllocatedSlotsAndReservationStatus |
removeSlots(ResourceID owner)
Removes all slots belonging to the owning TaskExecutor identified by owner.
|
org.apache.flink.runtime.jobmaster.slotpool.AllocatedSlot |
reserveFreeSlot(AllocationID allocationId)
Reserves the free slot specified by the given allocationId.
|
public void addSlots(Collection<org.apache.flink.runtime.jobmaster.slotpool.AllocatedSlot> slots, long currentTime)
AllocatedSlotPool
addSlots
in interface AllocatedSlotPool
slots
- slots to add to the slot poolcurrentTime
- currentTime when the slots have been added to the slot poolpublic Optional<org.apache.flink.runtime.jobmaster.slotpool.AllocatedSlot> removeSlot(AllocationID allocationId)
AllocatedSlotPool
removeSlot
in interface AllocatedSlotPool
allocationId
- allocationId identifying the slot to remove from the slot poolOptional.empty()
public AllocatedSlotPool.AllocatedSlotsAndReservationStatus removeSlots(ResourceID owner)
AllocatedSlotPool
removeSlots
in interface AllocatedSlotPool
owner
- owner identifies the TaskExecutor whose slots shall be removedpublic boolean containsSlots(ResourceID owner)
AllocatedSlotPool
containsSlots
in interface AllocatedSlotPool
owner
- owner for which to check whether the slot pool contains slotstrue
if the slot pool contains a slot from the given owner; otherwise false
public boolean containsSlot(AllocationID allocationId)
AllocatedSlotPool
containsSlot
in interface AllocatedSlotPool
allocationId
- allocationId identifying the slot for which to check whether it is
containedtrue
if the slot pool contains the slot with the given allocationId;
otherwise false
public boolean containsFreeSlot(AllocationID allocationId)
AllocatedSlotPool
AllocationID
and if it is
free.containsFreeSlot
in interface AllocatedSlotPool
allocationId
- allocationId specifies the slot to check fortrue
if the slot pool contains a free slot registered under the given
allocation id; otherwise false
public org.apache.flink.runtime.jobmaster.slotpool.AllocatedSlot reserveFreeSlot(AllocationID allocationId)
AllocatedSlotPool
reserveFreeSlot
in interface AllocatedSlotPool
allocationId
- allocationId identifying the free slot to reserveAllocatedSlot
which has been reservedpublic Optional<org.apache.flink.runtime.jobmaster.slotpool.AllocatedSlot> freeReservedSlot(AllocationID allocationId, long currentTime)
AllocatedSlotPool
freeReservedSlot
in interface AllocatedSlotPool
allocationId
- identifying the reserved slot to freedcurrentTime
- currentTime when the slot has been freedAllocatedSlot
if there was an allocated with the given
allocationId; otherwise Optional.empty()
.public Optional<SlotInfo> getSlotInformation(AllocationID allocationID)
AllocatedSlotPool
getSlotInformation
in interface AllocatedSlotPool
Optional.empty()
public FreeSlotInfoTracker getFreeSlotInfoTracker()
AllocatedSlotPool
getFreeSlotInfoTracker
in interface AllocatedSlotPool
public Collection<? extends SlotInfo> getAllSlotsInformation()
AllocatedSlotPool
getAllSlotsInformation
in interface AllocatedSlotPool
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.