public class BlocklistDeclarativeSlotPool extends DefaultDeclarativeSlotPool
DeclarativeSlotPool
implementation that supports blocklist. This implementation will
avoid allocating slots that located on blocked nodes. The core idea is to keep the slot pool in
such a state: there is no slot in slot pool that is free (no task assigned) and located on
blocked nodes.DeclarativeSlotPool.NewSlotsListener, DeclarativeSlotPool.NoOpNewSlotsListener
log, slotPool
Modifier and Type | Method and Description |
---|---|
ResourceCounter |
freeReservedSlot(AllocationID allocationId,
Throwable cause,
long currentTime)
Frees the reserved slot identified by the given allocationId.
|
Collection<SlotOffer> |
offerSlots(Collection<? extends SlotOffer> offers,
TaskManagerLocation taskManagerLocation,
TaskManagerGateway taskManagerGateway,
long currentTime)
Offers slots to this slot pool.
|
Collection<SlotOffer> |
registerSlots(Collection<? extends SlotOffer> slots,
TaskManagerLocation taskManagerLocation,
TaskManagerGateway taskManagerGateway,
long currentTime)
Registers the given set of slots at the slot pool.
|
containsFreeSlot, containsSlots, decreaseResourceRequirementsBy, getAllSlotsInformation, getFreeSlotsInformation, getResourceRequirements, increaseResourceRequirementsBy, registerNewSlotsListener, releaseIdleSlots, releaseSlot, releaseSlots, reserveFreeSlot, setResourceRequirements
public Collection<SlotOffer> offerSlots(Collection<? extends SlotOffer> offers, TaskManagerLocation taskManagerLocation, TaskManagerGateway taskManagerGateway, long currentTime)
DeclarativeSlotPool
offerSlots
in interface DeclarativeSlotPool
offerSlots
in class DefaultDeclarativeSlotPool
offers
- offers containing the list of slots offered to this slot pooltaskManagerLocation
- taskManagerLocation is the location of the offering TaskExecutortaskManagerGateway
- taskManagerGateway is the gateway to talk to the offering
TaskExecutorcurrentTime
- currentTime is the time the slots are being offeredpublic Collection<SlotOffer> registerSlots(Collection<? extends SlotOffer> slots, TaskManagerLocation taskManagerLocation, TaskManagerGateway taskManagerGateway, long currentTime)
DeclarativeSlotPool
The difference from DeclarativeSlotPool.offerSlots(java.util.Collection<? extends org.apache.flink.runtime.taskexecutor.slot.SlotOffer>, org.apache.flink.runtime.taskmanager.TaskManagerLocation, org.apache.flink.runtime.jobmanager.slots.TaskManagerGateway, long)
is that this method allows accepting slots which
exceed the currently required, but the DeclarativeSlotPool.offerSlots(java.util.Collection<? extends org.apache.flink.runtime.taskexecutor.slot.SlotOffer>, org.apache.flink.runtime.taskmanager.TaskManagerLocation, org.apache.flink.runtime.jobmanager.slots.TaskManagerGateway, long)
only accepts those slots that are
currently required.
registerSlots
in interface DeclarativeSlotPool
registerSlots
in class DefaultDeclarativeSlotPool
slots
- slots to registertaskManagerLocation
- taskManagerLocation is the location of the offering TaskExecutortaskManagerGateway
- taskManagerGateway is the gateway to talk to the offering
TaskExecutorcurrentTime
- currentTime is the time the slots are being offeredpublic ResourceCounter freeReservedSlot(AllocationID allocationId, @Nullable Throwable cause, long currentTime)
DeclarativeSlotPool
Whether the freed slot is returned to the owning TaskExecutor is implementation dependent.
freeReservedSlot
in interface DeclarativeSlotPool
freeReservedSlot
in class DefaultDeclarativeSlotPool
allocationId
- allocationId identifying the slot to releasecause
- cause for releasing the slot; can be null
currentTime
- currentTime when the slot was releasedCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.