Skip to content

Commit

Permalink
Handle node id shorter than the usual randomBase64UUID.
Browse files Browse the repository at this point in the history
Fixes elastic#4572 (half of it...)
  • Loading branch information
drewr committed Jan 9, 2014
1 parent 9caf302 commit 63986ca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Expand Up @@ -184,6 +184,7 @@ private Table buildTable(RestRequest request, final ClusterStateResponse state,
table.addCell(null);
table.addCell(null);
table.addCell(null);
table.addCell(null);
table.addCell("UNASSIGNED");
table.endRow();
}
Expand Down
Expand Up @@ -31,6 +31,7 @@
import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.Table;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
Expand Down Expand Up @@ -221,7 +222,7 @@ private Table buildTable(RestRequest req, ClusterStateResponse state, NodesInfoR

table.startRow();

table.addCell(fullId ? node.id() : node.id().substring(0, 4));
table.addCell(fullId ? node.id() : Strings.substring(node.getId(), 0, 4));
table.addCell(info == null ? null : info.getProcess().id());
table.addCell(node.getHostName());
table.addCell(node.getHostAddress());
Expand Down

0 comments on commit 63986ca

Please sign in to comment.