Skip to content
Snippets Groups Projects
Commit a9e44967 authored by Johannes Mey's avatar Johannes Mey
Browse files

ignore living partitions with an error

parent bf97e7e2
No related branches found
No related tags found
No related merge requests found
......@@ -164,6 +164,10 @@ public class ErisMQuATBuilder {
for (ERISLivingPartition erisLivingPartition : erisContainer.getPartitions()) {
if (erisLivingPartition.isIgnore()) {
continue;
}
// ignore attribute if all stats are zero
ERISAttributeStatistics statistics = erisLivingPartition.getAttributeStatistics(attribute);
......
......@@ -114,6 +114,8 @@ public class ERISConnector {
// curl http://127.0.0.1:5189/swctrl/lp/<cID>/<nodeID>/<localID>?id=
List<ERISLivingPartition> livingPartitionsToIgnore = new ArrayList<>();
for (ERISContainer ec : erisModel.getContainers()) {
for (ERISLivingPartition lp : ec.getPartitions()) {
URI uri3 = new URIBuilder()
......@@ -125,6 +127,17 @@ public class ERISConnector {
content = getContent(uri3);
JSONObject lpInfo = new JSONObject(content);
JSONArray configurations = lpInfo.getJSONArray("configuration");
if (configurations.length() == 1) {
String errorMessage = configurations.getJSONObject(0).optString("error");
if (errorMessage != null) {
logger.info("Skipping partition {}/{}/{} because '{}'", lp.getContainer(), lp.getNodeId(), lp.getLocalId(), errorMessage);
livingPartitionsToIgnore.add(lp);
lp.setIgnore(true);
continue;
}
}
for (int i = 0; i < configurations.length(); i++)
lp.getConfigurations().
add(new ERISLPConfiguration(configurations.getJSONObject(i), lp));
......@@ -366,8 +379,6 @@ public class ERISConnector {
}
}
}
logger.debug(" -> algorithm '1' says config has changed for living partition {}: {}", livingPartition, configHasChanged);
// figure out if the config has changed by comparing the new and old config by access path and attributes
// check if all new configs are in oldconfig
......@@ -408,7 +419,7 @@ public class ERISConnector {
}
logger.debug(" -> algorithm '2' (the one that decides) says config has changed for living partition {}: {}", livingPartition, configHasChanged);
logger.debug(" -> the configuration change detector says config has changed for living partition {}: {}", livingPartition, configHasChanged);
logger.debug(" old config");
for (ERISLPConfiguration oldConfig : livingPartition.getConfigurations()) {
......
......@@ -9,6 +9,7 @@ public class ERISLivingPartition {
private boolean adaptationScheduled;
private int localId;
private int nodeId;
private boolean ignore;
//content
private List<ERISLPConfiguration> configurations = new ArrayList<>();
......@@ -25,6 +26,14 @@ public class ERISLivingPartition {
this.container = container;
}
public void setIgnore(boolean ignore) {
this.ignore = ignore;
}
public boolean isIgnore() {
return ignore;
}
public boolean isAdaptationScheduled() {
return adaptationScheduled;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment