Class FineGrainedSlotManager

    • Method Detail

      • triggerResourceRequirementsCheck

        public void triggerResourceRequirementsCheck()
        Description copied from interface: SlotManager
        Trigger the resource requirement check. This method will be called when some slot statuses changed.
        Specified by:
        triggerResourceRequirementsCheck in interface SlotManager
      • start

        public 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.
        Specified by:
        start in interface SlotManager
        Parameters:
        newResourceManagerId - to use for communication with the task managers
        newMainThreadExecutor - to use to run code in the ResourceManager's main thread
        newResourceAllocator - to use for resource (de-)allocations
        newBlockedTaskManagerChecker - to query whether a task manager is blocked
        newResourceEventListener - to use for notify resource not enough
      • suspend

        public void suspend()
        Suspends the component. This clears the internal state of the slot manager.
        Specified by:
        suspend in interface SlotManager
      • clearResourceRequirements

        public void clearResourceRequirements​(org.apache.flink.api.common.JobID jobId)
        Description copied from interface: SlotManager
        Notifies the slot manager that the resource requirements for the given job should be cleared. The slot manager may assume that no further updates to the resource requirements will occur.
        Specified by:
        clearResourceRequirements in interface SlotManager
        Parameters:
        jobId - job for which to clear the requirements
      • processResourceRequirements

        public void processResourceRequirements​(ResourceRequirements resourceRequirements)
        Description copied from interface: SlotManager
        Notifies the slot manager about the resource requirements of a job.
        Specified by:
        processResourceRequirements in interface SlotManager
        Parameters:
        resourceRequirements - resource requirements of a job
      • registerTaskManager

        public SlotManager.RegistrationResult registerTaskManager​(TaskExecutorConnection taskExecutorConnection,
                                                                  SlotReport initialSlotReport,
                                                                  ResourceProfile totalResourceProfile,
                                                                  ResourceProfile defaultSlotResourceProfile)
        Description copied from interface: SlotManager
        Registers a new task manager at the slot manager. This will make the task managers slots known and, thus, available for allocation.
        Specified by:
        registerTaskManager in interface SlotManager
        Parameters:
        taskExecutorConnection - for the new task manager
        initialSlotReport - for the new task manager
        totalResourceProfile - for the new task manager
        defaultSlotResourceProfile - for the new task manager
        Returns:
        The result of task manager registration
      • unregisterTaskManager

        public boolean unregisterTaskManager​(InstanceID instanceId,
                                             Exception cause)
        Description copied from interface: SlotManager
        Unregisters the task manager identified by the given instance id and its associated slots from the slot manager.
        Specified by:
        unregisterTaskManager in interface SlotManager
        Parameters:
        instanceId - identifying the task manager to unregister
        cause - for unregistering the TaskManager
        Returns:
        True if there existed a registered task manager with the given instance id
      • reportSlotStatus

        public boolean reportSlotStatus​(InstanceID instanceId,
                                        SlotReport slotReport)
        Reports the current slot allocations for a task manager identified by the given instance id.
        Specified by:
        reportSlotStatus in interface SlotManager
        Parameters:
        instanceId - identifying the task manager for which to report the slot status
        slotReport - containing the status for all of its slots
        Returns:
        true if the slot status has been updated successfully, otherwise false
      • freeSlot

        public void freeSlot​(SlotID slotId,
                             AllocationID allocationId)
        Free the given slot from the given allocation. If the slot is still allocated by the given allocation id, then the slot will be freed.
        Specified by:
        freeSlot in interface SlotManager
        Parameters:
        slotId - identifying the slot to free, will be ignored
        allocationId - with which the slot is presumably allocated
      • getTaskManagerIdleSince

        @VisibleForTesting
        public long getTaskManagerIdleSince​(InstanceID instanceId)