/** Update metrics for alive/dead nodes. */ private void setAliveDeadMetrics() { clusterManager.getMetrics().setAliveNodes(nameToNode.size()); int totalHosts = hostsReader.getHosts().size(); if (totalHosts > 0) { clusterManager.getMetrics().setDeadNodes(totalHosts - nameToNode.size()); } }
/** * Blacklist a resource on a node. * * @param nodeName The node name * @param resourceType The resource type. */ void blacklistNode(String nodeName, ResourceType resourceType) { LOG.info("Node " + nodeName + " has been blacklisted for resource " + resourceType); clusterManager.getMetrics().setBlacklistedNodes(faultManager.getBlacklistedNodeCount()); deleteAppFromNode(nodeName, resourceType); }