Commit 9d8cbee0 authored by eudaldsabate's avatar eudaldsabate
Browse files

Updated all getByAlias to add the app uuid to find them in dataclay

parent 3cb8bdee
......@@ -108,7 +108,7 @@ public class NFRIntegration {
private Node getOrCreateNode(String workerName, int computingUnits) {
Node node;
try {
node = Node.getByAlias(workerName);
node = Node.getByAlias(String.format("%s-%s", workerName, appUuid));
// TODO: if same node but with different IPs (Wifi vs Eth f.e.) getByAlias will never return the same object
} catch (Exception e) {
float cpuThres = 0.05f;
......@@ -141,10 +141,10 @@ public class NFRIntegration {
String commLinkName = String.format("commlink%s%s", n.getIpEth(), node.getIpEth());
String commLinkName2 = String.format("commlink%s%s", node.getIpEth(), n.getIpEth());
try { // check if link already exists
cl = CommunicationLink.getByAlias(commLinkName);
cl = CommunicationLink.getByAlias(String.format("%s-%s", commLinkName, appUuid));
} catch (Exception e) {
try { // check if link already exists with reversed names
cl = CommunicationLink.getByAlias(commLinkName2);
cl = CommunicationLink.getByAlias(String.format("%s-%s", commLinkName2, appUuid));
} catch (Exception e2) { // if not, create commlink
cl = new CommunicationLink(n, node, n.getIpEth(), node.getIpEth(), 0.0f, 0.0f, 0.0f); // TODO: which
// IPs?
......@@ -238,11 +238,11 @@ public class NFRIntegration {
CommunicationLink cl = null;
String alias = String.format("commlink%s%s", ipNode1, ipNode2);
try {
cl = CommunicationLink.getByAlias(alias);
cl = CommunicationLink.getByAlias(String.format("%s-%s", alias, appUuid));
} catch (Exception e) {
alias = String.format("commlink%s%s", ipNode2, ipNode1);
try {
cl = CommunicationLink.getByAlias(alias);
cl = CommunicationLink.getByAlias(String.format("%s-%s", alias, appUuid));
} catch (Exception e2) {
System.out.println("[NFRIntegration] Exception as nor commlink" + ipNode1 + "," + ipNode2 + " and "
+ "viceversa has not been found in dataclay");
......
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