Interface LogicalSlot

All Known Implementing Classes:
SingleLogicalSlot

public interface LogicalSlot
A logical slot represents a resource on a TaskManager into which a single task can be deployed.
  • Field Details

  • Method Details

    • getTaskManagerLocation

      TaskManagerLocation getTaskManagerLocation()
      Return the TaskManager location of this slot.
      Returns:
      TaskManager location of this slot
    • getTaskManagerGateway

      TaskManagerGateway getTaskManagerGateway()
      Return the TaskManager gateway to talk to the TaskManager.
      Returns:
      TaskManager gateway to talk to the TaskManager
    • getLocality

      Locality getLocality()
      Gets the locality of this slot.
      Returns:
      locality of this slot
    • isAlive

      boolean isAlive()
      True if the slot is alive and has not been released.
      Returns:
      True if the slot is alive, otherwise false if the slot is released
    • tryAssignPayload

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

      @Nullable LogicalSlot.Payload getPayload()
      Returns the set payload or null if none.
      Returns:
      Payload of this slot of null if none
    • releaseSlot

      default CompletableFuture<?> releaseSlot()
      Deprecated.
      Added because extended the actual releaseSlot method with cause parameter.
      Releases this slot.
      Returns:
      Future which is completed once the slot has been released, in case of a failure it is completed exceptionally
    • releaseSlot

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

      AllocationID getAllocationId()
      Gets the allocation id of this slot. Multiple logical slots can share the same allocation id.
      Returns:
      allocation id of this slot
    • getSlotRequestId

      SlotRequestId getSlotRequestId()
      Gets the slot request id uniquely identifying the request with which this slot has been allocated.
      Returns:
      Unique id identifying the slot request with which this slot was allocated