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 |
|---|---|
org.apache.flink.util.AbstractID |
getGroupId()
Gets the ID that identifies the co-location group.
|
Instance |
getLocation()
Gets the location assigned to this slot.
|
SharedSlot |
getSharedSlot()
Gets the shared slot into which this constraint's tasks are places.
|
boolean |
isAssigned()
Checks whether the location of this constraint has been assigned.
|
boolean |
isAssignedAndAlive()
Checks whether the location of this constraint has been assigned
(as defined in the
isAssigned() method, and the current
shared slot is alive. |
void |
lockLocation()
Locks the location of this slot.
|
void |
setSharedSlot(SharedSlot newSlot)
Assigns a new shared slot to this co-location constraint.
|
String |
toString() |
public SharedSlot getSharedSlot()
public org.apache.flink.util.AbstractID getGroupId()
public boolean isAssigned()
setSharedSlot(org.apache.flink.runtime.instance.SharedSlot) method,
and the location is locked via the lockLocation() method.public boolean isAssignedAndAlive()
isAssigned() method, and the current
shared slot is alive.public Instance 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.Copyright © 2014–2016 The Apache Software Foundation. All rights reserved.