public class SimpleSlot extends Slot implements LogicalSlot
If this slot is part of a SharedSlot, then the parent attribute will point to that shared slot.
If not, then the parent attribute is null.
LogicalSlot.PayloadNO_ALLOCATION_ID, NO_SLOT_REQUEST_ID, NO_SLOT_SHARING_GROUP_IDTERMINATED_PAYLOAD| Constructor and Description |
|---|
SimpleSlot(SharedSlot parent,
SlotOwner owner,
int slotNumber,
org.apache.flink.util.AbstractID groupID)
Creates a new simple slot that belongs to the given shared slot and
is identified by the given ID..
|
SimpleSlot(SlotContext slotContext,
SlotOwner owner,
int slotNumber)
Creates a new simple slot that stands alone and does not belong to shared slot.
|
SimpleSlot(SlotOwner owner,
TaskManagerLocation location,
int slotNumber,
TaskManagerGateway taskManagerGateway)
Creates a new simple slot that stands alone and does not belong to shared slot.
|
SimpleSlot(SlotOwner owner,
TaskManagerLocation location,
int slotNumber,
TaskManagerGateway taskManagerGateway,
SharedSlot parent,
org.apache.flink.util.AbstractID groupID)
Creates a new simple slot that belongs to the given shared slot and
is identified by the given ID.
|
| Modifier and Type | Method and Description |
|---|---|
AllocationID |
getAllocationId()
Gets the allocation id of this slot.
|
Locality |
getLocality()
Gets the locality information attached to this slot.
|
int |
getNumberLeaves()
Gets the number of simple slots that are at the leaves of the tree of slots.
|
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.
|
CompletableFuture<?> |
releaseSlot(Throwable cause)
This method cancels and releases the slot and all its sub-slots.
|
void |
setLocality(Locality locality)
Attached locality information to this slot.
|
String |
toString() |
boolean |
tryAssignPayload(LogicalSlot.Payload payload)
Atomically sets the executed vertex, if no vertex has been assigned to this slot so far.
|
equals, getGroupID, getOwner, getParent, getRoot, getRootSlotNumber, getSlotContext, getSlotNumber, getTaskManagerGateway, getTaskManagerID, getTaskManagerLocation, hashCode, hierarchy, isAlive, isCanceled, isReleasedclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetTaskManagerGateway, getTaskManagerLocation, isAlive, releaseSlotpublic SimpleSlot(SlotOwner owner, TaskManagerLocation location, int slotNumber, TaskManagerGateway taskManagerGateway)
owner - The component from which this slot is allocated.location - The location info of the TaskManager where the slot was allocated fromslotNumber - The number of the task slot on the instance.taskManagerGateway - The gateway to communicate with the TaskManager of this slotpublic SimpleSlot(SlotOwner owner, TaskManagerLocation location, int slotNumber, TaskManagerGateway taskManagerGateway, @Nullable SharedSlot parent, @Nullable org.apache.flink.util.AbstractID groupID)
owner - The component from which this slot is allocated.location - The location info of the TaskManager where the slot was allocated fromslotNumber - The number of the simple slot in its parent shared slot.taskManagerGateway - to communicate with the associated task manager.parent - The parent shared slot.groupID - The ID that identifies the group that the slot belongs to.public SimpleSlot(SlotContext slotContext, SlotOwner owner, int slotNumber)
slotContext - The slot context of this simple slotowner - The component from which this slot is allocated.public SimpleSlot(SharedSlot parent, SlotOwner owner, int slotNumber, org.apache.flink.util.AbstractID groupID)
parent - The parent shared slot.owner - The component from which this slot is allocated.groupID - The ID that identifies the group that the slot belongs to.public int getNumberLeaves()
SlotgetNumberLeaves in class Slotpublic boolean tryAssignPayload(LogicalSlot.Payload payload)
tryAssignPayload in interface LogicalSlotpayload - The vertex to assign to this slot.@Nullable public LogicalSlot.Payload getPayload()
LogicalSlotgetPayload in interface LogicalSlotpublic Locality getLocality()
getLocality in interface LogicalSlotpublic void setLocality(Locality locality)
locality - The locality attached to the slot.public CompletableFuture<?> releaseSlot(@Nullable Throwable cause)
SlotSlot.isReleased() method will return true.
If this slot is a simple slot, it will be returned to its instance. If it is a shared slot,
it will release all of its sub-slots and release itself.releaseSlot in interface LogicalSlotreleaseSlot in class Slotcause - why the slot was released or null if nonepublic int getPhysicalSlotNumber()
LogicalSlotgetPhysicalSlotNumber in interface LogicalSlotpublic AllocationID getAllocationId()
LogicalSlotgetAllocationId in interface LogicalSlotpublic SlotRequestId getSlotRequestId()
LogicalSlotgetSlotRequestId in interface LogicalSlot@Nullable public SlotSharingGroupId getSlotSharingGroupId()
LogicalSlotgetSlotSharingGroupId in interface LogicalSlotCopyright © 2014–2019 The Apache Software Foundation. All rights reserved.