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.Payload
NO_ALLOCATION_ID, NO_SLOT_REQUEST_ID, NO_SLOT_SHARING_GROUP_ID
TERMINATED_PAYLOAD
Constructor and Description |
---|
SimpleSlot(SharedSlot parent,
SlotOwner owner,
int slotNumber,
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,
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, isReleased
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getTaskManagerGateway, getTaskManagerLocation, isAlive, releaseSlot
public 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 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, 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()
Slot
getNumberLeaves
in class Slot
public boolean tryAssignPayload(LogicalSlot.Payload payload)
tryAssignPayload
in interface LogicalSlot
payload
- The vertex to assign to this slot.@Nullable public LogicalSlot.Payload getPayload()
LogicalSlot
getPayload
in interface LogicalSlot
public Locality getLocality()
getLocality
in interface LogicalSlot
public void setLocality(Locality locality)
locality
- The locality attached to the slot.public CompletableFuture<?> releaseSlot(@Nullable Throwable cause)
Slot
Slot.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 LogicalSlot
releaseSlot
in class Slot
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
Copyright © 2014–2019 The Apache Software Foundation. All rights reserved.