Commit fa24fa88 authored by Rita Sousa's avatar Rita Sousa

Added deactivationReasons attribute and its respective methods in Worker...

Added deactivationReasons attribute and its respective methods in Worker class. Updated README with new attribute.
parent 32ad7cdc
......@@ -13,34 +13,35 @@ Registered model has the following representation:
| Master |
| |
+-------------------------+ +---------------------+
| |1 1| | +--------------------------+
| COMPSsApplication +<------>+ - int PID | | |
| | | - String IP |* 1| Node |
+-------------------------+ | +<------------->+ |
| | +---------------------+ +--------------------------+ +---------------------+
| - String name | | | | |
| - String uuid |1 *+---------------------------+ | - String ipWifi | | CommunicationLink |
| - boolean isSecure +<------>+ |* 1| - String ipEth |* *| |
| - String infoNature | | Worker +---------+ - String ipLte +<----------->+---------------------+
| - int monitoringPeriod | | | | - float signalWifi | | |
| | +---------------------------+ | - float energyThreshold | | - String IPNode1 |
+-------------------------+ | | | - float cpuThreshold | | - String IPNode2 |
^* | - int PID | | - int numCores | | - float delayRTT |
| | - boolean active | | | | - float PLR |
| | - float cpuUsage | +--------------------------+ | |
| | - float energyUsage | ^* +---------------------+
| | - int computingUnits | |
| | - String ip | |
| | - float communicationCost| |
| | | |
|1 +---------------------------+ |
+---------+---------+ |
| | |
| ElasticSystem | |
| | |
+-------------------+ |
| |1 |
| +<----------------------------------------------------------------+
| |1 1| | +--------------------------+
| COMPSsApplication +<------>+ - int PID | | |
| | | - String IP |* 1| Node |
+-------------------------+ | +<------------------>+ |
| | +---------------------+ +--------------------------+ +---------------------+
| - String name | | | | |
| - String uuid | +-------------------------------------+ | - String ipWifi | | CommunicationLink |
| - boolean isSecure |1 *| |* 1| - String ipEth |* *| |
| - String infoNature +<--->+ Worker +-------+ - String ipLte +<----------->+---------------------+
| - int monitoringPeriod | | | | - float signalWifi | | |
| | +-------------------------------------+ | - float energyThreshold | | - String IPNode1 |
+-------------------------+ | | | - float cpuThreshold | | - String IPNode2 |
^* | - int PID | | - int numCores | | - float delayRTT |
| | - boolean active | | | | - float PLR |
| | - float cpuUsage | +--------------------------+ | |
| | - float energyUsage | ^* +---------------------+
| | - int computingUnits | |
| | - String ip | |
| | - float communicationCost | |
| | - List<String> deactivationReasons | |
| | | |
|1 +-------------------------------------+ |
+---------+---------+ |
| | |
| ElasticSystem | |
| | |
+-------------------+ |
| |1 |
| +<---------------------------------------------------------------------+
+---------+---------+
```
......
......@@ -38,6 +38,8 @@ public class Worker extends DataClayObject {
/** COMPSsApplication this worker is executing. */
private COMPSsApplication app;
/** Data that represents the reason/s (dimensions) for the deactivation of this worker */
private List<String> deactivationReasons;
/**
* Constructor.
......@@ -50,10 +52,11 @@ public class Worker extends DataClayObject {
* @param computingUnits Number of computing units used in the worker
* @param ip IP of the Worker
* @param communicationCost Float representing the communication cost
* @param deactivationReasons Reason/s for the deactivation of this worker
*/
public Worker(final Node node, final int pid, final boolean active, final COMPSsApplication app,
final float cpuUsage, final float energyUsage, final int computingUnits, final String ip,
final float communicationCost) {
final float communicationCost, final List<String> deactivationReasons) {
this.node = node;
this.pid = pid;
this.active = active;
......@@ -64,6 +67,7 @@ public class Worker extends DataClayObject {
this.computingUnits = computingUnits;
this.ip = ip;
this.communicationCost = communicationCost;
this.deactivationReasons = deactivationReasons;
}
/**
......@@ -226,6 +230,22 @@ public class Worker extends DataClayObject {
.collect(Collectors.toList());
}
/**
* Get the reason/s for the deactivation of this worker
* @return dimensions (time, energy, communication or security)
*/
public List<String> getDeactivationReasons() {
return deactivationReasons;
}
/**
* Set the reason/s for the deactivation of this worker
* @param deactivationReason new reason/s for the deactivation of this worker
*/
public void setDeactivationReasons(final List<String> deactivationReasons) {
this.deactivationReasons = deactivationReasons;
}
@Override
public String toString() {
return " worker { pid = " + pid + " , address = " + getIp() + ", node = " + node.toString() + ", application = "
......
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