Propagate down from nodes API
@@ -1102,12 +1102,6 @@ public class ApplicationApiHandler extends AuditLoggingRequestHandler {
Slime slime = new Slime();
Cursor nodesArray = slime.setObject().setArray("nodes");
for (Node node : nodes) {
- Optional<Instant> downAt = node.history().stream()
- .filter(event -> "down".equals(event.name()))
- .map(Node.Event::at)
- .findFirst();
- boolean isUp = downAt.isEmpty() || node.history().stream()
- .anyMatch(event -> "up".equals(event.name()) && event.at().isAfter(downAt.get()));
Cursor nodeObject = nodesArray.addObject();
nodeObject.setString("hostname", node.hostname().value());
nodeObject.setString("state", valueOf(node.state()));
@@ -1118,8 +1112,7 @@ public class ApplicationApiHandler extends AuditLoggingRequestHandler {
toSlime(node.resources(), nodeObject);
nodeObject.setString("clusterId", node.clusterId());
nodeObject.setString("clusterType", valueOf(node.clusterType()));
- nodeObject.setBool("down", !isUp);
-// nodeObject.setBool("down", node.down()); // TODO (valerijf): Enable when all configservers expose this
+ nodeObject.setBool("down", node.down());
nodeObject.setBool("retired", node.retired() || node.wantToRetire());
nodeObject.setBool("restarting", node.wantedRestartGeneration() > node.restartGeneration());
nodeObject.setBool("rebooting", node.wantedRebootGeneration() > node.rebootGeneration());
