Commit 353838b6 authored by Luís Nogueira's avatar Luís Nogueira

Data model updated with node's CPU and energy capacities

parent b129b31a
......@@ -13,17 +13,17 @@ Registered model has the following representation:
| Master |
| |
+-------------------+ +---------------------+
| |1 1| | +------------------+
| Application +<------>+ - PID |* 1| |
| | | +<------->+ Node |
+-------------------+ +---------------------+ | |
| | +------------------+
| - String name |1 *----------------------+ | |
| +<------>+ |* 1| - name |
+---------+---------+ | Worker +<------->+ | address |
^* | | | - capacity |
| +---------------------+ | |
|1 | | +--------+---------+
| |1 1| | +--------------------+
| Application +<------>+ - PID |* 1| |
| | | +<------->+ Node |
+-------------------+ +---------------------+ | |
| | +--------------------+
| - String name |1 *----------------------+ | |
| +<------>+ |* 1| - name |
+---------+---------+ | Worker +<------->+ - address |
^* | | | - cpuCapacity |
| +---------------------+ | - energyCapacity |
|1 | | +--------+-----------+
+---------+---------+ | - PID | ^*
| | | - address | |
| ElasticSystem | | - active | |
......
......@@ -15,8 +15,11 @@ public class Node extends DataClayObject {
/** Node address. */
private String address;
/** Node capacity. */
private int capacity;
/** Node CPU capacity. */
private int cpuCapacity;
/** Node Energy capacity. */
private int energyCapacity;
/** List of all masters present in a given node. */
private ArrayList<Master> masters = new ArrayList<>();
......@@ -30,10 +33,11 @@ public class Node extends DataClayObject {
* @param nodeAddress Node address.
* @param nodeCapacity Node capacity.
*/
public Node(final String name, final String nodeAddress, final int nodeCapacity) {
public Node(final String name, final String nodeAddress, final int cpuCapacity, final int energyCapacity) {
this.name = name;
this.address = nodeAddress;
this.capacity = nodeCapacity;
this.cpuCapacity = cpuCapacity;
this.energyCapacity = energyCapacity;
}
......@@ -54,19 +58,35 @@ public class Node extends DataClayObject {
}
/**
* Get capacity of the node
* @return node capacity
* Get CPU capacity of the node
* @return node cpuCapacity
*/
public int getCPUCapacity() {
return cpuCapacity;
}
/**
* Get energy capacity of the node
* @return node cpuCapacity
*/
public int getEnergyCapacity() {
return energyCapacity;
}
/**
* Set CPU capacity of the node
* @param cpuCapacity node capacity to set
*/
public int getCapacity() {
return capacity;
public void setCPUCapacity(int cpuCapacity) {
this.cpuCapacity = cpuCapacity;
}
/**
* Set capacity of the node
* @param capacity node capacity to set
* Set energy capacity of the node
* @param energyCapacity node capacity to set
*/
public void setCapacity(int capacity) {
this.capacity = capacity;
public void setEnergyCapacity(int energyCapacity) {
this.energyCapacity = energyCapacity;
}
......@@ -120,7 +140,7 @@ public class Node extends DataClayObject {
@Override
public String toString() {
return " [ name = " + name + " , machine-address = " + address + " , capacity = " + capacity + " ]";
return " [ name = " + name + " , machine-address = " + address + " , 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