Skip to content

Commit

Permalink
Cat api: added node id column to _cat/segments response
Browse files Browse the repository at this point in the history
Relates to elastic#10226
  • Loading branch information
Leonardo Menezes authored and javanna committed Mar 25, 2015
1 parent bad60ce commit d086648
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions rest-api-spec/test/cat.segments/10_basic.yaml
Expand Up @@ -10,6 +10,7 @@
shard .+ \n
prirep .+ \n
ip .+ \n
id .+ \n
segment .+ \n
generation .+ \n
docs.count .+ \n
Expand Down
Expand Up @@ -88,6 +88,7 @@ Table getTableWithHeader(RestRequest request) {
table.addCell("shard", "default:true;alias:s,sh;desc:shard name");
table.addCell("prirep", "alias:p,pr,primaryOrReplica;default:true;desc:primary or replica");
table.addCell("ip", "default:true;desc:ip of node where it lives");
table.addCell("id", "default:false;desc:unique id node where it lives");
table.addCell("segment", "default:true;alias:seg;desc:segment name");
table.addCell("generation", "default:true;alias:g,gen;text-align:right;desc:segment generation");
table.addCell("docs.count", "default:true;alias:dc,docsCount;text-align:right;desc:number of docs in segment");
Expand Down Expand Up @@ -123,6 +124,7 @@ private Table buildTable(final RestRequest request, ClusterStateResponse state,
table.addCell(shardSegment.getShardId());
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(segment.getGeneration());
table.addCell(segment.getNumDocs());
Expand Down

0 comments on commit d086648

Please sign in to comment.