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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
LogicalSlot.Payload
Payload for a logical slot.
-
Field Summary
Fields Modifier and Type Field Description static LogicalSlot.Payload
TERMINATED_PAYLOAD
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method 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.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.default CompletableFuture<?>
releaseSlot()
Deprecated.Added because extended the actual releaseSlot method with cause parameter.CompletableFuture<?>
releaseSlot(Throwable cause)
Releases this slot.boolean
tryAssignPayload(LogicalSlot.Payload payload)
Tries to assign a payload to this slot.
-
-
-
Field Detail
-
TERMINATED_PAYLOAD
static final LogicalSlot.Payload TERMINATED_PAYLOAD
-
-
Method Detail
-
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
-
-