Class DefaultSlotStatusSyncer

java.lang.Object
org.apache.flink.runtime.resourcemanager.slotmanager.DefaultSlotStatusSyncer
All Implemented Interfaces:
SlotStatusSyncer

public class DefaultSlotStatusSyncer extends Object implements SlotStatusSyncer
Default implementation of SlotStatusSyncer for fine-grained slot management.
  • Constructor Details

    • DefaultSlotStatusSyncer

      public DefaultSlotStatusSyncer(Duration taskManagerRequestTimeout)
  • Method Details

    • 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
    • close

      public void close()
      Description copied from interface: SlotStatusSyncer
      Close this syncer, clear all the state.
      Specified by:
      close in interface SlotStatusSyncer
    • 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
    • freeSlot

      public void freeSlot(AllocationID allocationId)
      Description copied from interface: SlotStatusSyncer
      Free the given slot.
      Specified by:
      freeSlot in interface SlotStatusSyncer
      Parameters:
      allocationId - of the given slot.
    • 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