diff --git a/core/src/main/java/org/elasticsearch/rest/action/cat/RestAllocationAction.java b/core/src/main/java/org/elasticsearch/rest/action/cat/RestAllocationAction.java index 3776841d981..c25ccbe5ed0 100644 --- a/core/src/main/java/org/elasticsearch/rest/action/cat/RestAllocationAction.java +++ b/core/src/main/java/org/elasticsearch/rest/action/cat/RestAllocationAction.java @@ -58,7 +58,7 @@ public class RestAllocationAction extends AbstractCatAction { @Override public void doRequest(final RestRequest request, final RestChannel channel, final Client client) { - final String[] nodes = Strings.splitStringByCommaToArray(request.param("nodes")); + final String[] nodes = Strings.splitStringByCommaToArray(request.param("nodes", "data:true")); final ClusterStateRequest clusterStateRequest = new ClusterStateRequest(); clusterStateRequest.clear().routingTable(true); clusterStateRequest.local(request.paramAsBoolean("local", clusterStateRequest.local())); diff --git a/core/src/main/java/org/elasticsearch/rest/action/cat/RestFielddataAction.java b/core/src/main/java/org/elasticsearch/rest/action/cat/RestFielddataAction.java index 716074e6ff3..a99eec12810 100644 --- a/core/src/main/java/org/elasticsearch/rest/action/cat/RestFielddataAction.java +++ b/core/src/main/java/org/elasticsearch/rest/action/cat/RestFielddataAction.java @@ -55,7 +55,7 @@ public class RestFielddataAction extends AbstractCatAction { @Override void doRequest(final RestRequest request, final RestChannel channel, final Client client) { - final NodesStatsRequest nodesStatsRequest = new NodesStatsRequest(); + final NodesStatsRequest nodesStatsRequest = new NodesStatsRequest("data:true"); nodesStatsRequest.clear(); nodesStatsRequest.indices(true); String[] fields = request.paramAsStringArray("fields", null); diff --git a/docs/reference/cat/allocation.asciidoc b/docs/reference/cat/allocation.asciidoc index 736ece0a612..69eb92a9d35 100644 --- a/docs/reference/cat/allocation.asciidoc +++ b/docs/reference/cat/allocation.asciidoc @@ -1,8 +1,8 @@ [[cat-allocation]] == cat allocation -`allocation` provides a snapshot of how shards have located around the -cluster and the state of disk usage. +`allocation` provides a snapshot of how many shards are allocated to each data node +and how much disk space they are using. [source,shell] -------------------------------------------------- diff --git a/docs/reference/cat/fielddata.asciidoc b/docs/reference/cat/fielddata.asciidoc index 8d0d5221646..c3ac311a622 100644 --- a/docs/reference/cat/fielddata.asciidoc +++ b/docs/reference/cat/fielddata.asciidoc @@ -1,8 +1,8 @@ [[cat-fielddata]] == cat fielddata -`fielddata` shows information about currently loaded fielddata on a per-node -basis. +`fielddata` shows how much heap memory is currently being used by fielddata +on every data node in the cluster. [source,shell] -------------------------------------------------- diff --git a/rest-api-spec/test/cat.allocation/10_basic.yaml b/rest-api-spec/test/cat.allocation/10_basic.yaml index 085bf7808e8..e1a25c97feb 100755 --- a/rest-api-spec/test/cat.allocation/10_basic.yaml +++ b/rest-api-spec/test/cat.allocation/10_basic.yaml @@ -61,9 +61,9 @@ ( \s* #allow leading spaces to account for right-justified text \d+ \s+ \d+(\.\d+)?[kmgt]?b \s+ - (\d+(\.\d+)?[kmgt]b \s+)? #no value from client nodes - (\d+(\.\d+)?[kmgt]b \s+)? #no value from client nodes - (\d+ \s+)? #no value from client nodes + (\d+(\.\d+)?[kmgt]b \s+) #always should return value since we filter out non data nodes by default + (\d+(\.\d+)?[kmgt]b \s+) #always should return value since we filter out non data nodes by default + (\d+ \s+) #always should return value since we filter out non data nodes by default [-\w.]+ \s+ \d+(\.\d+){3} \s+ \w.* @@ -110,6 +110,37 @@ /^ $/ +--- + +"All Nodes": + + - do: + cat.allocation: + node_id: "*" + v: false + + - match: + $body: | + /^ + ( \s* #allow leading spaces to account for right-justified text + \d+ \s+ + \d+(\.\d+)?[kmgt]?b \s+ + (\d+(\.\d+)?[kmgt]b \s+)? #no value from client nodes + (\d+(\.\d+)?[kmgt]b \s+)? #no value from client nodes + (\d+ \s+)? #no value from client nodes + [-\w.]+ \s+ + \d+(\.\d+){3} \s+ + \w.* + \n + )+ + ( + \s* #allow leading spaces to account for right-justified text + \d+ \s+ + UNASSIGNED \s+ + \n + )? + $/ + --- "Column headers": @@ -132,9 +163,9 @@ ( \s* #allow leading spaces to account for right-justified text 0 \s+ \d+(\.\d+)?[kmgt]?b \s+ - (\d+(\.\d+)?[kmgt]b \s+)? #no value from client nodes - (\d+(\.\d+)?[kmgt]b \s+)? #no value from client nodes - (\d+ \s+)? #no value from client nodes + (\d+(\.\d+)?[kmgt]b \s+) #always should return value since we filter out non data nodes by default + (\d+(\.\d+)?[kmgt]b \s+) #always should return value since we filter out non data nodes by default + (\d+ \s+) #always should return value since we filter out non data nodes by default [-\w.]+ \s+ \d+(\.\d+){3} \s+ \w.* @@ -192,9 +223,9 @@ /^ ( 0 \s+ \d+ \s+ - (\d+ \s+)? #no value from client nodes - (\d+ \s+)? #no value from client nodes - (\d+ \s+)? #no value from client nodes + (\d+ \s+) #always should return value since we filter out non data nodes by default + (\d+ \s+) #always should return value since we filter out non data nodes by default + (\d+ \s+) #always should return value since we filter out non data nodes by default [-\w.]+ \s+ \d+(\.\d+){3} \s+ \w.*