public class SlotManagerImpl extends Object implements SlotManager
SlotManager.| Constructor and Description |
|---|
SlotManagerImpl(SlotMatchingStrategy slotMatchingStrategy,
ScheduledExecutor scheduledExecutor,
org.apache.flink.api.common.time.Time taskManagerRequestTimeout,
org.apache.flink.api.common.time.Time slotRequestTimeout,
org.apache.flink.api.common.time.Time taskManagerTimeout,
boolean waitResultConsumedBeforeRelease) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the slot manager.
|
void |
freeSlot(SlotID slotId,
AllocationID allocationId)
Free the given slot from the given allocation.
|
int |
getNumberAssignedPendingTaskManagerSlots() |
int |
getNumberFreeSlots() |
int |
getNumberFreeSlotsOf(InstanceID instanceId) |
int |
getNumberPendingSlotRequests() |
int |
getNumberPendingTaskManagerSlots() |
int |
getNumberRegisteredSlots() |
int |
getNumberRegisteredSlotsOf(InstanceID instanceId) |
boolean |
registerSlotRequest(SlotRequest slotRequest)
Requests a slot with the respective resource profile.
|
void |
registerTaskManager(TaskExecutorConnection taskExecutorConnection,
SlotReport initialSlotReport)
Registers a new task manager at the slot manager.
|
boolean |
reportSlotStatus(InstanceID instanceId,
SlotReport slotReport)
Reports the current slot allocations for a task manager identified by the given instance id.
|
void |
setFailUnfulfillableRequest(boolean failUnfulfillableRequest) |
void |
start(ResourceManagerId newResourceManagerId,
Executor newMainThreadExecutor,
ResourceActions newResourceActions)
Starts the slot manager with the given leader id and resource manager actions.
|
void |
suspend()
Suspends the component.
|
boolean |
unregisterSlotRequest(AllocationID allocationId)
Cancels and removes a pending slot request with the given allocation id.
|
boolean |
unregisterTaskManager(InstanceID instanceId,
Exception cause)
Unregisters the task manager identified by the given instance id and its associated slots
from the slot manager.
|
void |
unregisterTaskManagersAndReleaseResources() |
public SlotManagerImpl(SlotMatchingStrategy slotMatchingStrategy, ScheduledExecutor scheduledExecutor, org.apache.flink.api.common.time.Time taskManagerRequestTimeout, org.apache.flink.api.common.time.Time slotRequestTimeout, org.apache.flink.api.common.time.Time taskManagerTimeout, boolean waitResultConsumedBeforeRelease)
public int getNumberRegisteredSlots()
getNumberRegisteredSlots in interface SlotManagerpublic int getNumberRegisteredSlotsOf(InstanceID instanceId)
getNumberRegisteredSlotsOf in interface SlotManagerpublic int getNumberFreeSlots()
getNumberFreeSlots in interface SlotManagerpublic int getNumberFreeSlotsOf(InstanceID instanceId)
getNumberFreeSlotsOf in interface SlotManagerpublic int getNumberPendingTaskManagerSlots()
getNumberPendingTaskManagerSlots in interface SlotManagerpublic int getNumberPendingSlotRequests()
getNumberPendingSlotRequests in interface SlotManager@VisibleForTesting public int getNumberAssignedPendingTaskManagerSlots()
public void start(ResourceManagerId newResourceManagerId, Executor newMainThreadExecutor, ResourceActions newResourceActions)
start in interface SlotManagernewResourceManagerId - to use for communication with the task managersnewMainThreadExecutor - to use to run code in the ResourceManager's main threadnewResourceActions - to use for resource (de-)allocationspublic void suspend()
suspend in interface SlotManagerpublic void close()
throws Exception
close in interface AutoCloseableException - if the close operation failspublic boolean registerSlotRequest(SlotRequest slotRequest) throws ResourceManagerException
registerSlotRequest in interface SlotManagerslotRequest - specifying the requested slot specsResourceManagerException - if the slot request failed (e.g. not enough resources left)public boolean unregisterSlotRequest(AllocationID allocationId)
unregisterSlotRequest in interface SlotManagerallocationId - identifying the pending slot requestpublic void registerTaskManager(TaskExecutorConnection taskExecutorConnection, SlotReport initialSlotReport)
registerTaskManager in interface SlotManagertaskExecutorConnection - for the new task managerinitialSlotReport - for the new task managerpublic boolean unregisterTaskManager(InstanceID instanceId, Exception cause)
SlotManagerunregisterTaskManager in interface SlotManagerinstanceId - identifying the task manager to unregistercause - for unregistering the TaskManagerpublic boolean reportSlotStatus(InstanceID instanceId, SlotReport slotReport)
reportSlotStatus in interface SlotManagerinstanceId - identifying the task manager for which to report the slot statusslotReport - containing the status for all of its slotspublic void freeSlot(SlotID slotId, AllocationID allocationId)
freeSlot in interface SlotManagerslotId - identifying the slot to freeallocationId - with which the slot is presumably allocatedpublic void setFailUnfulfillableRequest(boolean failUnfulfillableRequest)
setFailUnfulfillableRequest in interface SlotManager@VisibleForTesting public void unregisterTaskManagersAndReleaseResources()
unregisterTaskManagersAndReleaseResources in interface SlotManagerCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.