public String toString() { StringBuilder sb = new StringBuilder(); sb.append("routingNode (["); sb.append(node.getName()); sb.append("]["); sb.append(node.getId()); sb.append("]["); sb.append(node.getHostName()); sb.append("]["); sb.append(node.getHostAddress()); sb.append("], ["); sb.append(shards.size()); sb.append(" assigned shards])"); return sb.toString(); }
boolean match = matchByIP(values, node.getHostAddress(), publishAddress); boolean match = matchByIP(values, node.getHostAddress(), null); if (opType == OpType.AND) { if (match) { if (Regex.simpleMatch(value, node.getHostAddress())) { if (opType == OpType.OR) { return true;
private static DiscoveryNode maybeAddProxyAddress(String proxyAddress, DiscoveryNode node) { if (proxyAddress == null || proxyAddress.isEmpty()) { return node; } else { // resovle proxy address lazy here InetSocketAddress proxyInetAddress = RemoteClusterAware.parseSeedAddress(proxyAddress); return new DiscoveryNode(node.getName(), node.getId(), node.getEphemeralId(), node.getHostName(), node .getHostAddress(), new TransportAddress(proxyInetAddress), node.getAttributes(), node.getRoles(), node.getVersion()); } }
if (Strings.hasLength(checkNode.node().getHostAddress()) && Strings.hasLength(node.node().getHostAddress())) { if (checkNode.node().getHostAddress().equals(node.node().getHostAddress())) { checkNodeOnSameHostAddress = true; if (checkNode.nodeId().equals(assignedShard.currentNodeId())) { String hostType = checkNodeOnSameHostAddress ? "address" : "name"; String host = checkNodeOnSameHostAddress ? node.node().getHostAddress() : node.node().getHostName(); return allocation.decision(Decision.NO, NAME, "the shard cannot be allocated on host %s [%s], where it already exists on node [%s]; " +
builder.field(Fields.HOST, sourceNode.getHostName()); builder.field(Fields.TRANSPORT_ADDRESS, sourceNode.getAddress().toString()); builder.field(Fields.IP, sourceNode.getHostAddress()); builder.field(Fields.NAME, sourceNode.getName()); builder.endObject(); builder.field(Fields.HOST, targetNode.getHostName()); builder.field(Fields.TRANSPORT_ADDRESS, targetNode.getAddress().toString()); builder.field(Fields.IP, targetNode.getHostAddress()); builder.field(Fields.NAME, targetNode.getName()); builder.endObject();
nodeWithInfo.getHostName(), nodeWithInfo.getHostAddress(), listedNode.getAddress(), nodeWithInfo.getAttributes(), nodeWithInfo.getRoles(), nodeWithInfo.getVersion()));
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; } }
if ("_all".equals(nodeId) || Regex.simpleMatch(nodeId, node.getName()) || Regex.simpleMatch(nodeId, node.getHostAddress()) || Regex.simpleMatch(nodeId, node.getHostName())) { resolvedNodesIds.add(node.getId());
table.addCell(info == null ? null : info.getProcess().getId()); table.addCell(node.getHostName()); table.addCell(node.getHostAddress()); table.addCell(node.getAddress().address().getPort()); final ThreadPoolStats.Stats poolStats = entry.getValue();
builder.field("transport_address", nodeInfo.getNode().getAddress().toString()); builder.field("host", nodeInfo.getNode().getHostName()); builder.field("ip", nodeInfo.getNode().getHostAddress());
private Table buildTable(RestRequest request, ClusterStateResponse state) { Table table = getTableWithHeader(request); DiscoveryNodes nodes = state.getState().nodes(); table.startRow(); DiscoveryNode master = nodes.get(nodes.getMasterNodeId()); if (master == null) { table.addCell("-"); table.addCell("-"); table.addCell("-"); table.addCell("-"); } else { table.addCell(master.getId()); table.addCell(master.getHostName()); table.addCell(master.getHostAddress()); table.addCell(master.getName()); } table.endRow(); return table; } }
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("routingNode (["); sb.append(node.getName()); sb.append("]["); sb.append(node.getId()); sb.append("]["); sb.append(node.getHostName()); sb.append("]["); sb.append(node.getHostAddress()); sb.append("], ["); sb.append(shards.size()); sb.append(" assigned shards])"); return sb.toString(); }
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("routingNode (["); sb.append(node.getName()); sb.append("]["); sb.append(node.getId()); sb.append("]["); sb.append(node.getHostName()); sb.append("]["); sb.append(node.getHostAddress()); sb.append("], ["); sb.append(shards.size()); sb.append(" assigned shards])"); return sb.toString(); }
private Table buildTable(final RestRequest request, final NodesStatsResponse nodeStatses) { Table table = getTableWithHeader(request); for (NodeStats nodeStats: nodeStatses.getNodes()) { if (nodeStats.getIndices().getFieldData().getFields() != null) { for (ObjectLongCursor<String> cursor : nodeStats.getIndices().getFieldData().getFields()) { table.startRow(); table.addCell(nodeStats.getNode().getId()); table.addCell(nodeStats.getNode().getHostName()); table.addCell(nodeStats.getNode().getHostAddress()); table.addCell(nodeStats.getNode().getName()); table.addCell(cursor.key); table.addCell(new ByteSizeValue(cursor.value)); table.endRow(); } } } return table; } }
private void buildRow(Table table, boolean fullId, boolean detailed, DiscoveryNodes discoveryNodes, TaskInfo taskInfo) { table.startRow(); String nodeId = taskInfo.getTaskId().getNodeId(); DiscoveryNode node = discoveryNodes.get(nodeId); table.addCell(taskInfo.getId()); table.addCell(taskInfo.getAction()); table.addCell(taskInfo.getTaskId().toString()); if (taskInfo.getParentTaskId().isSet()) { table.addCell(taskInfo.getParentTaskId().toString()); } else { table.addCell("-"); } table.addCell(taskInfo.getType()); table.addCell(taskInfo.getStartTime()); table.addCell(FORMATTER.format(Instant.ofEpochMilli(taskInfo.getStartTime()))); table.addCell(taskInfo.getRunningTimeNanos()); table.addCell(TimeValue.timeValueNanos(taskInfo.getRunningTimeNanos()).toString()); // Node information. Note that the node may be null because it has left the cluster between when we got this response and now. table.addCell(fullId ? nodeId : Strings.substring(nodeId, 0, 4)); table.addCell(node == null ? "-" : node.getHostAddress()); table.addCell(node.getAddress().address().getPort()); table.addCell(node == null ? "-" : node.getName()); table.addCell(node == null ? "-" : node.getVersion().toString()); if (detailed) { table.addCell(taskInfo.getDescription()); } table.endRow(); }
table.addCell(shardSegment.getShardRouting().getId()); table.addCell(shardSegment.getShardRouting().primary() ? "p" : "r"); table.addCell(nodes.get(shardSegment.getShardRouting().currentNodeId()).getHostAddress()); table.addCell(shardSegment.getShardRouting().currentNodeId()); table.addCell(segment.getName());
table.addCell(getOrNull(commonStats, CommonStats::getStore, StoreStats::getSize)); if (shard.assignedToNode()) { String ip = state.getState().nodes().get(shard.currentNodeId()).getHostAddress(); String nodeId = shard.currentNodeId(); StringBuilder name = new StringBuilder(); name.append(state.getState().nodes().get(shard.currentNodeId()).getName()); if (shard.relocating()) { String reloIp = state.getState().nodes().get(shard.relocatingNodeId()).getHostAddress(); String reloNme = state.getState().nodes().get(shard.relocatingNodeId()).getName(); String reloNodeId = shard.relocatingNodeId();
table.addCell(node.getHostAddress()); table.addCell(node.getAddress().address().getPort()); final HttpInfo httpInfo = info == null ? null : info.getHttp();
private static DiscoveryNode maybeAddProxyAddress(String proxyAddress, DiscoveryNode node) { if (proxyAddress == null || proxyAddress.isEmpty()) { return node; } else { // resovle proxy address lazy here InetSocketAddress proxyInetAddress = RemoteClusterAware.parseSeedAddress(proxyAddress); return new DiscoveryNode(node.getName(), node.getId(), node.getEphemeralId(), node.getHostName(), node .getHostAddress(), new TransportAddress(proxyInetAddress), node.getAttributes(), node.getRoles(), node.getVersion()); } }
table.addCell(diskPercent < 0 ? null : diskPercent); table.addCell(node.getHostName()); table.addCell(node.getHostAddress()); table.addCell(node.getName()); table.endRow();