public class SimpleSlot extends Slot
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.
NO_ALLOCATION_ID
Constructor and Description |
---|
SimpleSlot(AllocatedSlot allocatedSlot,
SlotOwner owner,
int slotNumber)
Creates a new simple slot that stands alone and does not belong to shared slot.
|
SimpleSlot(JobID jobID,
SlotOwner owner,
TaskManagerLocation location,
int slotNumber,
TaskManagerGateway taskManagerGateway)
Creates a new simple slot that stands alone and does not belong to shared slot.
|
SimpleSlot(JobID jobID,
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.
|
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..
|
Modifier and Type | Method and Description |
---|---|
Execution |
getExecutedVertex()
Gets the task execution attempt currently executed in 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.
|
void |
releaseSlot()
This method cancels and releases the slot and all its sub-slots.
|
boolean |
setExecutedVertex(Execution executedVertex)
Atomically sets the executed vertex, if no vertex has been assigned to this slot so far.
|
void |
setLocality(Locality locality)
Attached locality information to this slot.
|
String |
toString() |
getAllocatedSlot, getGroupID, getJobID, getOwner, getParent, getRoot, getRootSlotNumber, getSlotNumber, getTaskManagerGateway, getTaskManagerID, getTaskManagerLocation, hierarchy, isAlive, isCanceled, isReleased
public SimpleSlot(JobID jobID, SlotOwner owner, TaskManagerLocation location, int slotNumber, TaskManagerGateway taskManagerGateway)
jobID
- The ID of the job that the slot is allocated for.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(JobID jobID, SlotOwner owner, TaskManagerLocation location, int slotNumber, TaskManagerGateway taskManagerGateway, @Nullable SharedSlot parent, @Nullable AbstractID groupID)
jobID
- The ID of the job that the slot is allocated for.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(AllocatedSlot allocatedSlot, SlotOwner owner, int slotNumber)
allocatedSlot
- The allocated slot that this slot represents.owner
- The component from which this slot is allocated.slotNumber
- The number of the task slot on the instance.public SimpleSlot(SharedSlot parent, SlotOwner owner, int slotNumber, AbstractID groupID)
parent
- The parent shared slot.owner
- The component from which this slot is allocated.slotNumber
- The number of the simple slot in its parent shared slot.groupID
- The ID that identifies the group that the slot belongs to.public int getNumberLeaves()
Slot
getNumberLeaves
in class Slot
public Execution getExecutedVertex()
public boolean setExecutedVertex(Execution executedVertex)
executedVertex
- The vertex to assign to this slot.public Locality getLocality()
public void setLocality(Locality locality)
locality
- The locality attached to the slot.public void releaseSlot()
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 class Slot
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.