Skip to content

Commit 2f4212b

Browse files
authored
Fold RestGetAllSettingsAction in RestGetSettingsAction (#30561)
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.
1 parent 4a4e3d7 commit 2f4212b

File tree

3 files changed

+1
-127
lines changed

3 files changed

+1
-127
lines changed

server/src/main/java/org/elasticsearch/action/ActionModule.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,6 @@
253253
import org.elasticsearch.rest.action.admin.indices.RestGetAliasesAction;
254254
import org.elasticsearch.rest.action.admin.indices.RestGetAllAliasesAction;
255255
import org.elasticsearch.rest.action.admin.indices.RestGetAllMappingsAction;
256-
import org.elasticsearch.rest.action.admin.indices.RestGetAllSettingsAction;
257256
import org.elasticsearch.rest.action.admin.indices.RestGetFieldMappingAction;
258257
import org.elasticsearch.rest.action.admin.indices.RestGetIndexTemplateAction;
259258
import org.elasticsearch.rest.action.admin.indices.RestGetIndicesAction;
@@ -558,7 +557,6 @@ public void initRestHandlers(Supplier<DiscoveryNodes> nodesInCluster) {
558557

559558
registerHandler.accept(new RestGetAllAliasesAction(settings, restController));
560559
registerHandler.accept(new RestGetAllMappingsAction(settings, restController));
561-
registerHandler.accept(new RestGetAllSettingsAction(settings, restController, indexScopedSettings, settingsFilter));
562560
registerHandler.accept(new RestGetIndicesAction(settings, restController, indexScopedSettings, settingsFilter));
563561
registerHandler.accept(new RestIndicesStatsAction(settings, restController));
564562
registerHandler.accept(new RestIndicesSegmentsAction(settings, restController));

server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetAllSettingsAction.java

Lines changed: 0 additions & 121 deletions
This file was deleted.

server/src/main/java/org/elasticsearch/rest/action/admin/indices/RestGetSettingsAction.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,12 @@
1919

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

22-
import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
23-
2422
import org.elasticsearch.action.admin.indices.settings.get.GetSettingsRequest;
2523
import org.elasticsearch.action.admin.indices.settings.get.GetSettingsResponse;
2624
import org.elasticsearch.action.support.IndicesOptions;
2725
import org.elasticsearch.client.node.NodeClient;
2826
import org.elasticsearch.common.Strings;
29-
import org.elasticsearch.common.settings.IndexScopedSettings;
3027
import org.elasticsearch.common.settings.Settings;
31-
import org.elasticsearch.common.settings.SettingsFilter;
3228
import org.elasticsearch.common.xcontent.XContentBuilder;
3329
import org.elasticsearch.rest.BaseRestHandler;
3430
import org.elasticsearch.rest.BytesRestResponse;
@@ -46,6 +42,7 @@ public class RestGetSettingsAction extends BaseRestHandler {
4642

4743
public RestGetSettingsAction(Settings settings, RestController controller) {
4844
super(settings);
45+
controller.registerHandler(GET, "/_settings", this);
4946
controller.registerHandler(GET, "/_settings/{name}", this);
5047
controller.registerHandler(GET, "/{index}/_settings", this);
5148
controller.registerHandler(GET, "/{index}/_settings/{name}", this);

0 commit comments

Comments
 (0)