/** * Deletes all the duplicate NodeInfo by discarding the old instances. * * @param nodes a list of NodeInfo to check for duplicates * @return a NodesInfo that contains a list of NodeInfos without duplicates */ public static NodesInfo deleteDuplicateNodesInfo(ArrayList<NodeInfo> nodes) { NodesInfo nodesInfo = new NodesInfo(); Map<String, NodeInfo> nodesMap = new LinkedHashMap<>(); for (NodeInfo node : nodes) { String nodeId = node.getNodeId(); // If the node already exists, it could be an old instance if (nodesMap.containsKey(nodeId)) { // Check if the node is an old instance if (nodesMap.get(nodeId).getLastHealthUpdate() < node .getLastHealthUpdate()) { nodesMap.put(node.getNodeId(), node); } } else { nodesMap.put(node.getNodeId(), node); } } nodesInfo.addAll(new ArrayList<NodeInfo>(nodesMap.values())); return nodesInfo; }
.append(StringUtils.join(",", info.getNodeLabels())).append("\",\"") .append(info.getRack()).append("\",\"").append(info.getState()) .append("\",\"").append(info.getNodeId()); if (isInactive) { nodeTableData.append("\",\"").append("N/A").append("\",\"");
TR<TBODY<TABLE<Hamlet>>> row = tbody.tr().td(StringUtils.join(",", info.getNodeLabels())) .td(info.getRack()).td(info.getState()).td(info.getNodeId()); if (isInactive) { row.td()._("N/A")._();
TR<TBODY<TABLE<Hamlet>>> row = tbody.tr().td(StringUtils.join(",", info.getNodeLabels())) .td(info.getRack()).td(info.getState()).td(info.getNodeId()); if (isInactive) { row.td()._("N/A")._();
row.td().__(info.getRack()).__(); row.td().__(info.getState()).__(); row.td().__(info.getNodeId()).__(); boolean isInactive = false; if (isInactive) {