public class CoLocationConstraint extends Object
This class tracks the location and the shared slot for this set of tasks.
Modifier and Type | Method and Description |
---|---|
AbstractID |
getGroupId()
Gets the ID that identifies the co-location group.
|
TaskManagerLocation |
getLocation()
Gets the location assigned to this slot.
|
SlotRequestId |
getSlotRequestId()
Returns the currently assigned slot request id identifying the slot to which tasks belonging
to this co-location constraint will be deployed to.
|
boolean |
isAssigned()
Checks whether the location of this constraint has been assigned.
|
void |
lockLocation(TaskManagerLocation taskManagerLocation)
Locks the location of this slot.
|
void |
setSlotRequestId(SlotRequestId slotRequestId)
Sets the slot request id of the currently assigned slot to the co-location constraint.
|
String |
toString() |
public AbstractID getGroupId()
public boolean isAssigned()
lockLocation(TaskManagerLocation)
method.public TaskManagerLocation getLocation()
lockLocation(TaskManagerLocation)
method and isAssigned()
returns true.IllegalStateException
- Thrown if the location has not been assigned, yet.public void lockLocation(TaskManagerLocation taskManagerLocation)
Note: This method exists for compatibility reasons with the new SlotPool
.
taskManagerLocation
- to lock this co-location constraint topublic void setSlotRequestId(@Nullable SlotRequestId slotRequestId)
slotRequestId
- identifying the assigned slot for this co-location constraint@Nullable public SlotRequestId getSlotRequestId()
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.