Skip to content

Commit

Permalink
Indices Stats API: Providing groups as part of the HTTP API does not …
Browse files Browse the repository at this point in the history
…return stats for those groups, closes elastic#1468.
  • Loading branch information
kimchy committed Nov 15, 2011
1 parent e0f12ba commit 3891896
Showing 1 changed file with 10 additions and 10 deletions.
Expand Up @@ -82,12 +82,12 @@ public class RestIndicesStatsAction extends BaseRestHandler {

@Override public void handleRequest(final RestRequest request, final RestChannel channel) {
IndicesStatsRequest indicesStatsRequest = new IndicesStatsRequest();
indicesStatsRequest.indices(splitIndices(request.param("index")));
indicesStatsRequest.types(splitTypes(request.param("types")));
boolean clear = request.paramAsBoolean("clear", false);
if (clear) {
indicesStatsRequest.clear();
}
indicesStatsRequest.indices(splitIndices(request.param("index")));
indicesStatsRequest.types(splitTypes(request.param("types")));
if (request.hasParam("groups")) {
indicesStatsRequest.groups(Strings.splitStringByCommaToArray(request.param("groups")));
}
Expand Down Expand Up @@ -128,9 +128,9 @@ class RestDocsStatsHandler implements RestHandler {

@Override public void handleRequest(final RestRequest request, final RestChannel channel) {
IndicesStatsRequest indicesStatsRequest = new IndicesStatsRequest();
indicesStatsRequest.clear().docs(true);
indicesStatsRequest.indices(splitIndices(request.param("index")));
indicesStatsRequest.types(splitTypes(request.param("types")));
indicesStatsRequest.clear().docs(true);

client.admin().indices().stats(indicesStatsRequest, new ActionListener<IndicesStats>() {
@Override public void onResponse(IndicesStats response) {
Expand Down Expand Up @@ -162,9 +162,9 @@ class RestStoreStatsHandler implements RestHandler {

@Override public void handleRequest(final RestRequest request, final RestChannel channel) {
IndicesStatsRequest indicesStatsRequest = new IndicesStatsRequest();
indicesStatsRequest.clear().store(true);
indicesStatsRequest.indices(splitIndices(request.param("index")));
indicesStatsRequest.types(splitTypes(request.param("types")));
indicesStatsRequest.clear().store(true);

client.admin().indices().stats(indicesStatsRequest, new ActionListener<IndicesStats>() {
@Override public void onResponse(IndicesStats response) {
Expand Down Expand Up @@ -196,6 +196,7 @@ class RestIndexingStatsHandler implements RestHandler {

@Override public void handleRequest(final RestRequest request, final RestChannel channel) {
IndicesStatsRequest indicesStatsRequest = new IndicesStatsRequest();
indicesStatsRequest.clear().indexing(true);
indicesStatsRequest.indices(splitIndices(request.param("index")));
if (request.hasParam("types")) {
indicesStatsRequest.types(splitTypes(request.param("types")));
Expand All @@ -204,7 +205,6 @@ class RestIndexingStatsHandler implements RestHandler {
} else if (request.hasParam("indexingTypes2")) {
indicesStatsRequest.types(splitTypes(request.param("indexingTypes2")));
}
indicesStatsRequest.clear().indexing(true);

client.admin().indices().stats(indicesStatsRequest, new ActionListener<IndicesStats>() {
@Override public void onResponse(IndicesStats response) {
Expand Down Expand Up @@ -236,6 +236,7 @@ class RestSearchStatsHandler implements RestHandler {

@Override public void handleRequest(final RestRequest request, final RestChannel channel) {
IndicesStatsRequest indicesStatsRequest = new IndicesStatsRequest();
indicesStatsRequest.clear().search(true);
indicesStatsRequest.indices(splitIndices(request.param("index")));
if (request.hasParam("groups")) {
indicesStatsRequest.groups(Strings.splitStringByCommaToArray(request.param("groups")));
Expand All @@ -244,7 +245,6 @@ class RestSearchStatsHandler implements RestHandler {
} else if (request.hasParam("searchGroupsStats2")) {
indicesStatsRequest.groups(Strings.splitStringByCommaToArray(request.param("searchGroupsStats2")));
}
indicesStatsRequest.clear().search(true);

client.admin().indices().stats(indicesStatsRequest, new ActionListener<IndicesStats>() {
@Override public void onResponse(IndicesStats response) {
Expand Down Expand Up @@ -276,8 +276,8 @@ class RestGetStatsHandler implements RestHandler {

@Override public void handleRequest(final RestRequest request, final RestChannel channel) {
IndicesStatsRequest indicesStatsRequest = new IndicesStatsRequest();
indicesStatsRequest.indices(splitIndices(request.param("index")));
indicesStatsRequest.clear().get(true);
indicesStatsRequest.indices(splitIndices(request.param("index")));

client.admin().indices().stats(indicesStatsRequest, new ActionListener<IndicesStats>() {
@Override public void onResponse(IndicesStats response) {
Expand Down Expand Up @@ -309,9 +309,9 @@ class RestMergeStatsHandler implements RestHandler {

@Override public void handleRequest(final RestRequest request, final RestChannel channel) {
IndicesStatsRequest indicesStatsRequest = new IndicesStatsRequest();
indicesStatsRequest.clear().merge(true);
indicesStatsRequest.indices(splitIndices(request.param("index")));
indicesStatsRequest.types(splitTypes(request.param("types")));
indicesStatsRequest.clear().merge(true);

client.admin().indices().stats(indicesStatsRequest, new ActionListener<IndicesStats>() {
@Override public void onResponse(IndicesStats response) {
Expand Down Expand Up @@ -343,9 +343,9 @@ class RestFlushStatsHandler implements RestHandler {

@Override public void handleRequest(final RestRequest request, final RestChannel channel) {
IndicesStatsRequest indicesStatsRequest = new IndicesStatsRequest();
indicesStatsRequest.clear().flush(true);
indicesStatsRequest.indices(splitIndices(request.param("index")));
indicesStatsRequest.types(splitTypes(request.param("types")));
indicesStatsRequest.clear().flush(true);

client.admin().indices().stats(indicesStatsRequest, new ActionListener<IndicesStats>() {
@Override public void onResponse(IndicesStats response) {
Expand Down Expand Up @@ -377,9 +377,9 @@ class RestRefreshStatsHandler implements RestHandler {

@Override public void handleRequest(final RestRequest request, final RestChannel channel) {
IndicesStatsRequest indicesStatsRequest = new IndicesStatsRequest();
indicesStatsRequest.clear().refresh(true);
indicesStatsRequest.indices(splitIndices(request.param("index")));
indicesStatsRequest.types(splitTypes(request.param("types")));
indicesStatsRequest.clear().refresh(true);

client.admin().indices().stats(indicesStatsRequest, new ActionListener<IndicesStats>() {
@Override public void onResponse(IndicesStats response) {
Expand Down

0 comments on commit 3891896

Please sign in to comment.