/** * Returns information about a cluster. * @return a map of key value pairs containing cluster information */ public static Map<String, String> getSearchClusterInfo() { Map<String, String> md = new HashMap<String, String>(); NodesInfoResponse res = getClient().admin().cluster().nodesInfo(new NodesInfoRequest().all()).actionGet(); md.put("cluser.name", res.getClusterName().toString()); for (NodeInfo nodeInfo : res) { md.put("node.name", nodeInfo.getNode().getName()); md.put("node.address", nodeInfo.getNode().getAddress().toString()); md.put("node.data", Boolean.toString(nodeInfo.getNode().isDataNode())); md.put("node.client", Boolean.toString(nodeInfo.getNode().isClientNode())); md.put("node.version", nodeInfo.getNode().getVersion().toString()); } return md; }