Interface SlotStatusSyncer

  • All Known Implementing Classes:
    DefaultSlotStatusSyncer

    public interface SlotStatusSyncer
    Syncer for slot status. Take the responsibility of allocating/freeing slot and reconciling the slot status with task managers.
    • Method Detail

      • initialize

        void initialize​(org.apache.flink.runtime.resourcemanager.slotmanager.TaskManagerTracker taskManagerTracker,
                        ResourceTracker resourceTracker,
                        ResourceManagerId resourceManagerId,
                        Executor mainThreadExecutor)
        Initialize this syncer.
        Parameters:
        taskManagerTracker - track the state of task managers and slots
        resourceTracker - track the state of resource declaration
        resourceManagerId - for slot allocation
        mainThreadExecutor - to handle the request future
      • close

        void close()
        Close this syncer, clear all the state.
      • allocateSlot

        CompletableFuture<Void> allocateSlot​(InstanceID instanceId,
                                             JobID jobId,
                                             String targetAddress,
                                             ResourceProfile resourceProfile)
        Allocate a slot from the task manager.
        Parameters:
        instanceId - of the task manager
        jobId - of the slot
        targetAddress - of the job
        resourceProfile - of the slot
        Returns:
        a CompletableFuture of the slot allocation, which will be completed exceptionally if the allocation fails
      • freeSlot

        void freeSlot​(AllocationID allocationId)
        Free the given slot.
        Parameters:
        allocationId - of the given slot.
      • reportSlotStatus

        boolean reportSlotStatus​(InstanceID instanceId,
                                 SlotReport slotReport)
        Reconcile the slot status with the slot report.
        Parameters:
        instanceId - of the task manager
        slotReport - reported
        Returns:
        whether the previous allocations can be applied
      • freeInactiveSlots

        void freeInactiveSlots​(JobID jobId)
        Frees all currently inactive slot allocated for the given job.
        Parameters:
        jobId - of the job