Commit 08bcbcf3 authored by dgasull's avatar dgasull

Merge branch 'new-attribute' into 'master'

Added deactivationReasons attribute and its respective methods in Worker.

See merge request !1
parents 32ad7cdc fa24fa88
......@@ -16,14 +16,14 @@ Registered model has the following representation:
| |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 +<----------->+---------------------+
| - 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 energyThreshold | | - String IPNode1 |
+-------------------------+ | | | - float cpuThreshold | | - String IPNode2 |
^* | - int PID | | - int numCores | | - float delayRTT |
| | - boolean active | | | | - float PLR |
......@@ -31,16 +31,17 @@ Registered model has the following representation:
| | - float energyUsage | ^* +---------------------+
| | - int computingUnits | |
| | - String ip | |
| | - float communicationCost| |
| | - float communicationCost | |
| | - List<String> deactivationReasons | |
| | | |
|1 +---------------------------+ |
|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