public class SingleLogicalSlot extends Object implements LogicalSlot, PhysicalSlot.Payload
LogicalSlot.LogicalSlot.PayloadTERMINATED_PAYLOAD| Constructor and Description |
|---|
SingleLogicalSlot(SlotRequestId slotRequestId,
SlotContext slotContext,
Locality locality,
SlotOwner slotOwner) |
SingleLogicalSlot(SlotRequestId slotRequestId,
SlotContext slotContext,
Locality locality,
SlotOwner slotOwner,
boolean willBeOccupiedIndefinitely) |
| Modifier and Type | Method and Description |
|---|---|
static SingleLogicalSlot |
allocateFromPhysicalSlot(SlotRequestId slotRequestId,
PhysicalSlot physicalSlot,
Locality locality,
SlotOwner slotOwner,
boolean slotWillBeOccupiedIndefinitely) |
AllocationID |
getAllocationId()
Gets the allocation id of this slot.
|
Locality |
getLocality()
Gets the locality of this slot.
|
LogicalSlot.Payload |
getPayload()
Returns the set payload or null if none.
|
SlotRequestId |
getSlotRequestId()
Gets the slot request id uniquely identifying the request with which this slot has been
allocated.
|
TaskManagerGateway |
getTaskManagerGateway()
Return the TaskManager gateway to talk to the TaskManager.
|
TaskManagerLocation |
getTaskManagerLocation()
Return the TaskManager location of this slot.
|
boolean |
isAlive()
True if the slot is alive and has not been released.
|
void |
release(Throwable cause)
A release of the payload by the
AllocatedSlot triggers a release of the payload of
the logical slot. |
CompletableFuture<?> |
releaseSlot(Throwable cause)
Releases this slot.
|
boolean |
tryAssignPayload(LogicalSlot.Payload payload)
Tries to assign a payload to this slot.
|
boolean |
willOccupySlotIndefinitely()
Returns whether the payload will occupy a physical slot indefinitely.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreleaseSlot@VisibleForTesting public SingleLogicalSlot(SlotRequestId slotRequestId, SlotContext slotContext, Locality locality, SlotOwner slotOwner)
public SingleLogicalSlot(SlotRequestId slotRequestId, SlotContext slotContext, Locality locality, SlotOwner slotOwner, boolean willBeOccupiedIndefinitely)
public TaskManagerLocation getTaskManagerLocation()
LogicalSlotgetTaskManagerLocation in interface LogicalSlotpublic TaskManagerGateway getTaskManagerGateway()
LogicalSlotgetTaskManagerGateway in interface LogicalSlotpublic Locality getLocality()
LogicalSlotgetLocality in interface LogicalSlotpublic boolean isAlive()
LogicalSlotisAlive in interface LogicalSlotpublic boolean tryAssignPayload(LogicalSlot.Payload payload)
LogicalSlottryAssignPayload in interface LogicalSlotpayload - to be assigned to this slot.@Nullable public LogicalSlot.Payload getPayload()
LogicalSlotgetPayload in interface LogicalSlotpublic CompletableFuture<?> releaseSlot(@Nullable Throwable cause)
LogicalSlotreleaseSlot in interface LogicalSlotcause - why the slot was released or null if nonepublic AllocationID getAllocationId()
LogicalSlotgetAllocationId in interface LogicalSlotpublic SlotRequestId getSlotRequestId()
LogicalSlotgetSlotRequestId in interface LogicalSlotpublic static SingleLogicalSlot allocateFromPhysicalSlot(SlotRequestId slotRequestId, PhysicalSlot physicalSlot, Locality locality, SlotOwner slotOwner, boolean slotWillBeOccupiedIndefinitely)
public void release(Throwable cause)
AllocatedSlot triggers a release of the payload of
the logical slot.release in interface PhysicalSlot.Payloadcause - of the payload releasepublic boolean willOccupySlotIndefinitely()
PhysicalSlot.PayloadwillOccupySlotIndefinitely in interface PhysicalSlot.PayloadCopyright © 2014–2022 The Apache Software Foundation. All rights reserved.