Class SingleLogicalSlot

java.lang.Object
org.apache.flink.runtime.jobmaster.slotpool.SingleLogicalSlot
All Implemented Interfaces:
LogicalSlot, PhysicalSlot.Payload

public class SingleLogicalSlot extends Object implements LogicalSlot, PhysicalSlot.Payload
Implementation of the LogicalSlot.
  • Constructor Details

  • Method Details

    • getTaskManagerLocation

      public TaskManagerLocation getTaskManagerLocation()
      Description copied from interface: LogicalSlot
      Return the TaskManager location of this slot.
      Specified by:
      getTaskManagerLocation in interface LogicalSlot
      Returns:
      TaskManager location of this slot
    • getTaskManagerGateway

      public TaskManagerGateway getTaskManagerGateway()
      Description copied from interface: LogicalSlot
      Return the TaskManager gateway to talk to the TaskManager.
      Specified by:
      getTaskManagerGateway in interface LogicalSlot
      Returns:
      TaskManager gateway to talk to the TaskManager
    • getLocality

      public Locality getLocality()
      Description copied from interface: LogicalSlot
      Gets the locality of this slot.
      Specified by:
      getLocality in interface LogicalSlot
      Returns:
      locality of this slot
    • isAlive

      public boolean isAlive()
      Description copied from interface: LogicalSlot
      True if the slot is alive and has not been released.
      Specified by:
      isAlive in interface LogicalSlot
      Returns:
      True if the slot is alive, otherwise false if the slot is released
    • tryAssignPayload

      public boolean tryAssignPayload(LogicalSlot.Payload payload)
      Description copied from interface: LogicalSlot
      Tries to assign a payload to this slot. One can only assign a single payload once.
      Specified by:
      tryAssignPayload in interface LogicalSlot
      Parameters:
      payload - to be assigned to this slot.
      Returns:
      true if the payload could be assigned, otherwise false
    • getPayload

      @Nullable public LogicalSlot.Payload getPayload()
      Description copied from interface: LogicalSlot
      Returns the set payload or null if none.
      Specified by:
      getPayload in interface LogicalSlot
      Returns:
      Payload of this slot of null if none
    • releaseSlot

      public CompletableFuture<?> releaseSlot(@Nullable Throwable cause)
      Description copied from interface: LogicalSlot
      Releases this slot.
      Specified by:
      releaseSlot in interface LogicalSlot
      Parameters:
      cause - why the slot was released or null if none
      Returns:
      future which is completed once the slot has been released
    • getAllocationId

      public AllocationID getAllocationId()
      Description copied from interface: LogicalSlot
      Gets the allocation id of this slot. Multiple logical slots can share the same allocation id.
      Specified by:
      getAllocationId in interface LogicalSlot
      Returns:
      allocation id of this slot
    • getSlotRequestId

      public SlotRequestId getSlotRequestId()
      Description copied from interface: LogicalSlot
      Gets the slot request id uniquely identifying the request with which this slot has been allocated.
      Specified by:
      getSlotRequestId in interface LogicalSlot
      Returns:
      Unique id identifying the slot request with which this slot was allocated
    • allocateFromPhysicalSlot

      public static SingleLogicalSlot allocateFromPhysicalSlot(SlotRequestId slotRequestId, PhysicalSlot physicalSlot, Locality locality, SlotOwner slotOwner, boolean slotWillBeOccupiedIndefinitely)
    • release

      public void release(Throwable cause)
      A release of the payload by the AllocatedSlot triggers a release of the payload of the logical slot.
      Specified by:
      release in interface PhysicalSlot.Payload
      Parameters:
      cause - of the payload release
    • willOccupySlotIndefinitely

      public boolean willOccupySlotIndefinitely()
      Description copied from interface: PhysicalSlot.Payload
      Returns whether the payload will occupy a physical slot indefinitely.
      Specified by:
      willOccupySlotIndefinitely in interface PhysicalSlot.Payload
      Returns:
      true if the payload will occupy a physical slot indefinitely, otherwise false