Class DefaultSlotStatusSyncer

    • Constructor Detail

      • DefaultSlotStatusSyncer

        public DefaultSlotStatusSyncer​(Duration taskManagerRequestTimeout)
    • Method Detail

      • initialize

        public void initialize​(org.apache.flink.runtime.resourcemanager.slotmanager.TaskManagerTracker taskManagerTracker,
                               ResourceTracker resourceTracker,
                               ResourceManagerId resourceManagerId,
                               Executor mainThreadExecutor)
        Description copied from interface: SlotStatusSyncer
        Initialize this syncer.
        Specified by:
        initialize in interface SlotStatusSyncer
        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
      • allocateSlot

        public CompletableFuture<Void> allocateSlot​(InstanceID instanceId,
                                                    org.apache.flink.api.common.JobID jobId,
                                                    String targetAddress,
                                                    ResourceProfile resourceProfile)
        Description copied from interface: SlotStatusSyncer
        Allocate a slot from the task manager.
        Specified by:
        allocateSlot in interface SlotStatusSyncer
        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
      • reportSlotStatus

        public boolean reportSlotStatus​(InstanceID instanceId,
                                        SlotReport slotReport)
        Description copied from interface: SlotStatusSyncer
        Reconcile the slot status with the slot report.
        Specified by:
        reportSlotStatus in interface SlotStatusSyncer
        Parameters:
        instanceId - of the task manager
        slotReport - reported
        Returns:
        whether the previous allocations can be applied
      • freeInactiveSlots

        public void freeInactiveSlots​(org.apache.flink.api.common.JobID jobId)
        Description copied from interface: SlotStatusSyncer
        Frees all currently inactive slot allocated for the given job.
        Specified by:
        freeInactiveSlots in interface SlotStatusSyncer
        Parameters:
        jobId - of the job