Filtered out non data-nodes in relevant cat api

Closes #9214
Closes #9287
This commit is contained in:
Nirmal Chidambaram 2015-02-06 00:31:17 -06:00 committed by Boaz Leskes
parent 240155b4ea
commit 931b9f9c74
5 changed files with 46 additions and 15 deletions

View File

@ -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()));

View File

@ -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);

View File

@ -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]
--------------------------------------------------

View File

@ -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]
--------------------------------------------------

View File

@ -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.*