Commit 13dfb62a authored by Unai's avatar Unai 🇵🇲

Added some utility functions to Node, should not affect model overall

parent f67571cb
......@@ -137,7 +137,23 @@ public class Node extends DataClayObject {
public List<Worker> getWorkers() {
return workers;
}
/**
* Remove master from list of registered masters in the node
* @param master Master object
*/
public void removeMaster(Master master) {
masters.removeIf(m -> m.getNode().getName().equals(master.getNode().getName()));
}
/**
* Remove worker from list of registered workers in the node
* @param worker Worker object
*/
public void removeWorker(Worker worker) {
workers.removeIf(w -> w.getNode().getName().equals(worker.getNode().getName()));
}
@Override
public String toString() {
return " [ name = " + name + " , cpuCapacity = " + cpuCapacity + " , energyCapacity = " + energyCapacity + " ]";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment