public interface SlotPool extends AllocatedSlotActions, AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
Optional<PhysicalSlot> |
allocateAvailableSlot(SlotRequestId slotRequestId,
AllocationID allocationID,
ResourceProfile requirementProfile)
Allocates the available slot with the given allocation id under the given request id for the
given requirement profile.
|
void |
close() |
void |
connectToResourceManager(ResourceManagerGateway resourceManagerGateway)
Connects the SlotPool to the given ResourceManager.
|
AllocatedSlotReport |
createAllocatedSlotReport(ResourceID taskManagerId)
Create report about the allocated slots belonging to the specified task manager.
|
void |
disableBatchSlotRequestTimeoutCheck()
Disables batch slot request timeout check.
|
void |
disconnectResourceManager()
Disconnects the slot pool from its current Resource Manager.
|
Collection<SlotInfo> |
getAllocatedSlotsInformation()
Returns a list of
SlotInfo objects about all slots that are currently allocated in
the slot pool. |
FreeSlotInfoTracker |
getFreeSlotInfoTracker()
Returns all free slot tracker.
|
Collection<SlotOffer> |
offerSlots(TaskManagerLocation taskManagerLocation,
TaskManagerGateway taskManagerGateway,
Collection<SlotOffer> offers)
Offers multiple slots to the
SlotPool. |
boolean |
registerTaskManager(ResourceID resourceID)
Registers a TaskExecutor with the given
ResourceID at SlotPool. |
boolean |
releaseTaskManager(ResourceID resourceId,
Exception cause)
Releases a TaskExecutor with the given
ResourceID from the SlotPool. |
default CompletableFuture<PhysicalSlot> |
requestNewAllocatedBatchSlot(SlotRequestId slotRequestId,
ResourceProfile resourceProfile)
Requests the allocation of a new batch slot from the resource manager.
|
CompletableFuture<PhysicalSlot> |
requestNewAllocatedBatchSlot(SlotRequestId slotRequestId,
ResourceProfile resourceProfile,
Collection<AllocationID> preferredAllocations) |
CompletableFuture<PhysicalSlot> |
requestNewAllocatedSlot(SlotRequestId slotRequestId,
ResourceProfile resourceProfile,
Collection<AllocationID> preferredAllocations,
org.apache.flink.api.common.time.Time timeout)
Request the allocation of a new slot from the resource manager.
|
default CompletableFuture<PhysicalSlot> |
requestNewAllocatedSlot(SlotRequestId slotRequestId,
ResourceProfile resourceProfile,
org.apache.flink.api.common.time.Time timeout)
Request the allocation of a new slot from the resource manager.
|
void |
setIsJobRestarting(boolean isJobRestarting)
Sets whether the underlying job is currently restarting or not.
|
void |
start(JobMasterId jobMasterId,
String newJobManagerAddress,
org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor jmMainThreadScheduledExecutor) |
releaseSlotvoid start(JobMasterId jobMasterId, String newJobManagerAddress, org.apache.flink.runtime.concurrent.ComponentMainThreadExecutor jmMainThreadScheduledExecutor) throws Exception
Exceptionvoid close()
close in interface AutoCloseablevoid connectToResourceManager(ResourceManagerGateway resourceManagerGateway)
resourceManagerGateway - The RPC gateway for the resource manager.void disconnectResourceManager()
The slot pool will still be able to serve slots from its internal pool.
boolean registerTaskManager(ResourceID resourceID)
ResourceID at SlotPool.resourceID - identifying the TaskExecutor to registerboolean releaseTaskManager(ResourceID resourceId, Exception cause)
ResourceID from the SlotPool.resourceId - identifying the TaskExecutor which shall be released from the SlotPoolcause - for the releasing of the TaskManagerCollection<SlotOffer> offerSlots(TaskManagerLocation taskManagerLocation, TaskManagerGateway taskManagerGateway, Collection<SlotOffer> offers)
SlotPool. The slot offerings can be individually
accepted or rejected by returning the collection of accepted slot offers.taskManagerLocation - from which the slot offers originatetaskManagerGateway - to talk to the slot offereroffers - slot offers which are offered to the SlotPoolFreeSlotInfoTracker getFreeSlotInfoTracker()
Collection<SlotInfo> getAllocatedSlotsInformation()
SlotInfo objects about all slots that are currently allocated in
the slot pool.SlotInfo objects about all slots that are currently allocated in
the slot pool.Optional<PhysicalSlot> allocateAvailableSlot(SlotRequestId slotRequestId, AllocationID allocationID, ResourceProfile requirementProfile)
IllegalStateException will be thrown.slotRequestId - identifying the requested slotallocationID - the allocation id of the requested available slotrequirementProfile - resource profile of the requirement for which to allocate the slotdefault CompletableFuture<PhysicalSlot> requestNewAllocatedSlot(SlotRequestId slotRequestId, ResourceProfile resourceProfile, @Nullable org.apache.flink.api.common.time.Time timeout)
slotRequestId - identifying the requested slotresourceProfile - resource profile that specifies the resource requirements for the
requested slottimeout - timeout for the allocation procedureCompletableFuture<PhysicalSlot> requestNewAllocatedSlot(SlotRequestId slotRequestId, ResourceProfile resourceProfile, Collection<AllocationID> preferredAllocations, @Nullable org.apache.flink.api.common.time.Time timeout)
slotRequestId - identifying the requested slotresourceProfile - resource profile that specifies the resource requirements for the
requested slotpreferredAllocations - preferred allocations for the new allocated slottimeout - timeout for the allocation proceduredefault CompletableFuture<PhysicalSlot> requestNewAllocatedBatchSlot(SlotRequestId slotRequestId, ResourceProfile resourceProfile)
slotRequestId - identifying the requested slotresourceProfile - resource profile that specifies the resource requirements for the
requested batch slotCompletableFuture<PhysicalSlot> requestNewAllocatedBatchSlot(SlotRequestId slotRequestId, ResourceProfile resourceProfile, Collection<AllocationID> preferredAllocations)
void disableBatchSlotRequestTimeoutCheck()
AllocatedSlotReport createAllocatedSlotReport(ResourceID taskManagerId)
taskManagerId - identifies the task managervoid setIsJobRestarting(boolean isJobRestarting)
isJobRestarting - whether the job is restarting or notCopyright © 2014–2025 The Apache Software Foundation. All rights reserved.