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.
Constructor and Description |
---|
SimpleSlot(JobID jobID,
Instance instance,
int slotNumber)
Creates a new simple slot that stands alone and does not belong to shared slot.
|
SimpleSlot(JobID jobID,
Instance instance,
int slotNumber,
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 |
---|---|
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() |
getGroupID, getInstance, getJobID, getParent, getRoot, getRootSlotNumber, getSlotNumber, hierarchy, isAlive, isCanceled, isReleased
public SimpleSlot(JobID jobID, Instance instance, int slotNumber)
jobID
- The ID of the job that the slot is allocated for.instance
- The instance that the slot belongs to.slotNumber
- The number of the task slot on the instance.public SimpleSlot(JobID jobID, Instance instance, int slotNumber, SharedSlot parent, AbstractID groupID)
jobID
- The ID of the job that the slot is allocated for.instance
- The instance that the slot belongs to.slotNumber
- The number of the simple slot in its parent shared slot.parent
- The 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.