public class FineGrainedSlotManager extends Object implements SlotManager
SlotManager supporting fine-grained resource management.SlotManager.RegistrationResult| Constructor and Description |
|---|
FineGrainedSlotManager(org.apache.flink.util.concurrent.ScheduledExecutor scheduledExecutor,
SlotManagerConfiguration slotManagerConfiguration,
SlotManagerMetricGroup slotManagerMetricGroup,
ResourceTracker resourceTracker,
org.apache.flink.runtime.resourcemanager.slotmanager.TaskManagerTracker taskManagerTracker,
SlotStatusSyncer slotStatusSyncer,
ResourceAllocationStrategy resourceAllocationStrategy) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearResourceRequirements(org.apache.flink.api.common.JobID jobId)
Notifies the slot manager that the resource requirements for the given job should be cleared.
|
void |
close()
Closes the slot manager.
|
void |
freeSlot(SlotID slotId,
AllocationID allocationId)
Free the given slot from the given allocation.
|
Collection<SlotInfo> |
getAllocatedSlotsOf(InstanceID instanceID) |
ResourceProfile |
getFreeResource() |
ResourceProfile |
getFreeResourceOf(InstanceID instanceID) |
int |
getNumberFreeSlots() |
int |
getNumberFreeSlotsOf(InstanceID instanceId) |
int |
getNumberRegisteredSlots() |
int |
getNumberRegisteredSlotsOf(InstanceID instanceId) |
ResourceProfile |
getRegisteredResource() |
ResourceProfile |
getRegisteredResourceOf(InstanceID instanceID) |
long |
getTaskManagerIdleSince(InstanceID instanceId) |
void |
processResourceRequirements(ResourceRequirements resourceRequirements)
Notifies the slot manager about the resource requirements of a job.
|
SlotManager.RegistrationResult |
registerTaskManager(TaskExecutorConnection taskExecutorConnection,
SlotReport initialSlotReport,
ResourceProfile totalResourceProfile,
ResourceProfile defaultSlotResourceProfile)
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,
ResourceAllocator newResourceAllocator,
ResourceEventListener newResourceEventListener,
BlockedTaskManagerChecker newBlockedTaskManagerChecker)
Starts the slot manager with the given leader id and resource manager actions.
|
void |
suspend()
Suspends the component.
|
void |
triggerResourceRequirementsCheck()
Trigger the resource requirement check.
|
boolean |
unregisterTaskManager(InstanceID instanceId,
Exception cause)
Unregisters the task manager identified by the given instance id and its associated slots
from the slot manager.
|
public FineGrainedSlotManager(org.apache.flink.util.concurrent.ScheduledExecutor scheduledExecutor,
SlotManagerConfiguration slotManagerConfiguration,
SlotManagerMetricGroup slotManagerMetricGroup,
ResourceTracker resourceTracker,
org.apache.flink.runtime.resourcemanager.slotmanager.TaskManagerTracker taskManagerTracker,
SlotStatusSyncer slotStatusSyncer,
ResourceAllocationStrategy resourceAllocationStrategy)
public void setFailUnfulfillableRequest(boolean failUnfulfillableRequest)
setFailUnfulfillableRequest in interface SlotManagerpublic void triggerResourceRequirementsCheck()
SlotManagertriggerResourceRequirementsCheck in interface SlotManagerpublic void start(ResourceManagerId newResourceManagerId, Executor newMainThreadExecutor, ResourceAllocator newResourceAllocator, ResourceEventListener newResourceEventListener, BlockedTaskManagerChecker newBlockedTaskManagerChecker)
start in interface SlotManagernewResourceManagerId - to use for communication with the task managersnewMainThreadExecutor - to use to run code in the ResourceManager's main threadnewResourceAllocator - to use for resource (de-)allocationsnewBlockedTaskManagerChecker - to query whether a task manager is blockednewResourceEventListener - to use for notify resource not enoughpublic void suspend()
suspend in interface SlotManagerpublic void close()
throws Exception
close in interface AutoCloseableException - if the close operation failspublic void clearResourceRequirements(org.apache.flink.api.common.JobID jobId)
SlotManagerclearResourceRequirements in interface SlotManagerjobId - job for which to clear the requirementspublic void processResourceRequirements(ResourceRequirements resourceRequirements)
SlotManagerprocessResourceRequirements in interface SlotManagerresourceRequirements - resource requirements of a jobpublic SlotManager.RegistrationResult registerTaskManager(TaskExecutorConnection taskExecutorConnection, SlotReport initialSlotReport, ResourceProfile totalResourceProfile, ResourceProfile defaultSlotResourceProfile)
SlotManagerregisterTaskManager in interface SlotManagertaskExecutorConnection - for the new task managerinitialSlotReport - for the new task managertotalResourceProfile - for the new task managerdefaultSlotResourceProfile - 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 free, will be ignoredallocationId - with which the slot is presumably allocatedpublic 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 ResourceProfile getRegisteredResource()
getRegisteredResource in interface SlotManagerpublic ResourceProfile getRegisteredResourceOf(InstanceID instanceID)
getRegisteredResourceOf in interface SlotManagerpublic ResourceProfile getFreeResource()
getFreeResource in interface SlotManagerpublic ResourceProfile getFreeResourceOf(InstanceID instanceID)
getFreeResourceOf in interface SlotManagerpublic Collection<SlotInfo> getAllocatedSlotsOf(InstanceID instanceID)
getAllocatedSlotsOf in interface SlotManager@VisibleForTesting public long getTaskManagerIdleSince(InstanceID instanceId)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.