public class CoLocationConstraint extends Object
Instance
.
This is realized by creating a special shared slot that holds these tasks.
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.
|
SharedSlot |
getSharedSlot()
Gets the shared slot into which this constraint's tasks are places.
|
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.
|
boolean |
isAssignedAndAlive()
Deprecated.
Should only be called by legacy code (if using
Scheduler ) |
void |
lockLocation()
Locks the location of this slot.
|
void |
lockLocation(TaskManagerLocation taskManagerLocation)
Locks the location of this slot.
|
void |
setSharedSlot(SharedSlot newSlot)
Assigns a new shared slot to this co-location constraint.
|
void |
setSlotRequestId(SlotRequestId slotRequestId)
Sets the slot request id of the currently assigned slot to the co-location constraint.
|
String |
toString() |
public SharedSlot getSharedSlot()
public AbstractID getGroupId()
public boolean isAssigned()
setSharedSlot(org.apache.flink.runtime.instance.SharedSlot)
method,
and the location is locked via the lockLocation()
method.@Deprecated public boolean isAssignedAndAlive()
Scheduler
)isAssigned()
method, and the current
shared slot is alive.public TaskManagerLocation getLocation()
lockLocation()
method and
isAssigned()
returns true.IllegalStateException
- Thrown if the location has not been assigned, yet.public void setSharedSlot(SharedSlot newSlot)
If the constraint already has a slot, the current one will be released.
newSlot
- The new shared slot to assign to this constraint.IllegalArgumentException
- If the constraint's location has been assigned and
the new slot is from a different location.public void lockLocation() throws IllegalStateException
IllegalStateException
- Thrown, if the location is already locked,
or is no slot has been set, 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–2020 The Apache Software Foundation. All rights reserved.