private Table buildTable(RestRequest req, ClusterStateResponse state, NodesInfoResponse nodesInfo) { boolean fullId = req.paramAsBoolean("full_id", false); DiscoveryNodes nodes = state.getState().nodes(); Table table = getTableWithHeader(req); for (DiscoveryNode node : nodes) { NodeInfo info = nodesInfo.getNodesMap().get(node.getId()); for (Map.Entry<String, String> attrEntry : node.getAttributes().entrySet()) { table.startRow(); table.addCell(node.getName()); table.addCell(fullId ? node.getId() : Strings.substring(node.getId(), 0, 4)); table.addCell(info == null ? null : info.getProcess().getId()); table.addCell(node.getHostName()); table.addCell(node.getHostAddress()); table.addCell(node.getAddress().address().getPort()); table.addCell(attrEntry.getKey()); table.addCell(attrEntry.getValue()); table.endRow(); } } return table; } }
table.addCell(node.getId()); table.addCell(node.getEphemeralId()); table.addCell(info == null ? null : info.getProcess().getId()); table.addCell(node.getHostName()); table.addCell(node.getHostAddress());
nodeInfo.getOs().toXContent(builder, params); if (nodeInfo.getProcess() != null) { nodeInfo.getProcess().toXContent(builder, params);
table.addCell(info == null ? null : info.getProcess().getId()); table.addCell(node.getHostAddress()); table.addCell(node.getAddress().address().getPort());
private Table buildTable(RestRequest req, ClusterStateResponse state, NodesInfoResponse nodesInfo) { boolean fullId = req.paramAsBoolean("full_id", false); DiscoveryNodes nodes = state.getState().nodes(); Table table = getTableWithHeader(req); for (DiscoveryNode node : nodes) { NodeInfo info = nodesInfo.getNodesMap().get(node.getId()); for (Map.Entry<String, String> attrEntry : node.getAttributes().entrySet()) { table.startRow(); table.addCell(node.getName()); table.addCell(fullId ? node.getId() : Strings.substring(node.getId(), 0, 4)); table.addCell(info == null ? null : info.getProcess().getId()); table.addCell(node.getHostName()); table.addCell(node.getHostAddress()); table.addCell(node.getAddress().address().getPort()); table.addCell(attrEntry.getKey()); table.addCell(attrEntry.getValue()); table.endRow(); } } return table; } }
private Table buildTable(RestRequest req, ClusterStateResponse state, NodesInfoResponse nodesInfo) { boolean fullId = req.paramAsBoolean("full_id", false); DiscoveryNodes nodes = state.getState().nodes(); Table table = getTableWithHeader(req); for (DiscoveryNode node : nodes) { NodeInfo info = nodesInfo.getNodesMap().get(node.getId()); for (Map.Entry<String, String> attrEntry : node.getAttributes().entrySet()) { table.startRow(); table.addCell(node.getName()); table.addCell(fullId ? node.getId() : Strings.substring(node.getId(), 0, 4)); table.addCell(info == null ? null : info.getProcess().getId()); table.addCell(node.getHostName()); table.addCell(node.getHostAddress()); table.addCell(node.getAddress().address().getPort()); table.addCell(attrEntry.getKey()); table.addCell(attrEntry.getValue()); table.endRow(); } } return table; } }
private Map<String, String> getNodesInfos(NodesInfoResponse nodesInfoResponse) { Map<String, String> nodeInfoMap = new HashMap<>(); for (NodeInfo nodeInfo : nodesInfoResponse.getNodes()) { try (XContentBuilder builder = XContentFactory.jsonBuilder()) { builder.humanReadable(true).prettyPrint(); builder.startObject(); nodeInfo.getSettings().toXContent(builder, ToXContent.EMPTY_PARAMS); nodeInfo.getOs().toXContent(builder, ToXContent.EMPTY_PARAMS); nodeInfo.getProcess().toXContent(builder, ToXContent.EMPTY_PARAMS); nodeInfo.getJvm().toXContent(builder, ToXContent.EMPTY_PARAMS); nodeInfo.getThreadPool().toXContent(builder, ToXContent.EMPTY_PARAMS); nodeInfo.getTransport().toXContent(builder, ToXContent.EMPTY_PARAMS); nodeInfo.getPlugins().toXContent(builder, ToXContent.EMPTY_PARAMS); nodeInfo.getIngest().toXContent(builder, ToXContent.EMPTY_PARAMS); builder.endObject(); nodeInfoMap.put(nodeInfo.getNode().getName(), builder.string()); } catch (IOException e) { Exceptions.handle(e); } } return nodeInfoMap; }
private Table buildTable(RestRequest req, ClusterStateResponse state, NodesInfoResponse nodesInfo) { boolean fullId = req.paramAsBoolean("full_id", false); DiscoveryNodes nodes = state.getState().nodes(); Table table = getTableWithHeader(req); for (DiscoveryNode node : nodes) { NodeInfo info = nodesInfo.getNodesMap().get(node.getId()); for (Map.Entry<String, String> attrEntry : node.getAttributes().entrySet()) { table.startRow(); table.addCell(node.getName()); table.addCell(fullId ? node.getId() : Strings.substring(node.getId(), 0, 4)); table.addCell(info == null ? null : info.getProcess().getId()); table.addCell(node.getHostName()); table.addCell(node.getHostAddress()); if (node.getAddress() instanceof InetSocketTransportAddress) { table.addCell(((InetSocketTransportAddress) node.getAddress()).address().getPort()); } else { table.addCell("-"); } table.addCell(attrEntry.getKey()); table.addCell(attrEntry.getValue()); table.endRow(); } } return table; } }
table.addCell(node.getId()); table.addCell(node.getEphemeralId()); table.addCell(info == null ? null : info.getProcess().getId()); table.addCell(node.getHostName()); table.addCell(node.getHostAddress());
table.addCell(node.getId()); table.addCell(node.getEphemeralId()); table.addCell(info == null ? null : info.getProcess().getId()); table.addCell(node.getHostName()); table.addCell(node.getHostAddress());
nodeInfo.getOs().toXContent(builder, params); if (nodeInfo.getProcess() != null) { nodeInfo.getProcess().toXContent(builder, params);
table.addCell(node.getId()); table.addCell(node.getEphemeralId()); table.addCell(info == null ? null : info.getProcess().getId()); table.addCell(node.getHostName()); table.addCell(node.getHostAddress());
nodeInfo.getOs().toXContent(builder, params); if (nodeInfo.getProcess() != null) { nodeInfo.getProcess().toXContent(builder, params);
nodeInfo.getOs().toXContent(builder, params); if (nodeInfo.getProcess() != null) { nodeInfo.getProcess().toXContent(builder, params);
nodeInfo.getOs().toXContent(builder, params); if (nodeInfo.getProcess() != null) { nodeInfo.getProcess().toXContent(builder, params);
table.addCell(info == null ? null : info.getProcess().getId()); table.addCell(node.getHostName()); table.addCell(node.getHostAddress());
private Table buildTable(RestRequest req, ClusterStateResponse state, NodesInfoResponse nodesInfo, NodesStatsResponse nodesStats) { boolean fullId = req.paramAsBoolean("full_id", false); DiscoveryNodes nodes = state.getState().nodes(); Table table = getTableWithHeader(req); for (DiscoveryNode node : nodes) { NodeInfo info = nodesInfo.getNodesMap().get(node.id()); ImmutableMap<String, String> attrs = node.getAttributes(); for(String att : attrs.keySet()) { table.startRow(); table.addCell(node.name()); table.addCell(fullId ? node.id() : Strings.substring(node.getId(), 0, 4)); table.addCell(info == null ? null : info.getProcess().getId()); table.addCell(node.getHostName()); table.addCell(node.getHostAddress()); if (node.address() instanceof InetSocketTransportAddress) { table.addCell(((InetSocketTransportAddress) node.address()).address().getPort()); } else { table.addCell("-"); } table.addCell(att); table.addCell(attrs.containsKey(att) ? attrs.get(att) : null); table.endRow(); } } return table; } }
table.addCell(info == null ? null : info.getProcess().getId()); table.addCell(node.getHostAddress()); table.addCell(node.getAddress().address().getPort());
table.addCell(info == null ? null : info.getProcess().getId()); table.addCell(node.getHostAddress()); table.addCell(node.getAddress().address().getPort());
table.addCell(info == null ? null : info.getProcess().getId()); table.addCell(node.getHostName()); table.addCell(node.getHostAddress());