public class SingleLogicalSlot extends Object implements LogicalSlot
LogicalSlot
which is used by the SlotPool
.LogicalSlot.Payload
TERMINATED_PAYLOAD
Constructor and Description |
---|
SingleLogicalSlot(SlotRequestId slotRequestId,
SlotContext slotContext,
SlotSharingGroupId slotSharingGroupId,
Locality locality,
SlotOwner slotOwner) |
Modifier and Type | Method and Description |
---|---|
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.
|
int |
getPhysicalSlotNumber()
Gets the slot number on the TaskManager.
|
SlotRequestId |
getSlotRequestId()
Gets the slot request id uniquely identifying the request with which this
slot has been allocated.
|
SlotSharingGroupId |
getSlotSharingGroupId()
Gets the slot sharing group id to which this slot belongs.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
releaseSlot
public SingleLogicalSlot(SlotRequestId slotRequestId, SlotContext slotContext, @Nullable SlotSharingGroupId slotSharingGroupId, Locality locality, SlotOwner slotOwner)
public TaskManagerLocation getTaskManagerLocation()
LogicalSlot
getTaskManagerLocation
in interface LogicalSlot
public TaskManagerGateway getTaskManagerGateway()
LogicalSlot
getTaskManagerGateway
in interface LogicalSlot
public Locality getLocality()
LogicalSlot
getLocality
in interface LogicalSlot
public boolean isAlive()
LogicalSlot
isAlive
in interface LogicalSlot
public boolean tryAssignPayload(LogicalSlot.Payload payload)
LogicalSlot
tryAssignPayload
in interface LogicalSlot
payload
- to be assigned to this slot.@Nullable public LogicalSlot.Payload getPayload()
LogicalSlot
getPayload
in interface LogicalSlot
public CompletableFuture<?> releaseSlot(@Nullable Throwable cause)
LogicalSlot
releaseSlot
in interface LogicalSlot
cause
- why the slot was released or null if nonepublic int getPhysicalSlotNumber()
LogicalSlot
getPhysicalSlotNumber
in interface LogicalSlot
public AllocationID getAllocationId()
LogicalSlot
getAllocationId
in interface LogicalSlot
public SlotRequestId getSlotRequestId()
LogicalSlot
getSlotRequestId
in interface LogicalSlot
@Nullable public SlotSharingGroupId getSlotSharingGroupId()
LogicalSlot
getSlotSharingGroupId
in interface LogicalSlot
public void release(Throwable cause)
AllocatedSlot
triggers a release of the payload of
the logical slot.cause
- of the payload releaseCopyright © 2014–2019 The Apache Software Foundation. All rights reserved.