Skip to content

Commit

Permalink
Fold RestGetAllSettingsAction in RestGetSettingsAction (#30561)
Browse files Browse the repository at this point in the history
We currently have a separate endpoint for retrieving settings from all indices. We introduced such endpoint when removing comma-separated feature parsing for GetIndicesAction. The RestGetAllSettingsAction duplicates the code to print out the response that we already have in GetSettingsResponse (since it became a ToXContentObject), and uses the get index API internally instead of the get settings API, but the response is the same, hence we can fold get all settings and get settings in a single API, which is what this commit does.
  • Loading branch information
javanna committed May 22, 2018
1 parent ad43231 commit 4d3e285
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 127 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@
import org.elasticsearch.rest.action.admin.indices.RestGetAliasesAction;
import org.elasticsearch.rest.action.admin.indices.RestGetAllAliasesAction;
import org.elasticsearch.rest.action.admin.indices.RestGetAllMappingsAction;
import org.elasticsearch.rest.action.admin.indices.RestGetAllSettingsAction;
import org.elasticsearch.rest.action.admin.indices.RestGetFieldMappingAction;
import org.elasticsearch.rest.action.admin.indices.RestGetIndexTemplateAction;
import org.elasticsearch.rest.action.admin.indices.RestGetIndicesAction;
Expand Down Expand Up @@ -558,7 +557,6 @@ public void initRestHandlers(Supplier<DiscoveryNodes> nodesInCluster) {

registerHandler.accept(new RestGetAllAliasesAction(settings, restController));
registerHandler.accept(new RestGetAllMappingsAction(settings, restController));
registerHandler.accept(new RestGetAllSettingsAction(settings, restController, indexScopedSettings, settingsFilter));
registerHandler.accept(new RestGetIndicesAction(settings, restController, indexScopedSettings, settingsFilter));
registerHandler.accept(new RestIndicesStatsAction(settings, restController));
registerHandler.accept(new RestIndicesSegmentsAction(settings, restController));
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,12 @@

package org.elasticsearch.rest.action.admin.indices;

import com.carrotsearch.hppc.cursors.ObjectObjectCursor;

import org.elasticsearch.action.admin.indices.settings.get.GetSettingsRequest;
import org.elasticsearch.action.admin.indices.settings.get.GetSettingsResponse;
import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.IndexScopedSettings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsFilter;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.BytesRestResponse;
Expand All @@ -46,6 +42,7 @@ public class RestGetSettingsAction extends BaseRestHandler {

public RestGetSettingsAction(Settings settings, RestController controller) {
super(settings);
controller.registerHandler(GET, "/_settings", this);
controller.registerHandler(GET, "/_settings/{name}", this);
controller.registerHandler(GET, "/{index}/_settings", this);
controller.registerHandler(GET, "/{index}/_settings/{name}", this);
Expand Down

0 comments on commit 4d3e285

Please sign in to comment.