Deguice rest handlers (#22575)

There are presently 7 ctor args used in any rest handlers:
* `Settings`: Every handler uses it to initialize a logger and
  some other strange things.
* `RestController`: Every handler registers itself with it.
* `ClusterSettings`: Used by `RestClusterGetSettingsAction` to
  render the default values for cluster settings.
* `IndexScopedSettings`: Used by `RestGetSettingsAction` to get
  the default values for index settings.
* `SettingsFilter`: Used by a few handlers to filter returned
  settings so we don't expose stuff like passwords.
* `IndexNameExpressionResolver`: Used by `_cat/indices` to
  filter the list of indices.
* `Supplier<DiscoveryNodes>`: Used to fill enrich the response
  by handlers that list tasks.

We probably want to reduce these arguments over time but
switching construction away from guice gives us tighter
control over the list of available arguments.

These parameters are passed to plugins using
`ActionPlugin#initRestHandlers` which is expected to build and
return that handlers immediately. This felt simpler than
returning an reference to the ctors given all the different
possible args.

Breaks java plugins by moving rest handlers off of guice.
This commit is contained in:
Nik Everett 2017-01-20 11:48:51 -05:00 committed by GitHub
parent 025b1a0fc5
commit 6265ef1c1b
135 changed files with 380 additions and 584 deletions

View File

@ -23,15 +23,23 @@ import org.elasticsearch.plugin.noop.action.bulk.RestNoopBulkAction;
import org.elasticsearch.plugin.noop.action.bulk.TransportNoopBulkAction; import org.elasticsearch.plugin.noop.action.bulk.TransportNoopBulkAction;
import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.IndexScopedSettings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsFilter;
import org.elasticsearch.plugin.noop.action.search.NoopSearchAction; import org.elasticsearch.plugin.noop.action.search.NoopSearchAction;
import org.elasticsearch.plugin.noop.action.search.RestNoopSearchAction; import org.elasticsearch.plugin.noop.action.search.RestNoopSearchAction;
import org.elasticsearch.plugin.noop.action.search.TransportNoopSearchAction; import org.elasticsearch.plugin.noop.action.search.TransportNoopSearchAction;
import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.plugins.ActionPlugin;
import org.elasticsearch.plugins.Plugin; import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestHandler; import org.elasticsearch.rest.RestHandler;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.function.Supplier;
public class NoopPlugin extends Plugin implements ActionPlugin { public class NoopPlugin extends Plugin implements ActionPlugin {
@Override @Override
@ -43,7 +51,11 @@ public class NoopPlugin extends Plugin implements ActionPlugin {
} }
@Override @Override
public List<Class<? extends RestHandler>> getRestHandlers() { public List<RestHandler> getRestHandlers(Settings settings, RestController restController, ClusterSettings clusterSettings,
return Arrays.asList(RestNoopBulkAction.class, RestNoopSearchAction.class); IndexScopedSettings indexScopedSettings, SettingsFilter settingsFilter, IndexNameExpressionResolver indexNameExpressionResolver,
Supplier<DiscoveryNodes> nodesInCluster) {
return Arrays.asList(
new RestNoopBulkAction(settings, restController),
new RestNoopSearchAction(settings, restController));
} }
} }

View File

@ -18,8 +18,8 @@
*/ */
package org.elasticsearch.plugin.noop.action.bulk; package org.elasticsearch.plugin.noop.action.bulk;
import org.elasticsearch.action.DocWriteResponse;
import org.elasticsearch.action.DocWriteRequest; import org.elasticsearch.action.DocWriteRequest;
import org.elasticsearch.action.DocWriteResponse;
import org.elasticsearch.action.bulk.BulkItemResponse; import org.elasticsearch.action.bulk.BulkItemResponse;
import org.elasticsearch.action.bulk.BulkRequest; import org.elasticsearch.action.bulk.BulkRequest;
import org.elasticsearch.action.bulk.BulkShardRequest; import org.elasticsearch.action.bulk.BulkShardRequest;
@ -28,7 +28,6 @@ import org.elasticsearch.action.update.UpdateResponse;
import org.elasticsearch.client.Requests; import org.elasticsearch.client.Requests;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.shard.ShardId;
@ -47,7 +46,6 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
import static org.elasticsearch.rest.RestStatus.OK; import static org.elasticsearch.rest.RestStatus.OK;
public class RestNoopBulkAction extends BaseRestHandler { public class RestNoopBulkAction extends BaseRestHandler {
@Inject
public RestNoopBulkAction(Settings settings, RestController controller) { public RestNoopBulkAction(Settings settings, RestController controller) {
super(settings); super(settings);

View File

@ -20,7 +20,6 @@ package org.elasticsearch.plugin.noop.action.search;
import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -33,8 +32,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.elasticsearch.rest.RestRequest.Method.POST;
public class RestNoopSearchAction extends BaseRestHandler { public class RestNoopSearchAction extends BaseRestHandler {
@Inject
public RestNoopSearchAction(Settings settings, RestController controller) { public RestNoopSearchAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_noop_search", this); controller.registerHandler(GET, "/_noop_search", this);

View File

@ -19,13 +19,6 @@
package org.elasticsearch.action; package org.elasticsearch.action;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.UnaryOperator;
import java.util.stream.Collectors;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.elasticsearch.action.admin.cluster.allocation.ClusterAllocationExplainAction; import org.elasticsearch.action.admin.cluster.allocation.ClusterAllocationExplainAction;
import org.elasticsearch.action.admin.cluster.allocation.TransportClusterAllocationExplainAction; import org.elasticsearch.action.admin.cluster.allocation.TransportClusterAllocationExplainAction;
@ -197,14 +190,16 @@ import org.elasticsearch.action.update.TransportUpdateAction;
import org.elasticsearch.action.update.UpdateAction; import org.elasticsearch.action.update.UpdateAction;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver; import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.NamedRegistry; import org.elasticsearch.common.NamedRegistry;
import org.elasticsearch.common.inject.AbstractModule; import org.elasticsearch.common.inject.AbstractModule;
import org.elasticsearch.common.inject.multibindings.MapBinder; import org.elasticsearch.common.inject.multibindings.MapBinder;
import org.elasticsearch.common.inject.multibindings.Multibinder; import org.elasticsearch.common.inject.multibindings.Multibinder;
import org.elasticsearch.common.logging.ESLoggerFactory; import org.elasticsearch.common.logging.ESLoggerFactory;
import org.elasticsearch.common.network.NetworkModule;
import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.IndexScopedSettings;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsFilter;
import org.elasticsearch.indices.breaker.CircuitBreakerService; import org.elasticsearch.indices.breaker.CircuitBreakerService;
import org.elasticsearch.plugins.ActionPlugin; import org.elasticsearch.plugins.ActionPlugin;
import org.elasticsearch.plugins.ActionPlugin.ActionHandler; import org.elasticsearch.plugins.ActionPlugin.ActionHandler;
@ -313,6 +308,15 @@ import org.elasticsearch.rest.action.search.RestSearchAction;
import org.elasticsearch.rest.action.search.RestSearchScrollAction; import org.elasticsearch.rest.action.search.RestSearchScrollAction;
import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.threadpool.ThreadPool;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Supplier;
import java.util.function.UnaryOperator;
import java.util.stream.Collectors;
import static java.util.Collections.unmodifiableList; import static java.util.Collections.unmodifiableList;
import static java.util.Collections.unmodifiableMap; import static java.util.Collections.unmodifiableMap;
@ -325,6 +329,10 @@ public class ActionModule extends AbstractModule {
private final boolean transportClient; private final boolean transportClient;
private final Settings settings; private final Settings settings;
private final IndexNameExpressionResolver indexNameExpressionResolver;
private final IndexScopedSettings indexScopedSettings;
private final ClusterSettings clusterSettings;
private final SettingsFilter settingsFilter;
private final List<ActionPlugin> actionPlugins; private final List<ActionPlugin> actionPlugins;
private final Map<String, ActionHandler<?, ?>> actions; private final Map<String, ActionHandler<?, ?>> actions;
private final List<Class<? extends ActionFilter>> actionFilters; private final List<Class<? extends ActionFilter>> actionFilters;
@ -332,15 +340,20 @@ public class ActionModule extends AbstractModule {
private final DestructiveOperations destructiveOperations; private final DestructiveOperations destructiveOperations;
private final RestController restController; private final RestController restController;
public ActionModule(boolean transportClient, Settings settings, IndexNameExpressionResolver resolver, public ActionModule(boolean transportClient, Settings settings, IndexNameExpressionResolver indexNameExpressionResolver,
ClusterSettings clusterSettings, ThreadPool threadPool, List<ActionPlugin> actionPlugins, IndexScopedSettings indexScopedSettings, ClusterSettings clusterSettings, SettingsFilter settingsFilter,
NodeClient nodeClient, CircuitBreakerService circuitBreakerService) { ThreadPool threadPool, List<ActionPlugin> actionPlugins, NodeClient nodeClient,
CircuitBreakerService circuitBreakerService) {
this.transportClient = transportClient; this.transportClient = transportClient;
this.settings = settings; this.settings = settings;
this.indexNameExpressionResolver = indexNameExpressionResolver;
this.indexScopedSettings = indexScopedSettings;
this.clusterSettings = clusterSettings;
this.settingsFilter = settingsFilter;
this.actionPlugins = actionPlugins; this.actionPlugins = actionPlugins;
actions = setupActions(actionPlugins); actions = setupActions(actionPlugins);
actionFilters = setupActionFilters(actionPlugins); actionFilters = setupActionFilters(actionPlugins);
autoCreateIndex = transportClient ? null : new AutoCreateIndex(settings, clusterSettings, resolver); autoCreateIndex = transportClient ? null : new AutoCreateIndex(settings, clusterSettings, indexNameExpressionResolver);
destructiveOperations = new DestructiveOperations(settings, clusterSettings); destructiveOperations = new DestructiveOperations(settings, clusterSettings);
Set<String> headers = actionPlugins.stream().flatMap(p -> p.getRestHeaders().stream()).collect(Collectors.toSet()); Set<String> headers = actionPlugins.stream().flatMap(p -> p.getRestHeaders().stream()).collect(Collectors.toSet());
UnaryOperator<RestHandler> restWrapper = null; UnaryOperator<RestHandler> restWrapper = null;
@ -485,147 +498,145 @@ public class ActionModule extends AbstractModule {
return unmodifiableList(actionPlugins.stream().flatMap(p -> p.getActionFilters().stream()).collect(Collectors.toList())); return unmodifiableList(actionPlugins.stream().flatMap(p -> p.getActionFilters().stream()).collect(Collectors.toList()));
} }
static Set<Class<? extends RestHandler>> setupRestHandlers(List<ActionPlugin> actionPlugins) { public void initRestHandlers(Supplier<DiscoveryNodes> nodesInCluster) {
Set<Class<? extends RestHandler>> handlers = new HashSet<>(); List<AbstractCatAction> catActions = new ArrayList<>();
registerRestHandler(handlers, RestMainAction.class); Consumer<RestHandler> registerHandler = a -> {
registerRestHandler(handlers, RestNodesInfoAction.class); if (a instanceof AbstractCatAction) {
registerRestHandler(handlers, RestNodesStatsAction.class); catActions.add((AbstractCatAction) a);
registerRestHandler(handlers, RestNodesHotThreadsAction.class); }
registerRestHandler(handlers, RestClusterAllocationExplainAction.class); };
registerRestHandler(handlers, RestClusterStatsAction.class); registerHandler.accept(new RestMainAction(settings, restController));
registerRestHandler(handlers, RestClusterStateAction.class); registerHandler.accept(new RestNodesInfoAction(settings, restController, settingsFilter));
registerRestHandler(handlers, RestClusterHealthAction.class); registerHandler.accept(new RestNodesStatsAction(settings, restController));
registerRestHandler(handlers, RestClusterUpdateSettingsAction.class); registerHandler.accept(new RestNodesHotThreadsAction(settings, restController));
registerRestHandler(handlers, RestClusterGetSettingsAction.class); registerHandler.accept(new RestClusterAllocationExplainAction(settings, restController));
registerRestHandler(handlers, RestClusterRerouteAction.class); registerHandler.accept(new RestClusterStatsAction(settings, restController));
registerRestHandler(handlers, RestClusterSearchShardsAction.class); registerHandler.accept(new RestClusterStateAction(settings, restController, settingsFilter));
registerRestHandler(handlers, RestPendingClusterTasksAction.class); registerHandler.accept(new RestClusterHealthAction(settings, restController));
registerRestHandler(handlers, RestPutRepositoryAction.class); registerHandler.accept(new RestClusterUpdateSettingsAction(settings, restController));
registerRestHandler(handlers, RestGetRepositoriesAction.class); registerHandler.accept(new RestClusterGetSettingsAction(settings, restController, clusterSettings, settingsFilter));
registerRestHandler(handlers, RestDeleteRepositoryAction.class); registerHandler.accept(new RestClusterRerouteAction(settings, restController, settingsFilter));
registerRestHandler(handlers, RestVerifyRepositoryAction.class); registerHandler.accept(new RestClusterSearchShardsAction(settings, restController));
registerRestHandler(handlers, RestGetSnapshotsAction.class); registerHandler.accept(new RestPendingClusterTasksAction(settings, restController));
registerRestHandler(handlers, RestCreateSnapshotAction.class); registerHandler.accept(new RestPutRepositoryAction(settings, restController));
registerRestHandler(handlers, RestRestoreSnapshotAction.class); registerHandler.accept(new RestGetRepositoriesAction(settings, restController, settingsFilter));
registerRestHandler(handlers, RestDeleteSnapshotAction.class); registerHandler.accept(new RestDeleteRepositoryAction(settings, restController));
registerRestHandler(handlers, RestSnapshotsStatusAction.class); registerHandler.accept(new RestVerifyRepositoryAction(settings, restController));
registerHandler.accept(new RestGetSnapshotsAction(settings, restController));
registerHandler.accept(new RestCreateSnapshotAction(settings, restController));
registerHandler.accept(new RestRestoreSnapshotAction(settings, restController));
registerHandler.accept(new RestDeleteSnapshotAction(settings, restController));
registerHandler.accept(new RestSnapshotsStatusAction(settings, restController));
registerRestHandler(handlers, RestIndicesExistsAction.class); registerHandler.accept(new RestIndicesExistsAction(settings, restController));
registerRestHandler(handlers, RestTypesExistsAction.class); registerHandler.accept(new RestTypesExistsAction(settings, restController));
registerRestHandler(handlers, RestGetIndicesAction.class); registerHandler.accept(new RestGetIndicesAction(settings, restController, indexScopedSettings, settingsFilter));
registerRestHandler(handlers, RestIndicesStatsAction.class); registerHandler.accept(new RestIndicesStatsAction(settings, restController));
registerRestHandler(handlers, RestIndicesSegmentsAction.class); registerHandler.accept(new RestIndicesSegmentsAction(settings, restController));
registerRestHandler(handlers, RestIndicesShardStoresAction.class); registerHandler.accept(new RestIndicesShardStoresAction(settings, restController));
registerRestHandler(handlers, RestGetAliasesAction.class); registerHandler.accept(new RestGetAliasesAction(settings, restController));
registerRestHandler(handlers, RestAliasesExistAction.class); registerHandler.accept(new RestAliasesExistAction(settings, restController));
registerRestHandler(handlers, RestIndexDeleteAliasesAction.class); registerHandler.accept(new RestIndexDeleteAliasesAction(settings, restController));
registerRestHandler(handlers, RestIndexPutAliasAction.class); registerHandler.accept(new RestIndexPutAliasAction(settings, restController));
registerRestHandler(handlers, RestIndicesAliasesAction.class); registerHandler.accept(new RestIndicesAliasesAction(settings, restController));
registerRestHandler(handlers, RestCreateIndexAction.class); registerHandler.accept(new RestCreateIndexAction(settings, restController));
registerRestHandler(handlers, RestShrinkIndexAction.class); registerHandler.accept(new RestShrinkIndexAction(settings, restController));
registerRestHandler(handlers, RestRolloverIndexAction.class); registerHandler.accept(new RestRolloverIndexAction(settings, restController));
registerRestHandler(handlers, RestDeleteIndexAction.class); registerHandler.accept(new RestDeleteIndexAction(settings, restController));
registerRestHandler(handlers, RestCloseIndexAction.class); registerHandler.accept(new RestCloseIndexAction(settings, restController));
registerRestHandler(handlers, RestOpenIndexAction.class); registerHandler.accept(new RestOpenIndexAction(settings, restController));
registerRestHandler(handlers, RestUpdateSettingsAction.class); registerHandler.accept(new RestUpdateSettingsAction(settings, restController));
registerRestHandler(handlers, RestGetSettingsAction.class); registerHandler.accept(new RestGetSettingsAction(settings, restController, indexScopedSettings, settingsFilter));
registerRestHandler(handlers, RestAnalyzeAction.class); registerHandler.accept(new RestAnalyzeAction(settings, restController));
registerRestHandler(handlers, RestGetIndexTemplateAction.class); registerHandler.accept(new RestGetIndexTemplateAction(settings, restController));
registerRestHandler(handlers, RestPutIndexTemplateAction.class); registerHandler.accept(new RestPutIndexTemplateAction(settings, restController));
registerRestHandler(handlers, RestDeleteIndexTemplateAction.class); registerHandler.accept(new RestDeleteIndexTemplateAction(settings, restController));
registerRestHandler(handlers, RestHeadIndexTemplateAction.class); registerHandler.accept(new RestHeadIndexTemplateAction(settings, restController));
registerRestHandler(handlers, RestPutMappingAction.class); registerHandler.accept(new RestPutMappingAction(settings, restController));
registerRestHandler(handlers, RestGetMappingAction.class); registerHandler.accept(new RestGetMappingAction(settings, restController));
registerRestHandler(handlers, RestGetFieldMappingAction.class); registerHandler.accept(new RestGetFieldMappingAction(settings, restController));
registerRestHandler(handlers, RestRefreshAction.class); registerHandler.accept(new RestRefreshAction(settings, restController));
registerRestHandler(handlers, RestFlushAction.class); registerHandler.accept(new RestFlushAction(settings, restController));
registerRestHandler(handlers, RestSyncedFlushAction.class); registerHandler.accept(new RestSyncedFlushAction(settings, restController));
registerRestHandler(handlers, RestForceMergeAction.class); registerHandler.accept(new RestForceMergeAction(settings, restController));
registerRestHandler(handlers, RestUpgradeAction.class); registerHandler.accept(new RestUpgradeAction(settings, restController));
registerRestHandler(handlers, RestClearIndicesCacheAction.class); registerHandler.accept(new RestClearIndicesCacheAction(settings, restController));
registerRestHandler(handlers, RestIndexAction.class); registerHandler.accept(new RestIndexAction(settings, restController));
registerRestHandler(handlers, RestGetAction.class); registerHandler.accept(new RestGetAction(settings, restController));
registerRestHandler(handlers, RestGetSourceAction.class); registerHandler.accept(new RestGetSourceAction(settings, restController));
registerRestHandler(handlers, RestHeadAction.Document.class); registerHandler.accept(new RestHeadAction.Document(settings, restController));
registerRestHandler(handlers, RestHeadAction.Source.class); registerHandler.accept(new RestHeadAction.Source(settings, restController));
registerRestHandler(handlers, RestMultiGetAction.class); registerHandler.accept(new RestMultiGetAction(settings, restController));
registerRestHandler(handlers, RestDeleteAction.class); registerHandler.accept(new RestDeleteAction(settings, restController));
registerRestHandler(handlers, org.elasticsearch.rest.action.document.RestCountAction.class); registerHandler.accept(new org.elasticsearch.rest.action.document.RestCountAction(settings, restController));
registerRestHandler(handlers, RestTermVectorsAction.class); registerHandler.accept(new RestTermVectorsAction(settings, restController));
registerRestHandler(handlers, RestMultiTermVectorsAction.class); registerHandler.accept(new RestMultiTermVectorsAction(settings, restController));
registerRestHandler(handlers, RestBulkAction.class); registerHandler.accept(new RestBulkAction(settings, restController));
registerRestHandler(handlers, RestUpdateAction.class); registerHandler.accept(new RestUpdateAction(settings, restController));
registerRestHandler(handlers, RestSearchAction.class); registerHandler.accept(new RestSearchAction(settings, restController));
registerRestHandler(handlers, RestSearchScrollAction.class); registerHandler.accept(new RestSearchScrollAction(settings, restController));
registerRestHandler(handlers, RestClearScrollAction.class); registerHandler.accept(new RestClearScrollAction(settings, restController));
registerRestHandler(handlers, RestMultiSearchAction.class); registerHandler.accept(new RestMultiSearchAction(settings, restController));
registerRestHandler(handlers, RestValidateQueryAction.class); registerHandler.accept(new RestValidateQueryAction(settings, restController));
registerRestHandler(handlers, RestExplainAction.class); registerHandler.accept(new RestExplainAction(settings, restController));
registerRestHandler(handlers, RestRecoveryAction.class); registerHandler.accept(new RestRecoveryAction(settings, restController));
// Scripts API // Scripts API
registerRestHandler(handlers, RestGetStoredScriptAction.class); registerHandler.accept(new RestGetStoredScriptAction(settings, restController));
registerRestHandler(handlers, RestPutStoredScriptAction.class); registerHandler.accept(new RestPutStoredScriptAction(settings, restController));
registerRestHandler(handlers, RestDeleteStoredScriptAction.class); registerHandler.accept(new RestDeleteStoredScriptAction(settings, restController));
registerRestHandler(handlers, RestFieldStatsAction.class); registerHandler.accept(new RestFieldStatsAction(settings, restController));
// Tasks API // Tasks API
registerRestHandler(handlers, RestListTasksAction.class); registerHandler.accept(new RestListTasksAction(settings, restController, nodesInCluster));
registerRestHandler(handlers, RestGetTaskAction.class); registerHandler.accept(new RestGetTaskAction(settings, restController));
registerRestHandler(handlers, RestCancelTasksAction.class); registerHandler.accept(new RestCancelTasksAction(settings, restController, nodesInCluster));
// Ingest API // Ingest API
registerRestHandler(handlers, RestPutPipelineAction.class); registerHandler.accept(new RestPutPipelineAction(settings, restController));
registerRestHandler(handlers, RestGetPipelineAction.class); registerHandler.accept(new RestGetPipelineAction(settings, restController));
registerRestHandler(handlers, RestDeletePipelineAction.class); registerHandler.accept(new RestDeletePipelineAction(settings, restController));
registerRestHandler(handlers, RestSimulatePipelineAction.class); registerHandler.accept(new RestSimulatePipelineAction(settings, restController));
// CAT API // CAT API
registerRestHandler(handlers, RestCatAction.class); registerHandler.accept(new RestAllocationAction(settings, restController));
registerRestHandler(handlers, RestAllocationAction.class); registerHandler.accept(new RestShardsAction(settings, restController));
registerRestHandler(handlers, RestShardsAction.class); registerHandler.accept(new RestMasterAction(settings, restController));
registerRestHandler(handlers, RestMasterAction.class); registerHandler.accept(new RestNodesAction(settings, restController));
registerRestHandler(handlers, RestNodesAction.class); registerHandler.accept(new RestTasksAction(settings, restController, nodesInCluster));
registerRestHandler(handlers, RestTasksAction.class); registerHandler.accept(new RestIndicesAction(settings, restController, indexNameExpressionResolver));
registerRestHandler(handlers, RestIndicesAction.class); registerHandler.accept(new RestSegmentsAction(settings, restController));
registerRestHandler(handlers, RestSegmentsAction.class);
// Fully qualified to prevent interference with rest.action.count.RestCountAction // Fully qualified to prevent interference with rest.action.count.RestCountAction
registerRestHandler(handlers, org.elasticsearch.rest.action.cat.RestCountAction.class); registerHandler.accept(new org.elasticsearch.rest.action.cat.RestCountAction(settings, restController));
// Fully qualified to prevent interference with rest.action.indices.RestRecoveryAction // Fully qualified to prevent interference with rest.action.indices.RestRecoveryAction
registerRestHandler(handlers, org.elasticsearch.rest.action.cat.RestRecoveryAction.class); registerHandler.accept(new org.elasticsearch.rest.action.cat.RestRecoveryAction(settings, restController));
registerRestHandler(handlers, RestHealthAction.class); registerHandler.accept(new RestHealthAction(settings, restController));
registerRestHandler(handlers, org.elasticsearch.rest.action.cat.RestPendingClusterTasksAction.class); registerHandler.accept(new org.elasticsearch.rest.action.cat.RestPendingClusterTasksAction(settings, restController));
registerRestHandler(handlers, RestAliasAction.class); registerHandler.accept(new RestAliasAction(settings, restController));
registerRestHandler(handlers, RestThreadPoolAction.class); registerHandler.accept(new RestThreadPoolAction(settings, restController));
registerRestHandler(handlers, RestPluginsAction.class); registerHandler.accept(new RestPluginsAction(settings, restController));
registerRestHandler(handlers, RestFielddataAction.class); registerHandler.accept(new RestFielddataAction(settings, restController));
registerRestHandler(handlers, RestNodeAttrsAction.class); registerHandler.accept(new RestNodeAttrsAction(settings, restController));
registerRestHandler(handlers, RestRepositoriesAction.class); registerHandler.accept(new RestRepositoriesAction(settings, restController));
registerRestHandler(handlers, RestSnapshotAction.class); registerHandler.accept(new RestSnapshotAction(settings, restController));
registerRestHandler(handlers, RestTemplatesAction.class); registerHandler.accept(new RestTemplatesAction(settings, restController));
for (ActionPlugin plugin : actionPlugins) { for (ActionPlugin plugin : actionPlugins) {
for (Class<? extends RestHandler> handler : plugin.getRestHandlers()) { for (RestHandler handler : plugin.getRestHandlers(settings, restController, clusterSettings, indexScopedSettings,
registerRestHandler(handlers, handler); settingsFilter, indexNameExpressionResolver, nodesInCluster)) {
registerHandler.accept(handler);
} }
} }
return handlers; registerHandler.accept(new RestCatAction(settings, restController, catActions));
}
private static void registerRestHandler(Set<Class<? extends RestHandler>> handlers, Class<? extends RestHandler> handler) {
if (handlers.contains(handler)) {
throw new IllegalArgumentException("can't register the same [rest_handler] more than once for [" + handler.getName() + "]");
}
handlers.add(handler);
} }
@Override @Override
@ -654,25 +665,6 @@ public class ActionModule extends AbstractModule {
bind(supportAction).asEagerSingleton(); bind(supportAction).asEagerSingleton();
} }
} }
if (restController != null) {
// Bind the RestController which is required (by Node) even if rest isn't enabled.
bind(RestController.class).toInstance(restController);
}
// Setup the RestHandlers
if (NetworkModule.HTTP_ENABLED.get(settings)) {
Multibinder<RestHandler> restHandlers = Multibinder.newSetBinder(binder(), RestHandler.class);
Multibinder<AbstractCatAction> catHandlers = Multibinder.newSetBinder(binder(), AbstractCatAction.class);
for (Class<? extends RestHandler> handler : setupRestHandlers(actionPlugins)) {
bind(handler).asEagerSingleton();
if (AbstractCatAction.class.isAssignableFrom(handler)) {
catHandlers.addBinding().to(handler.asSubclass(AbstractCatAction.class));
} else {
restHandlers.addBinding().to(handler);
}
}
}
} }
} }

View File

@ -159,8 +159,9 @@ public abstract class TransportClient extends AbstractClient {
modules.add(pluginModule); modules.add(pluginModule);
} }
modules.add(b -> b.bind(ThreadPool.class).toInstance(threadPool)); modules.add(b -> b.bind(ThreadPool.class).toInstance(threadPool));
ActionModule actionModule = new ActionModule(true, settings, null, settingsModule.getClusterSettings(), ActionModule actionModule = new ActionModule(true, settings, null, settingsModule.getIndexScopedSettings(),
threadPool, pluginsService.filterPlugins(ActionPlugin.class), null, null); settingsModule.getClusterSettings(), settingsModule.getSettingsFilter(), threadPool,
pluginsService.filterPlugins(ActionPlugin.class), null, null);
modules.add(actionModule); modules.add(actionModule);
CircuitBreakerService circuitBreakerService = Node.createCircuitBreakerService(settingsModule.getSettings(), CircuitBreakerService circuitBreakerService = Node.createCircuitBreakerService(settingsModule.getSettings(),

View File

@ -111,7 +111,10 @@ public class PathTrie<T> {
// in case the target(last) node already exist but without a value // in case the target(last) node already exist but without a value
// than the value should be updated. // than the value should be updated.
if (index == (path.length - 1)) { if (index == (path.length - 1)) {
assert (node.value == null || node.value == value); if (node.value != null) {
throw new IllegalArgumentException("Path [" + String.join("/", path)+ "] already has a value ["
+ node.value + "]");
}
if (node.value == null) { if (node.value == null) {
node.value = value; node.value = value;
} }
@ -190,6 +193,9 @@ public class PathTrie<T> {
public void insert(String path, T value) { public void insert(String path, T value) {
String[] strings = path.split(SEPARATOR); String[] strings = path.split(SEPARATOR);
if (strings.length == 0) { if (strings.length == 0) {
if (rootValue != null) {
throw new IllegalArgumentException("Path [/] already has a value [" + rootValue + "]");
}
rootValue = value; rootValue = value;
return; return;
} }

View File

@ -221,5 +221,7 @@ public class SettingsModule implements Module {
return clusterSettings; return clusterSettings;
} }
public SettingsFilter getSettingsFilter() { return settingsFilter; } public SettingsFilter getSettingsFilter() {
return settingsFilter;
}
} }

View File

@ -355,8 +355,8 @@ public class Node implements Closeable {
settingsModule.getClusterSettings()); settingsModule.getClusterSettings());
resourcesToClose.add(circuitBreakerService); resourcesToClose.add(circuitBreakerService);
ActionModule actionModule = new ActionModule(false, settings, clusterModule.getIndexNameExpressionResolver(), ActionModule actionModule = new ActionModule(false, settings, clusterModule.getIndexNameExpressionResolver(),
settingsModule.getClusterSettings(), threadPool, pluginsService.filterPlugins(ActionPlugin.class), client, settingsModule.getIndexScopedSettings(), settingsModule.getClusterSettings(), settingsModule.getSettingsFilter(),
circuitBreakerService); threadPool, pluginsService.filterPlugins(ActionPlugin.class), client, circuitBreakerService);
modules.add(actionModule); modules.add(actionModule);
modules.add(new GatewayModule()); modules.add(new GatewayModule());
@ -484,6 +484,10 @@ public class Node implements Closeable {
client.initialize(injector.getInstance(new Key<Map<GenericAction, TransportAction>>() {}), client.initialize(injector.getInstance(new Key<Map<GenericAction, TransportAction>>() {}),
() -> clusterService.localNode().getId()); () -> clusterService.localNode().getId());
if (NetworkModule.HTTP_ENABLED.get(settings)) {
logger.debug("initializing HTTP handlers ...");
actionModule.initRestHandlers(() -> clusterService.state().nodes());
}
logger.info("initialized"); logger.info("initialized");
success = true; success = true;

View File

@ -25,14 +25,23 @@ import org.elasticsearch.action.GenericAction;
import org.elasticsearch.action.support.ActionFilter; import org.elasticsearch.action.support.ActionFilter;
import org.elasticsearch.action.support.TransportAction; import org.elasticsearch.action.support.TransportAction;
import org.elasticsearch.action.support.TransportActions; import org.elasticsearch.action.support.TransportActions;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.IndexScopedSettings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsFilter;
import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.common.util.concurrent.ThreadContext;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestHandler; import org.elasticsearch.rest.RestHandler;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.function.Supplier;
import java.util.function.UnaryOperator; import java.util.function.UnaryOperator;
/** /**
@ -63,7 +72,9 @@ public interface ActionPlugin {
/** /**
* Rest handlers added by this plugin. * Rest handlers added by this plugin.
*/ */
default List<Class<? extends RestHandler>> getRestHandlers() { default List<RestHandler> getRestHandlers(Settings settings, RestController restController, ClusterSettings clusterSettings,
IndexScopedSettings indexScopedSettings, SettingsFilter settingsFilter,
IndexNameExpressionResolver indexNameExpressionResolver, Supplier<DiscoveryNodes> nodesInCluster) {
return Collections.emptyList(); return Collections.emptyList();
} }

View File

@ -25,7 +25,6 @@ import org.elasticsearch.action.fieldstats.FieldStatsResponse;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
@ -44,8 +43,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
import static org.elasticsearch.rest.action.RestActions.buildBroadcastShardsHeader; import static org.elasticsearch.rest.action.RestActions.buildBroadcastShardsHeader;
public class RestFieldStatsAction extends BaseRestHandler { public class RestFieldStatsAction extends BaseRestHandler {
@Inject
public RestFieldStatsAction(Settings settings, RestController controller) { public RestFieldStatsAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_field_stats", this); controller.registerHandler(GET, "/_field_stats", this);

View File

@ -23,8 +23,6 @@ import org.elasticsearch.action.main.MainAction;
import org.elasticsearch.action.main.MainRequest; import org.elasticsearch.action.main.MainRequest;
import org.elasticsearch.action.main.MainResponse; import org.elasticsearch.action.main.MainResponse;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -40,8 +38,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
import static org.elasticsearch.rest.RestRequest.Method.HEAD; import static org.elasticsearch.rest.RestRequest.Method.HEAD;
public class RestMainAction extends BaseRestHandler { public class RestMainAction extends BaseRestHandler {
@Inject
public RestMainAction(Settings settings, RestController controller) { public RestMainAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/", this); controller.registerHandler(GET, "/", this);

View File

@ -21,9 +21,8 @@ package org.elasticsearch.rest.action.admin.cluster;
import org.elasticsearch.action.admin.cluster.node.tasks.cancel.CancelTasksRequest; import org.elasticsearch.action.admin.cluster.node.tasks.cancel.CancelTasksRequest;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -31,18 +30,18 @@ import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.tasks.TaskId; import org.elasticsearch.tasks.TaskId;
import java.io.IOException; import java.io.IOException;
import java.util.function.Supplier;
import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.elasticsearch.rest.RestRequest.Method.POST;
import static org.elasticsearch.rest.action.admin.cluster.RestListTasksAction.listTasksResponseListener; import static org.elasticsearch.rest.action.admin.cluster.RestListTasksAction.listTasksResponseListener;
public class RestCancelTasksAction extends BaseRestHandler { public class RestCancelTasksAction extends BaseRestHandler {
private final ClusterService clusterService; private final Supplier<DiscoveryNodes> nodesInCluster;
@Inject public RestCancelTasksAction(Settings settings, RestController controller, Supplier<DiscoveryNodes> nodesInCluster) {
public RestCancelTasksAction(Settings settings, RestController controller, ClusterService clusterService) {
super(settings); super(settings);
this.clusterService = clusterService; this.nodesInCluster = nodesInCluster;
controller.registerHandler(POST, "/_tasks/_cancel", this); controller.registerHandler(POST, "/_tasks/_cancel", this);
controller.registerHandler(POST, "/_tasks/{task_id}/_cancel", this); controller.registerHandler(POST, "/_tasks/{task_id}/_cancel", this);
} }
@ -61,7 +60,7 @@ public class RestCancelTasksAction extends BaseRestHandler {
cancelTasksRequest.setActions(actions); cancelTasksRequest.setActions(actions);
cancelTasksRequest.setParentTaskId(parentTaskId); cancelTasksRequest.setParentTaskId(parentTaskId);
return channel -> return channel ->
client.admin().cluster().cancelTasks(cancelTasksRequest, listTasksResponseListener(clusterService, groupBy, channel)); client.admin().cluster().cancelTasks(cancelTasksRequest, listTasksResponseListener(nodesInCluster, groupBy, channel));
} }
@Override @Override

View File

@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.cluster.allocation.ClusterAllocationExplai
import org.elasticsearch.action.admin.cluster.allocation.ClusterAllocationExplainResponse; import org.elasticsearch.action.admin.cluster.allocation.ClusterAllocationExplainResponse;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
@ -43,8 +42,6 @@ import java.io.IOException;
* Class handling cluster allocation explanation at the REST level * Class handling cluster allocation explanation at the REST level
*/ */
public class RestClusterAllocationExplainAction extends BaseRestHandler { public class RestClusterAllocationExplainAction extends BaseRestHandler {
@Inject
public RestClusterAllocationExplainAction(Settings settings, RestController controller) { public RestClusterAllocationExplainAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(RestRequest.Method.GET, "/_cluster/allocation/explain", this); controller.registerHandler(RestRequest.Method.GET, "/_cluster/allocation/explain", this);

View File

@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
import org.elasticsearch.client.Requests; import org.elasticsearch.client.Requests;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.ClusterSettings; import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsFilter; import org.elasticsearch.common.settings.SettingsFilter;
@ -46,7 +45,6 @@ public class RestClusterGetSettingsAction extends BaseRestHandler {
private final ClusterSettings clusterSettings; private final ClusterSettings clusterSettings;
private final SettingsFilter settingsFilter; private final SettingsFilter settingsFilter;
@Inject
public RestClusterGetSettingsAction(Settings settings, RestController controller, ClusterSettings clusterSettings, public RestClusterGetSettingsAction(Settings settings, RestController controller, ClusterSettings clusterSettings,
SettingsFilter settingsFilter) { SettingsFilter settingsFilter) {
super(settings); super(settings);

View File

@ -25,7 +25,6 @@ import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.cluster.health.ClusterHealthStatus; import org.elasticsearch.cluster.health.ClusterHealthStatus;
import org.elasticsearch.common.Priority; import org.elasticsearch.common.Priority;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -40,8 +39,6 @@ import java.util.Set;
import static org.elasticsearch.client.Requests.clusterHealthRequest; import static org.elasticsearch.client.Requests.clusterHealthRequest;
public class RestClusterHealthAction extends BaseRestHandler { public class RestClusterHealthAction extends BaseRestHandler {
@Inject
public RestClusterHealthAction(Settings settings, RestController controller) { public RestClusterHealthAction(Settings settings, RestController controller) {
super(settings); super(settings);

View File

@ -27,7 +27,6 @@ import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.routing.allocation.command.AllocationCommands; import org.elasticsearch.cluster.routing.allocation.command.AllocationCommands;
import org.elasticsearch.common.ParseField; import org.elasticsearch.common.ParseField;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsFilter; import org.elasticsearch.common.settings.SettingsFilter;
import org.elasticsearch.common.xcontent.ObjectParser; import org.elasticsearch.common.xcontent.ObjectParser;
@ -58,7 +57,6 @@ public class RestClusterRerouteAction extends BaseRestHandler {
private final SettingsFilter settingsFilter; private final SettingsFilter settingsFilter;
@Inject
public RestClusterRerouteAction(Settings settings, RestController controller, SettingsFilter settingsFilter) { public RestClusterRerouteAction(Settings settings, RestController controller, SettingsFilter settingsFilter) {
super(settings); super(settings);
this.settingsFilter = settingsFilter; this.settingsFilter = settingsFilter;

View File

@ -24,7 +24,6 @@ import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.Requests; import org.elasticsearch.client.Requests;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -37,8 +36,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.elasticsearch.rest.RestRequest.Method.POST;
public class RestClusterSearchShardsAction extends BaseRestHandler { public class RestClusterSearchShardsAction extends BaseRestHandler {
@Inject
public RestClusterSearchShardsAction(Settings settings, RestController controller) { public RestClusterSearchShardsAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_search_shards", this); controller.registerHandler(GET, "/_search_shards", this);

View File

@ -26,7 +26,6 @@ import org.elasticsearch.client.Requests;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsFilter; import org.elasticsearch.common.settings.SettingsFilter;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
@ -48,7 +47,6 @@ public class RestClusterStateAction extends BaseRestHandler {
private final SettingsFilter settingsFilter; private final SettingsFilter settingsFilter;
@Inject
public RestClusterStateAction(Settings settings, RestController controller, SettingsFilter settingsFilter) { public RestClusterStateAction(Settings settings, RestController controller, SettingsFilter settingsFilter) {
super(settings); super(settings);
controller.registerHandler(RestRequest.Method.GET, "/_cluster/state", this); controller.registerHandler(RestRequest.Method.GET, "/_cluster/state", this);

View File

@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.cluster;
import org.elasticsearch.action.admin.cluster.stats.ClusterStatsRequest; import org.elasticsearch.action.admin.cluster.stats.ClusterStatsRequest;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -31,8 +30,6 @@ import org.elasticsearch.rest.action.RestActions.NodesResponseRestListener;
import java.io.IOException; import java.io.IOException;
public class RestClusterStatsAction extends BaseRestHandler { public class RestClusterStatsAction extends BaseRestHandler {
@Inject
public RestClusterStatsAction(Settings settings, RestController controller) { public RestClusterStatsAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(RestRequest.Method.GET, "/_cluster/stats", this); controller.registerHandler(RestRequest.Method.GET, "/_cluster/stats", this);

View File

@ -23,7 +23,6 @@ import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsRequ
import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsResponse; import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsResponse;
import org.elasticsearch.client.Requests; import org.elasticsearch.client.Requests;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
@ -37,8 +36,6 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
public class RestClusterUpdateSettingsAction extends BaseRestHandler { public class RestClusterUpdateSettingsAction extends BaseRestHandler {
@Inject
public RestClusterUpdateSettingsAction(Settings settings, RestController controller) { public RestClusterUpdateSettingsAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(RestRequest.Method.PUT, "/_cluster/settings", this); controller.registerHandler(RestRequest.Method.PUT, "/_cluster/settings", this);

View File

@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.cluster;
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRequest; import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotRequest;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -38,8 +37,6 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
* Creates a new snapshot * Creates a new snapshot
*/ */
public class RestCreateSnapshotAction extends BaseRestHandler { public class RestCreateSnapshotAction extends BaseRestHandler {
@Inject
public RestCreateSnapshotAction(Settings settings, RestController controller) { public RestCreateSnapshotAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(PUT, "/_snapshot/{repository}/{snapshot}", this); controller.registerHandler(PUT, "/_snapshot/{repository}/{snapshot}", this);

View File

@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.cluster;
import org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryRequest; import org.elasticsearch.action.admin.cluster.repositories.delete.DeleteRepositoryRequest;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -37,8 +36,6 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE;
* Unregisters a repository * Unregisters a repository
*/ */
public class RestDeleteRepositoryAction extends BaseRestHandler { public class RestDeleteRepositoryAction extends BaseRestHandler {
@Inject
public RestDeleteRepositoryAction(Settings settings, RestController controller) { public RestDeleteRepositoryAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(DELETE, "/_snapshot/{repository}", this); controller.registerHandler(DELETE, "/_snapshot/{repository}", this);

View File

@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.cluster;
import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotRequest; import org.elasticsearch.action.admin.cluster.snapshots.delete.DeleteSnapshotRequest;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -37,8 +36,6 @@ import static org.elasticsearch.rest.RestRequest.Method.DELETE;
* Deletes a snapshot * Deletes a snapshot
*/ */
public class RestDeleteSnapshotAction extends BaseRestHandler { public class RestDeleteSnapshotAction extends BaseRestHandler {
@Inject
public RestDeleteSnapshotAction(Settings settings, RestController controller) { public RestDeleteSnapshotAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(DELETE, "/_snapshot/{repository}/{snapshot}", this); controller.registerHandler(DELETE, "/_snapshot/{repository}/{snapshot}", this);

View File

@ -20,7 +20,6 @@ package org.elasticsearch.rest.action.admin.cluster;
import org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptRequest; import org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptRequest;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -32,8 +31,6 @@ import java.io.IOException;
import static org.elasticsearch.rest.RestRequest.Method.DELETE; import static org.elasticsearch.rest.RestRequest.Method.DELETE;
public class RestDeleteStoredScriptAction extends BaseRestHandler { public class RestDeleteStoredScriptAction extends BaseRestHandler {
@Inject
public RestDeleteStoredScriptAction(Settings settings, RestController controller) { public RestDeleteStoredScriptAction(Settings settings, RestController controller) {
this(settings, controller, true); this(settings, controller, true);
} }

View File

@ -25,7 +25,6 @@ import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.cluster.metadata.RepositoriesMetaData; import org.elasticsearch.cluster.metadata.RepositoriesMetaData;
import org.elasticsearch.cluster.metadata.RepositoryMetaData; import org.elasticsearch.cluster.metadata.RepositoryMetaData;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsFilter; import org.elasticsearch.common.settings.SettingsFilter;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
@ -50,7 +49,6 @@ public class RestGetRepositoriesAction extends BaseRestHandler {
private final SettingsFilter settingsFilter; private final SettingsFilter settingsFilter;
@Inject
public RestGetRepositoriesAction(Settings settings, RestController controller, SettingsFilter settingsFilter) { public RestGetRepositoriesAction(Settings settings, RestController controller, SettingsFilter settingsFilter) {
super(settings); super(settings);
controller.registerHandler(GET, "/_snapshot", this); controller.registerHandler(GET, "/_snapshot", this);

View File

@ -22,7 +22,6 @@ package org.elasticsearch.rest.action.admin.cluster;
import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest; import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -38,8 +37,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
* Returns information about snapshot * Returns information about snapshot
*/ */
public class RestGetSnapshotsAction extends BaseRestHandler { public class RestGetSnapshotsAction extends BaseRestHandler {
@Inject
public RestGetSnapshotsAction(Settings settings, RestController controller) { public RestGetSnapshotsAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_snapshot/{repository}/{snapshot}", this); controller.registerHandler(GET, "/_snapshot/{repository}/{snapshot}", this);

View File

@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.cluster;
import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptRequest; import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptRequest;
import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptResponse; import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptResponse;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -37,8 +36,6 @@ import java.io.IOException;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.GET;
public class RestGetStoredScriptAction extends BaseRestHandler { public class RestGetStoredScriptAction extends BaseRestHandler {
@Inject
public RestGetStoredScriptAction(Settings settings, RestController controller) { public RestGetStoredScriptAction(Settings settings, RestController controller) {
this(settings, controller, true); this(settings, controller, true);
} }

View File

@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.cluster;
import org.elasticsearch.action.admin.cluster.node.tasks.get.GetTaskRequest; import org.elasticsearch.action.admin.cluster.node.tasks.get.GetTaskRequest;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -35,7 +34,6 @@ import java.io.IOException;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.GET;
public class RestGetTaskAction extends BaseRestHandler { public class RestGetTaskAction extends BaseRestHandler {
@Inject
public RestGetTaskAction(Settings settings, RestController controller) { public RestGetTaskAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_tasks/{taskId}", this); controller.registerHandler(GET, "/_tasks/{taskId}", this);

View File

@ -23,9 +23,8 @@ import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksRequest; import org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksRequest;
import org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse; import org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
@ -41,18 +40,18 @@ import org.elasticsearch.rest.action.RestToXContentListener;
import org.elasticsearch.tasks.TaskId; import org.elasticsearch.tasks.TaskId;
import java.io.IOException; import java.io.IOException;
import java.util.function.Supplier;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.GET;
public class RestListTasksAction extends BaseRestHandler { public class RestListTasksAction extends BaseRestHandler {
private final ClusterService clusterService; private final Supplier<DiscoveryNodes> nodesInCluster;
@Inject public RestListTasksAction(Settings settings, RestController controller, Supplier<DiscoveryNodes> nodesInCluster) {
public RestListTasksAction(Settings settings, RestController controller, ClusterService clusterService) {
super(settings); super(settings);
this.clusterService = clusterService; this.nodesInCluster = nodesInCluster;
controller.registerHandler(GET, "/_tasks", this); controller.registerHandler(GET, "/_tasks", this);
} }
@ -60,7 +59,8 @@ public class RestListTasksAction extends BaseRestHandler {
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
final ListTasksRequest listTasksRequest = generateListTasksRequest(request); final ListTasksRequest listTasksRequest = generateListTasksRequest(request);
final String groupBy = request.param("group_by", "nodes"); final String groupBy = request.param("group_by", "nodes");
return channel -> client.admin().cluster().listTasks(listTasksRequest, listTasksResponseListener(clusterService, groupBy, channel)); return channel -> client.admin().cluster().listTasks(listTasksRequest,
listTasksResponseListener(nodesInCluster, groupBy, channel));
} }
public static ListTasksRequest generateListTasksRequest(RestRequest request) { public static ListTasksRequest generateListTasksRequest(RestRequest request) {
@ -85,7 +85,7 @@ public class RestListTasksAction extends BaseRestHandler {
* Standard listener for extensions of {@link ListTasksResponse} that supports {@code group_by=nodes}. * Standard listener for extensions of {@link ListTasksResponse} that supports {@code group_by=nodes}.
*/ */
public static <T extends ListTasksResponse> ActionListener<T> listTasksResponseListener( public static <T extends ListTasksResponse> ActionListener<T> listTasksResponseListener(
ClusterService clusterService, Supplier<DiscoveryNodes> nodesInCluster,
String groupBy, String groupBy,
final RestChannel channel) { final RestChannel channel) {
if ("nodes".equals(groupBy)) { if ("nodes".equals(groupBy)) {
@ -93,7 +93,7 @@ public class RestListTasksAction extends BaseRestHandler {
@Override @Override
public RestResponse buildResponse(T response, XContentBuilder builder) throws Exception { public RestResponse buildResponse(T response, XContentBuilder builder) throws Exception {
builder.startObject(); builder.startObject();
response.toXContentGroupedByNode(builder, channel.request(), clusterService.state().nodes()); response.toXContentGroupedByNode(builder, channel.request(), nodesInCluster.get());
builder.endObject(); builder.endObject();
return new BytesRestResponse(RestStatus.OK, builder); return new BytesRestResponse(RestStatus.OK, builder);
} }

View File

@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.cluster.node.hotthreads.NodesHotThreadsReq
import org.elasticsearch.action.admin.cluster.node.hotthreads.NodesHotThreadsResponse; import org.elasticsearch.action.admin.cluster.node.hotthreads.NodesHotThreadsResponse;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -39,8 +38,6 @@ import java.io.IOException;
public class RestNodesHotThreadsAction extends BaseRestHandler { public class RestNodesHotThreadsAction extends BaseRestHandler {
@Inject
public RestNodesHotThreadsAction(Settings settings, RestController controller) { public RestNodesHotThreadsAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(RestRequest.Method.GET, "/_cluster/nodes/hotthreads", this); controller.registerHandler(RestRequest.Method.GET, "/_cluster/nodes/hotthreads", this);

View File

@ -22,7 +22,6 @@ package org.elasticsearch.rest.action.admin.cluster;
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoRequest; import org.elasticsearch.action.admin.cluster.node.info.NodesInfoRequest;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsFilter; import org.elasticsearch.common.settings.SettingsFilter;
import org.elasticsearch.common.util.set.Sets; import org.elasticsearch.common.util.set.Sets;
@ -51,7 +50,6 @@ public class RestNodesInfoAction extends BaseRestHandler {
private final SettingsFilter settingsFilter; private final SettingsFilter settingsFilter;
@Inject
public RestNodesInfoAction(Settings settings, RestController controller, SettingsFilter settingsFilter) { public RestNodesInfoAction(Settings settings, RestController controller, SettingsFilter settingsFilter) {
super(settings); super(settings);
controller.registerHandler(GET, "/_nodes", this); controller.registerHandler(GET, "/_nodes", this);

View File

@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.indices.stats.CommonStatsFlags;
import org.elasticsearch.action.admin.indices.stats.CommonStatsFlags.Flag; import org.elasticsearch.action.admin.indices.stats.CommonStatsFlags.Flag;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -43,8 +42,6 @@ import java.util.function.Consumer;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.GET;
public class RestNodesStatsAction extends BaseRestHandler { public class RestNodesStatsAction extends BaseRestHandler {
@Inject
public RestNodesStatsAction(Settings settings, RestController controller) { public RestNodesStatsAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_nodes/stats", this); controller.registerHandler(GET, "/_nodes/stats", this);

View File

@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.cluster;
import org.elasticsearch.action.admin.cluster.tasks.PendingClusterTasksRequest; import org.elasticsearch.action.admin.cluster.tasks.PendingClusterTasksRequest;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -31,8 +30,6 @@ import org.elasticsearch.rest.action.RestToXContentListener;
import java.io.IOException; import java.io.IOException;
public class RestPendingClusterTasksAction extends BaseRestHandler { public class RestPendingClusterTasksAction extends BaseRestHandler {
@Inject
public RestPendingClusterTasksAction(Settings settings, RestController controller) { public RestPendingClusterTasksAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(RestRequest.Method.GET, "/_cluster/pending_tasks", this); controller.registerHandler(RestRequest.Method.GET, "/_cluster/pending_tasks", this);

View File

@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.cluster;
import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryRequest; import org.elasticsearch.action.admin.cluster.repositories.put.PutRepositoryRequest;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -39,8 +38,6 @@ import static org.elasticsearch.rest.RestRequest.Method.PUT;
* Registers repositories * Registers repositories
*/ */
public class RestPutRepositoryAction extends BaseRestHandler { public class RestPutRepositoryAction extends BaseRestHandler {
@Inject
public RestPutRepositoryAction(Settings settings, RestController controller) { public RestPutRepositoryAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(PUT, "/_snapshot/{repository}", this); controller.registerHandler(PUT, "/_snapshot/{repository}", this);

View File

@ -20,7 +20,6 @@ package org.elasticsearch.rest.action.admin.cluster;
import org.elasticsearch.action.admin.cluster.storedscripts.PutStoredScriptRequest; import org.elasticsearch.action.admin.cluster.storedscripts.PutStoredScriptRequest;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -33,8 +32,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
import static org.elasticsearch.rest.RestRequest.Method.PUT; import static org.elasticsearch.rest.RestRequest.Method.PUT;
public class RestPutStoredScriptAction extends BaseRestHandler { public class RestPutStoredScriptAction extends BaseRestHandler {
@Inject
public RestPutStoredScriptAction(Settings settings, RestController controller) { public RestPutStoredScriptAction(Settings settings, RestController controller) {
this(settings, controller, true); this(settings, controller, true);
} }

View File

@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.cluster;
import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequest; import org.elasticsearch.action.admin.cluster.snapshots.restore.RestoreSnapshotRequest;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -37,8 +36,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
* Restores a snapshot * Restores a snapshot
*/ */
public class RestRestoreSnapshotAction extends BaseRestHandler { public class RestRestoreSnapshotAction extends BaseRestHandler {
@Inject
public RestRestoreSnapshotAction(Settings settings, RestController controller) { public RestRestoreSnapshotAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(POST, "/_snapshot/{repository}/{snapshot}/_restore", this); controller.registerHandler(POST, "/_snapshot/{repository}/{snapshot}/_restore", this);

View File

@ -22,7 +22,6 @@ package org.elasticsearch.rest.action.admin.cluster;
import org.elasticsearch.action.admin.cluster.snapshots.status.SnapshotsStatusRequest; import org.elasticsearch.action.admin.cluster.snapshots.status.SnapshotsStatusRequest;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -38,8 +37,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
* Returns status of currently running snapshot * Returns status of currently running snapshot
*/ */
public class RestSnapshotsStatusAction extends BaseRestHandler { public class RestSnapshotsStatusAction extends BaseRestHandler {
@Inject
public RestSnapshotsStatusAction(Settings settings, RestController controller) { public RestSnapshotsStatusAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_snapshot/{repository}/{snapshot}/_status", this); controller.registerHandler(GET, "/_snapshot/{repository}/{snapshot}/_status", this);

View File

@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.cluster;
import org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryRequest; import org.elasticsearch.action.admin.cluster.repositories.verify.VerifyRepositoryRequest;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -34,8 +33,6 @@ import static org.elasticsearch.client.Requests.verifyRepositoryRequest;
import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.elasticsearch.rest.RestRequest.Method.POST;
public class RestVerifyRepositoryAction extends BaseRestHandler { public class RestVerifyRepositoryAction extends BaseRestHandler {
@Inject
public RestVerifyRepositoryAction(Settings settings, RestController controller) { public RestVerifyRepositoryAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(POST, "/_snapshot/{repository}/_verify", this); controller.registerHandler(POST, "/_snapshot/{repository}/_verify", this);

View File

@ -27,7 +27,6 @@ import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.BytesRestResponse;
@ -41,8 +40,6 @@ import static org.elasticsearch.rest.RestStatus.NOT_FOUND;
import static org.elasticsearch.rest.RestStatus.OK; import static org.elasticsearch.rest.RestStatus.OK;
public class RestAliasesExistAction extends BaseRestHandler { public class RestAliasesExistAction extends BaseRestHandler {
@Inject
public RestAliasesExistAction(Settings settings, RestController controller) { public RestAliasesExistAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(HEAD, "/_alias/{name}", this); controller.registerHandler(HEAD, "/_alias/{name}", this);

View File

@ -21,7 +21,6 @@ package org.elasticsearch.rest.action.admin.indices;
import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest; import org.elasticsearch.action.admin.indices.analyze.AnalyzeRequest;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.ParseField; import org.elasticsearch.common.ParseField;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -49,7 +48,6 @@ public class RestAnalyzeAction extends BaseRestHandler {
public static final ParseField ATTRIBUTES = new ParseField("attributes"); public static final ParseField ATTRIBUTES = new ParseField("attributes");
} }
@Inject
public RestAnalyzeAction(Settings settings, RestController controller) { public RestAnalyzeAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_analyze", this); controller.registerHandler(GET, "/_analyze", this);

View File

@ -25,7 +25,6 @@ import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.ParseField; import org.elasticsearch.common.ParseField;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -44,8 +43,6 @@ import static org.elasticsearch.rest.RestStatus.OK;
import static org.elasticsearch.rest.action.RestActions.buildBroadcastShardsHeader; import static org.elasticsearch.rest.action.RestActions.buildBroadcastShardsHeader;
public class RestClearIndicesCacheAction extends BaseRestHandler { public class RestClearIndicesCacheAction extends BaseRestHandler {
@Inject
public RestClearIndicesCacheAction(Settings settings, RestController controller) { public RestClearIndicesCacheAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(POST, "/_cache/clear", this); controller.registerHandler(POST, "/_cache/clear", this);

View File

@ -23,7 +23,6 @@ import org.elasticsearch.action.admin.indices.close.CloseIndexRequest;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -33,8 +32,6 @@ import org.elasticsearch.rest.action.AcknowledgedRestListener;
import java.io.IOException; import java.io.IOException;
public class RestCloseIndexAction extends BaseRestHandler { public class RestCloseIndexAction extends BaseRestHandler {
@Inject
public RestCloseIndexAction(Settings settings, RestController controller) { public RestCloseIndexAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(RestRequest.Method.POST, "/_close", this); controller.registerHandler(RestRequest.Method.POST, "/_close", this);

View File

@ -23,7 +23,6 @@ import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
import org.elasticsearch.action.admin.indices.create.CreateIndexResponse; import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.action.support.ActiveShardCount;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -34,8 +33,6 @@ import org.elasticsearch.rest.action.AcknowledgedRestListener;
import java.io.IOException; import java.io.IOException;
public class RestCreateIndexAction extends BaseRestHandler { public class RestCreateIndexAction extends BaseRestHandler {
@Inject
public RestCreateIndexAction(Settings settings, RestController controller) { public RestCreateIndexAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(RestRequest.Method.PUT, "/{index}", this); controller.registerHandler(RestRequest.Method.PUT, "/{index}", this);

View File

@ -23,7 +23,6 @@ import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -33,8 +32,6 @@ import org.elasticsearch.rest.action.AcknowledgedRestListener;
import java.io.IOException; import java.io.IOException;
public class RestDeleteIndexAction extends BaseRestHandler { public class RestDeleteIndexAction extends BaseRestHandler {
@Inject
public RestDeleteIndexAction(Settings settings, RestController controller) { public RestDeleteIndexAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(RestRequest.Method.DELETE, "/", this); controller.registerHandler(RestRequest.Method.DELETE, "/", this);

View File

@ -20,7 +20,6 @@ package org.elasticsearch.rest.action.admin.indices;
import org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateRequest; import org.elasticsearch.action.admin.indices.template.delete.DeleteIndexTemplateRequest;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -30,8 +29,6 @@ import org.elasticsearch.rest.action.AcknowledgedRestListener;
import java.io.IOException; import java.io.IOException;
public class RestDeleteIndexTemplateAction extends BaseRestHandler { public class RestDeleteIndexTemplateAction extends BaseRestHandler {
@Inject
public RestDeleteIndexTemplateAction(Settings settings, RestController controller) { public RestDeleteIndexTemplateAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(RestRequest.Method.DELETE, "/_template/{name}", this); controller.registerHandler(RestRequest.Method.DELETE, "/_template/{name}", this);

View File

@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.indices.flush.FlushResponse;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -42,8 +41,6 @@ import static org.elasticsearch.rest.RestStatus.OK;
import static org.elasticsearch.rest.action.RestActions.buildBroadcastShardsHeader; import static org.elasticsearch.rest.action.RestActions.buildBroadcastShardsHeader;
public class RestFlushAction extends BaseRestHandler { public class RestFlushAction extends BaseRestHandler {
@Inject
public RestFlushAction(Settings settings, RestController controller) { public RestFlushAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(POST, "/_flush", this); controller.registerHandler(POST, "/_flush", this);

View File

@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.indices.forcemerge.ForceMergeResponse;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -41,8 +40,6 @@ import static org.elasticsearch.rest.RestStatus.OK;
import static org.elasticsearch.rest.action.RestActions.buildBroadcastShardsHeader; import static org.elasticsearch.rest.action.RestActions.buildBroadcastShardsHeader;
public class RestForceMergeAction extends BaseRestHandler { public class RestForceMergeAction extends BaseRestHandler {
@Inject
public RestForceMergeAction(Settings settings, RestController controller) { public RestForceMergeAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(POST, "/_forcemerge", this); controller.registerHandler(POST, "/_forcemerge", this);

View File

@ -20,13 +20,13 @@
package org.elasticsearch.rest.action.admin.indices; package org.elasticsearch.rest.action.admin.indices;
import com.carrotsearch.hppc.cursors.ObjectObjectCursor; import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest; import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest;
import org.elasticsearch.action.admin.indices.alias.get.GetAliasesResponse; import org.elasticsearch.action.admin.indices.alias.get.GetAliasesResponse;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.cluster.metadata.AliasMetaData; import org.elasticsearch.cluster.metadata.AliasMetaData;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.ToXContent;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
@ -46,8 +46,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
import static org.elasticsearch.rest.RestStatus.OK; import static org.elasticsearch.rest.RestStatus.OK;
public class RestGetAliasesAction extends BaseRestHandler { public class RestGetAliasesAction extends BaseRestHandler {
@Inject
public RestGetAliasesAction(Settings settings, RestController controller) { public RestGetAliasesAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_alias/{name}", this); controller.registerHandler(GET, "/_alias/{name}", this);

View File

@ -25,7 +25,6 @@ import org.elasticsearch.action.admin.indices.mapping.get.GetFieldMappingsRespon
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -44,8 +43,6 @@ import static org.elasticsearch.rest.RestStatus.NOT_FOUND;
import static org.elasticsearch.rest.RestStatus.OK; import static org.elasticsearch.rest.RestStatus.OK;
public class RestGetFieldMappingAction extends BaseRestHandler { public class RestGetFieldMappingAction extends BaseRestHandler {
@Inject
public RestGetFieldMappingAction(Settings settings, RestController controller) { public RestGetFieldMappingAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_mapping/field/{fields}", this); controller.registerHandler(GET, "/_mapping/field/{fields}", this);

View File

@ -23,7 +23,6 @@ import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesRequ
import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse; import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -39,8 +38,6 @@ import static org.elasticsearch.rest.RestStatus.NOT_FOUND;
import static org.elasticsearch.rest.RestStatus.OK; import static org.elasticsearch.rest.RestStatus.OK;
public class RestGetIndexTemplateAction extends BaseRestHandler { public class RestGetIndexTemplateAction extends BaseRestHandler {
@Inject
public RestGetIndexTemplateAction(Settings settings, RestController controller) { public RestGetIndexTemplateAction(Settings settings, RestController controller) {
super(settings); super(settings);

View File

@ -19,6 +19,7 @@
package org.elasticsearch.rest.action.admin.indices; package org.elasticsearch.rest.action.admin.indices;
import com.carrotsearch.hppc.cursors.ObjectObjectCursor; import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
import org.elasticsearch.action.admin.indices.get.GetIndexRequest; import org.elasticsearch.action.admin.indices.get.GetIndexRequest;
import org.elasticsearch.action.admin.indices.get.GetIndexRequest.Feature; import org.elasticsearch.action.admin.indices.get.GetIndexRequest.Feature;
import org.elasticsearch.action.admin.indices.get.GetIndexResponse; import org.elasticsearch.action.admin.indices.get.GetIndexResponse;
@ -28,7 +29,6 @@ import org.elasticsearch.cluster.metadata.AliasMetaData;
import org.elasticsearch.cluster.metadata.MappingMetaData; import org.elasticsearch.cluster.metadata.MappingMetaData;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.collect.ImmutableOpenMap;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.IndexScopedSettings; import org.elasticsearch.common.settings.IndexScopedSettings;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsFilter; import org.elasticsearch.common.settings.SettingsFilter;
@ -53,7 +53,6 @@ public class RestGetIndicesAction extends BaseRestHandler {
private final IndexScopedSettings indexScopedSettings; private final IndexScopedSettings indexScopedSettings;
private final SettingsFilter settingsFilter; private final SettingsFilter settingsFilter;
@Inject
public RestGetIndicesAction(Settings settings, RestController controller, IndexScopedSettings indexScopedSettings, public RestGetIndicesAction(Settings settings, RestController controller, IndexScopedSettings indexScopedSettings,
SettingsFilter settingsFilter) { SettingsFilter settingsFilter) {
super(settings); super(settings);

View File

@ -20,6 +20,7 @@
package org.elasticsearch.rest.action.admin.indices; package org.elasticsearch.rest.action.admin.indices;
import com.carrotsearch.hppc.cursors.ObjectObjectCursor; import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsRequest; import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsRequest;
import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse; import org.elasticsearch.action.admin.indices.mapping.get.GetMappingsResponse;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
@ -27,7 +28,6 @@ import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.cluster.metadata.MappingMetaData; import org.elasticsearch.cluster.metadata.MappingMetaData;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.collect.ImmutableOpenMap; import org.elasticsearch.common.collect.ImmutableOpenMap;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.index.IndexNotFoundException; import org.elasticsearch.index.IndexNotFoundException;
@ -45,8 +45,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
import static org.elasticsearch.rest.RestStatus.OK; import static org.elasticsearch.rest.RestStatus.OK;
public class RestGetMappingAction extends BaseRestHandler { public class RestGetMappingAction extends BaseRestHandler {
@Inject
public RestGetMappingAction(Settings settings, RestController controller) { public RestGetMappingAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/{index}/{type}/_mapping", this); controller.registerHandler(GET, "/{index}/{type}/_mapping", this);

View File

@ -20,12 +20,12 @@
package org.elasticsearch.rest.action.admin.indices; package org.elasticsearch.rest.action.admin.indices;
import com.carrotsearch.hppc.cursors.ObjectObjectCursor; import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
import org.elasticsearch.action.admin.indices.settings.get.GetSettingsRequest; import org.elasticsearch.action.admin.indices.settings.get.GetSettingsRequest;
import org.elasticsearch.action.admin.indices.settings.get.GetSettingsResponse; import org.elasticsearch.action.admin.indices.settings.get.GetSettingsResponse;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.IndexScopedSettings; import org.elasticsearch.common.settings.IndexScopedSettings;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsFilter; import org.elasticsearch.common.settings.SettingsFilter;
@ -47,7 +47,6 @@ public class RestGetSettingsAction extends BaseRestHandler {
private final IndexScopedSettings indexScopedSettings; private final IndexScopedSettings indexScopedSettings;
private final SettingsFilter settingsFilter; private final SettingsFilter settingsFilter;
@Inject
public RestGetSettingsAction(Settings settings, RestController controller, IndexScopedSettings indexScopedSettings, public RestGetSettingsAction(Settings settings, RestController controller, IndexScopedSettings indexScopedSettings,
final SettingsFilter settingsFilter) { final SettingsFilter settingsFilter) {
super(settings); super(settings);

View File

@ -22,7 +22,6 @@ import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesRequ
import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse; import org.elasticsearch.action.admin.indices.template.get.GetIndexTemplatesResponse;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.BytesRestResponse;
@ -39,8 +38,6 @@ import static org.elasticsearch.rest.RestStatus.NOT_FOUND;
import static org.elasticsearch.rest.RestStatus.OK; import static org.elasticsearch.rest.RestStatus.OK;
public class RestHeadIndexTemplateAction extends BaseRestHandler { public class RestHeadIndexTemplateAction extends BaseRestHandler {
@Inject
public RestHeadIndexTemplateAction(Settings settings, RestController controller) { public RestHeadIndexTemplateAction(Settings settings, RestController controller) {
super(settings); super(settings);

View File

@ -22,7 +22,6 @@ import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest.AliasActions; import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest.AliasActions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -34,8 +33,6 @@ import java.io.IOException;
import static org.elasticsearch.rest.RestRequest.Method.DELETE; import static org.elasticsearch.rest.RestRequest.Method.DELETE;
public class RestIndexDeleteAliasesAction extends BaseRestHandler { public class RestIndexDeleteAliasesAction extends BaseRestHandler {
@Inject
public RestIndexDeleteAliasesAction(Settings settings, RestController controller) { public RestIndexDeleteAliasesAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(DELETE, "/{index}/_alias/{name}", this); controller.registerHandler(DELETE, "/{index}/_alias/{name}", this);

View File

@ -22,9 +22,7 @@ import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest.AliasActions; import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest.AliasActions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentFactory;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -38,8 +36,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
import static org.elasticsearch.rest.RestRequest.Method.PUT; import static org.elasticsearch.rest.RestRequest.Method.PUT;
public class RestIndexPutAliasAction extends BaseRestHandler { public class RestIndexPutAliasAction extends BaseRestHandler {
@Inject
public RestIndexPutAliasAction(Settings settings, RestController controller) { public RestIndexPutAliasAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(PUT, "/{index}/_alias/{name}", this); controller.registerHandler(PUT, "/{index}/_alias/{name}", this);

View File

@ -23,7 +23,6 @@ import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest;
import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest.AliasActions; import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest.AliasActions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.ParseField; import org.elasticsearch.common.ParseField;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.ObjectParser; import org.elasticsearch.common.xcontent.ObjectParser;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
@ -46,7 +45,6 @@ public class RestIndicesAliasesAction extends BaseRestHandler {
}, AliasActions.PARSER, new ParseField("actions")); }, AliasActions.PARSER, new ParseField("actions"));
} }
@Inject
public RestIndicesAliasesAction(Settings settings, RestController controller) { public RestIndicesAliasesAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(POST, "/_aliases", this); controller.registerHandler(POST, "/_aliases", this);

View File

@ -25,7 +25,6 @@ import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.BytesRestResponse;
@ -41,8 +40,6 @@ import static org.elasticsearch.rest.RestStatus.NOT_FOUND;
import static org.elasticsearch.rest.RestStatus.OK; import static org.elasticsearch.rest.RestStatus.OK;
public class RestIndicesExistsAction extends BaseRestHandler { public class RestIndicesExistsAction extends BaseRestHandler {
@Inject
public RestIndicesExistsAction(Settings settings, RestController controller) { public RestIndicesExistsAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(HEAD, "/{index}", this); controller.registerHandler(HEAD, "/{index}", this);

View File

@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.indices.segments.IndicesSegmentsRequest;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -41,8 +40,6 @@ import static org.elasticsearch.rest.RestStatus.OK;
import static org.elasticsearch.rest.action.RestActions.buildBroadcastShardsHeader; import static org.elasticsearch.rest.action.RestActions.buildBroadcastShardsHeader;
public class RestIndicesSegmentsAction extends BaseRestHandler { public class RestIndicesSegmentsAction extends BaseRestHandler {
@Inject
public RestIndicesSegmentsAction(Settings settings, RestController controller) { public RestIndicesSegmentsAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_segments", this); controller.registerHandler(GET, "/_segments", this);

View File

@ -25,7 +25,6 @@ import org.elasticsearch.action.admin.indices.shards.IndicesShardStoresResponse;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -44,8 +43,6 @@ import static org.elasticsearch.rest.RestStatus.OK;
* Rest action for {@link IndicesShardStoresAction} * Rest action for {@link IndicesShardStoresAction}
*/ */
public class RestIndicesShardStoresAction extends BaseRestHandler { public class RestIndicesShardStoresAction extends BaseRestHandler {
@Inject
public RestIndicesShardStoresAction(Settings settings, RestController controller) { public RestIndicesShardStoresAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_shard_stores", this); controller.registerHandler(GET, "/_shard_stores", this);

View File

@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.indices.stats.IndicesStatsResponse;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -48,8 +47,6 @@ import static org.elasticsearch.rest.RestStatus.OK;
import static org.elasticsearch.rest.action.RestActions.buildBroadcastShardsHeader; import static org.elasticsearch.rest.action.RestActions.buildBroadcastShardsHeader;
public class RestIndicesStatsAction extends BaseRestHandler { public class RestIndicesStatsAction extends BaseRestHandler {
@Inject
public RestIndicesStatsAction(Settings settings, RestController controller) { public RestIndicesStatsAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_stats", this); controller.registerHandler(GET, "/_stats", this);
@ -58,7 +55,7 @@ public class RestIndicesStatsAction extends BaseRestHandler {
controller.registerHandler(GET, "/{index}/_stats/{metric}", this); controller.registerHandler(GET, "/{index}/_stats/{metric}", this);
} }
static Map<String, Consumer<IndicesStatsRequest>> METRICS; static final Map<String, Consumer<IndicesStatsRequest>> METRICS;
static { static {
final Map<String, Consumer<IndicesStatsRequest>> metrics = new HashMap<>(); final Map<String, Consumer<IndicesStatsRequest>> metrics = new HashMap<>();

View File

@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.indices.open.OpenIndexResponse;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -34,8 +33,6 @@ import org.elasticsearch.rest.action.AcknowledgedRestListener;
import java.io.IOException; import java.io.IOException;
public class RestOpenIndexAction extends BaseRestHandler { public class RestOpenIndexAction extends BaseRestHandler {
@Inject
public RestOpenIndexAction(Settings settings, RestController controller) { public RestOpenIndexAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(RestRequest.Method.POST, "/_open", this); controller.registerHandler(RestRequest.Method.POST, "/_open", this);

View File

@ -22,7 +22,6 @@ package org.elasticsearch.rest.action.admin.indices;
import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest; import org.elasticsearch.action.admin.indices.template.put.PutIndexTemplateRequest;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
@ -39,7 +38,6 @@ public class RestPutIndexTemplateAction extends BaseRestHandler {
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(Loggers.getLogger(RestPutIndexTemplateAction.class)); private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(Loggers.getLogger(RestPutIndexTemplateAction.class));
@Inject
public RestPutIndexTemplateAction(Settings settings, RestController controller) { public RestPutIndexTemplateAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(RestRequest.Method.PUT, "/_template/{name}", this); controller.registerHandler(RestRequest.Method.PUT, "/_template/{name}", this);

View File

@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.indices.mapping.put.PutMappingResponse;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -38,9 +37,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
import static org.elasticsearch.rest.RestRequest.Method.PUT; import static org.elasticsearch.rest.RestRequest.Method.PUT;
public class RestPutMappingAction extends BaseRestHandler { public class RestPutMappingAction extends BaseRestHandler {
@Inject
public RestPutMappingAction(Settings settings, RestController controller) { public RestPutMappingAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(PUT, "/{index}/_mapping/", this); controller.registerHandler(PUT, "/{index}/_mapping/", this);

View File

@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.indices.recovery.RecoveryResponse;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -43,8 +42,6 @@ import static org.elasticsearch.rest.RestStatus.OK;
* REST handler to report on index recoveries. * REST handler to report on index recoveries.
*/ */
public class RestRecoveryAction extends BaseRestHandler { public class RestRecoveryAction extends BaseRestHandler {
@Inject
public RestRecoveryAction(Settings settings, RestController controller) { public RestRecoveryAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_recovery", this); controller.registerHandler(GET, "/_recovery", this);

View File

@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.indices.refresh.RefreshResponse;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -42,8 +41,6 @@ import static org.elasticsearch.rest.RestStatus.OK;
import static org.elasticsearch.rest.action.RestActions.buildBroadcastShardsHeader; import static org.elasticsearch.rest.action.RestActions.buildBroadcastShardsHeader;
public class RestRefreshAction extends BaseRestHandler { public class RestRefreshAction extends BaseRestHandler {
@Inject
public RestRefreshAction(Settings settings, RestController controller) { public RestRefreshAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(POST, "/_refresh", this); controller.registerHandler(POST, "/_refresh", this);

View File

@ -22,7 +22,6 @@ package org.elasticsearch.rest.action.admin.indices;
import org.elasticsearch.action.admin.indices.rollover.RolloverRequest; import org.elasticsearch.action.admin.indices.rollover.RolloverRequest;
import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.action.support.ActiveShardCount;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -32,8 +31,6 @@ import org.elasticsearch.rest.action.RestToXContentListener;
import java.io.IOException; import java.io.IOException;
public class RestRolloverIndexAction extends BaseRestHandler { public class RestRolloverIndexAction extends BaseRestHandler {
@Inject
public RestRolloverIndexAction(Settings settings, RestController controller) { public RestRolloverIndexAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(RestRequest.Method.POST, "/{index}/_rollover", this); controller.registerHandler(RestRequest.Method.POST, "/{index}/_rollover", this);

View File

@ -23,7 +23,6 @@ import org.elasticsearch.action.admin.indices.shrink.ShrinkRequest;
import org.elasticsearch.action.admin.indices.shrink.ShrinkResponse; import org.elasticsearch.action.admin.indices.shrink.ShrinkResponse;
import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.action.support.ActiveShardCount;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -34,8 +33,6 @@ import org.elasticsearch.rest.action.AcknowledgedRestListener;
import java.io.IOException; import java.io.IOException;
public class RestShrinkIndexAction extends BaseRestHandler { public class RestShrinkIndexAction extends BaseRestHandler {
@Inject
public RestShrinkIndexAction(Settings settings, RestController controller) { public RestShrinkIndexAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(RestRequest.Method.PUT, "/{index}/_shrink/{target}", this); controller.registerHandler(RestRequest.Method.PUT, "/{index}/_shrink/{target}", this);

View File

@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.indices.flush.SyncedFlushResponse;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -40,8 +39,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
import static org.elasticsearch.rest.RestRequest.Method.POST; import static org.elasticsearch.rest.RestRequest.Method.POST;
public class RestSyncedFlushAction extends BaseRestHandler { public class RestSyncedFlushAction extends BaseRestHandler {
@Inject
public RestSyncedFlushAction(Settings settings, RestController controller) { public RestSyncedFlushAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(POST, "/_flush/synced", this); controller.registerHandler(POST, "/_flush/synced", this);

View File

@ -24,7 +24,6 @@ import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.BytesRestResponse;
@ -43,8 +42,6 @@ import static org.elasticsearch.rest.RestStatus.OK;
* Rest api for checking if a type exists. * Rest api for checking if a type exists.
*/ */
public class RestTypesExistsAction extends BaseRestHandler { public class RestTypesExistsAction extends BaseRestHandler {
@Inject
public RestTypesExistsAction(Settings settings, RestController controller) { public RestTypesExistsAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerWithDeprecatedHandler( controller.registerWithDeprecatedHandler(

View File

@ -23,7 +23,6 @@ import org.elasticsearch.action.admin.indices.settings.put.UpdateSettingsRequest
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -50,7 +49,6 @@ public class RestUpdateSettingsAction extends BaseRestHandler {
"ignore_unavailable", "ignore_unavailable",
"allow_no_indices")); "allow_no_indices"));
@Inject
public RestUpdateSettingsAction(Settings settings, RestController controller) { public RestUpdateSettingsAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(RestRequest.Method.PUT, "/{index}/_settings", this); controller.registerHandler(RestRequest.Method.PUT, "/{index}/_settings", this);

View File

@ -28,7 +28,6 @@ import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.collect.Tuple; import org.elasticsearch.common.collect.Tuple;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -47,8 +46,6 @@ import static org.elasticsearch.rest.RestStatus.OK;
import static org.elasticsearch.rest.action.RestActions.buildBroadcastShardsHeader; import static org.elasticsearch.rest.action.RestActions.buildBroadcastShardsHeader;
public class RestUpgradeAction extends BaseRestHandler { public class RestUpgradeAction extends BaseRestHandler {
@Inject
public RestUpgradeAction(Settings settings, RestController controller) { public RestUpgradeAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(POST, "/_upgrade", this); controller.registerHandler(POST, "/_upgrade", this);

View File

@ -26,7 +26,6 @@ import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.ParsingException;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -46,7 +45,6 @@ import static org.elasticsearch.rest.RestStatus.OK;
import static org.elasticsearch.rest.action.RestActions.buildBroadcastShardsHeader; import static org.elasticsearch.rest.action.RestActions.buildBroadcastShardsHeader;
public class RestValidateQueryAction extends BaseRestHandler { public class RestValidateQueryAction extends BaseRestHandler {
@Inject
public RestValidateQueryAction(Settings settings, RestController controller) { public RestValidateQueryAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_validate/query", this); controller.registerHandler(GET, "/_validate/query", this);

View File

@ -19,13 +19,13 @@
package org.elasticsearch.rest.action.cat; package org.elasticsearch.rest.action.cat;
import com.carrotsearch.hppc.cursors.ObjectObjectCursor; import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest; import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest;
import org.elasticsearch.action.admin.indices.alias.get.GetAliasesResponse; import org.elasticsearch.action.admin.indices.alias.get.GetAliasesResponse;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.cluster.metadata.AliasMetaData; import org.elasticsearch.cluster.metadata.AliasMetaData;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.Table; import org.elasticsearch.common.Table;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestRequest;
@ -37,15 +37,12 @@ import java.util.List;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.GET;
public class RestAliasAction extends AbstractCatAction { public class RestAliasAction extends AbstractCatAction {
@Inject
public RestAliasAction(Settings settings, RestController controller) { public RestAliasAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_cat/aliases", this); controller.registerHandler(GET, "/_cat/aliases", this);
controller.registerHandler(GET, "/_cat/aliases/{alias}", this); controller.registerHandler(GET, "/_cat/aliases/{alias}", this);
} }
@Override @Override
protected RestChannelConsumer doCatRequest(final RestRequest request, final NodeClient client) { protected RestChannelConsumer doCatRequest(final RestRequest request, final NodeClient client) {
final GetAliasesRequest getAliasesRequest = request.hasParam("alias") ? final GetAliasesRequest getAliasesRequest = request.hasParam("alias") ?

View File

@ -20,6 +20,7 @@
package org.elasticsearch.rest.action.cat; package org.elasticsearch.rest.action.cat;
import com.carrotsearch.hppc.ObjectIntScatterMap; import com.carrotsearch.hppc.ObjectIntScatterMap;
import org.elasticsearch.action.admin.cluster.node.stats.NodeStats; import org.elasticsearch.action.admin.cluster.node.stats.NodeStats;
import org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequest; import org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequest;
import org.elasticsearch.action.admin.cluster.node.stats.NodesStatsResponse; import org.elasticsearch.action.admin.cluster.node.stats.NodesStatsResponse;
@ -31,7 +32,6 @@ import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.routing.ShardRouting; import org.elasticsearch.cluster.routing.ShardRouting;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.Table; import org.elasticsearch.common.Table;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -44,8 +44,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
public class RestAllocationAction extends AbstractCatAction { public class RestAllocationAction extends AbstractCatAction {
@Inject
public RestAllocationAction(Settings settings, RestController controller) { public RestAllocationAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_cat/allocation", this); controller.registerHandler(GET, "/_cat/allocation", this);

View File

@ -29,7 +29,7 @@ import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.RestStatus; import org.elasticsearch.rest.RestStatus;
import java.io.IOException; import java.io.IOException;
import java.util.Set; import java.util.List;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.GET;
@ -40,7 +40,7 @@ public class RestCatAction extends BaseRestHandler {
private final String HELP; private final String HELP;
@Inject @Inject
public RestCatAction(Settings settings, RestController controller, Set<AbstractCatAction> catActions) { public RestCatAction(Settings settings, RestController controller, List<AbstractCatAction> catActions) {
super(settings); super(settings);
controller.registerHandler(GET, "/_cat", this); controller.registerHandler(GET, "/_cat", this);
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();

View File

@ -25,7 +25,6 @@ import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.Table; import org.elasticsearch.common.Table;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilder;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -40,8 +39,7 @@ import java.io.IOException;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.GET;
public class RestCountAction extends AbstractCatAction { public class RestCountAction extends AbstractCatAction {
@Inject public RestCountAction(Settings settings, RestController restController) {
public RestCountAction(Settings settings, RestController restController, RestController controller) {
super(settings); super(settings);
restController.registerHandler(GET, "/_cat/count", this); restController.registerHandler(GET, "/_cat/count", this);
restController.registerHandler(GET, "/_cat/count/{index}", this); restController.registerHandler(GET, "/_cat/count/{index}", this);

View File

@ -20,12 +20,12 @@
package org.elasticsearch.rest.action.cat; package org.elasticsearch.rest.action.cat;
import com.carrotsearch.hppc.cursors.ObjectLongCursor; import com.carrotsearch.hppc.cursors.ObjectLongCursor;
import org.elasticsearch.action.admin.cluster.node.stats.NodeStats; import org.elasticsearch.action.admin.cluster.node.stats.NodeStats;
import org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequest; import org.elasticsearch.action.admin.cluster.node.stats.NodesStatsRequest;
import org.elasticsearch.action.admin.cluster.node.stats.NodesStatsResponse; import org.elasticsearch.action.admin.cluster.node.stats.NodesStatsResponse;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Table; import org.elasticsearch.common.Table;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.unit.ByteSizeValue;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -39,8 +39,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
* Cat API class to display information about the size of fielddata fields per node * Cat API class to display information about the size of fielddata fields per node
*/ */
public class RestFielddataAction extends AbstractCatAction { public class RestFielddataAction extends AbstractCatAction {
@Inject
public RestFielddataAction(Settings settings, RestController controller) { public RestFielddataAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_cat/fielddata", this); controller.registerHandler(GET, "/_cat/fielddata", this);

View File

@ -23,7 +23,6 @@ import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest;
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Table; import org.elasticsearch.common.Table;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestRequest;
@ -35,8 +34,6 @@ import java.util.Locale;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.GET;
public class RestHealthAction extends AbstractCatAction { public class RestHealthAction extends AbstractCatAction {
@Inject
public RestHealthAction(Settings settings, RestController controller) { public RestHealthAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_cat/health", this); controller.registerHandler(GET, "/_cat/health", this);

View File

@ -37,7 +37,6 @@ import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.metadata.MetaData; import org.elasticsearch.cluster.metadata.MetaData;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.Table; import org.elasticsearch.common.Table;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.Index; import org.elasticsearch.index.Index;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -60,7 +59,6 @@ public class RestIndicesAction extends AbstractCatAction {
private final IndexNameExpressionResolver indexNameExpressionResolver; private final IndexNameExpressionResolver indexNameExpressionResolver;
@Inject
public RestIndicesAction(Settings settings, RestController controller, IndexNameExpressionResolver indexNameExpressionResolver) { public RestIndicesAction(Settings settings, RestController controller, IndexNameExpressionResolver indexNameExpressionResolver) {
super(settings); super(settings);
this.indexNameExpressionResolver = indexNameExpressionResolver; this.indexNameExpressionResolver = indexNameExpressionResolver;

View File

@ -25,7 +25,6 @@ import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.Table; import org.elasticsearch.common.Table;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestRequest;
@ -35,8 +34,6 @@ import org.elasticsearch.rest.action.RestResponseListener;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.GET;
public class RestMasterAction extends AbstractCatAction { public class RestMasterAction extends AbstractCatAction {
@Inject
public RestMasterAction(Settings settings, RestController controller) { public RestMasterAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_cat/master", this); controller.registerHandler(GET, "/_cat/master", this);

View File

@ -29,9 +29,7 @@ import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.Table; import org.elasticsearch.common.Table;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.TransportAddress;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.RestResponse; import org.elasticsearch.rest.RestResponse;
@ -43,8 +41,6 @@ import java.util.Map;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.GET;
public class RestNodeAttrsAction extends AbstractCatAction { public class RestNodeAttrsAction extends AbstractCatAction {
@Inject
public RestNodeAttrsAction(Settings settings, RestController controller) { public RestNodeAttrsAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_cat/nodeattrs", this); controller.registerHandler(GET, "/_cat/nodeattrs", this);

View File

@ -32,7 +32,6 @@ import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.Table; import org.elasticsearch.common.Table;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.network.NetworkAddress; import org.elasticsearch.common.network.NetworkAddress;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.common.transport.TransportAddress;
@ -67,8 +66,6 @@ import java.util.stream.Collectors;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.GET;
public class RestNodesAction extends AbstractCatAction { public class RestNodesAction extends AbstractCatAction {
@Inject
public RestNodesAction(Settings settings, RestController controller) { public RestNodesAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_cat/nodes", this); controller.registerHandler(GET, "/_cat/nodes", this);

View File

@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.cluster.tasks.PendingClusterTasksResponse;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.cluster.service.PendingClusterTask; import org.elasticsearch.cluster.service.PendingClusterTask;
import org.elasticsearch.common.Table; import org.elasticsearch.common.Table;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestRequest;
@ -34,7 +33,6 @@ import org.elasticsearch.rest.action.RestResponseListener;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.GET;
public class RestPendingClusterTasksAction extends AbstractCatAction { public class RestPendingClusterTasksAction extends AbstractCatAction {
@Inject
public RestPendingClusterTasksAction(Settings settings, RestController controller) { public RestPendingClusterTasksAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_cat/pending_tasks", this); controller.registerHandler(GET, "/_cat/pending_tasks", this);

View File

@ -28,7 +28,6 @@ import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.Table; import org.elasticsearch.common.Table;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.plugins.PluginInfo; import org.elasticsearch.plugins.PluginInfo;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -40,8 +39,6 @@ import org.elasticsearch.rest.action.RestResponseListener;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.GET;
public class RestPluginsAction extends AbstractCatAction { public class RestPluginsAction extends AbstractCatAction {
@Inject
public RestPluginsAction(Settings settings, RestController controller) { public RestPluginsAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_cat/plugins", this); controller.registerHandler(GET, "/_cat/plugins", this);

View File

@ -28,7 +28,6 @@ import org.elasticsearch.cluster.routing.RecoverySource;
import org.elasticsearch.cluster.routing.RecoverySource.SnapshotRecoverySource; import org.elasticsearch.cluster.routing.RecoverySource.SnapshotRecoverySource;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.Table; import org.elasticsearch.common.Table;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.indices.recovery.RecoveryState; import org.elasticsearch.indices.recovery.RecoveryState;
@ -49,9 +48,7 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
* be specified to limit output to a particular index or indices. * be specified to limit output to a particular index or indices.
*/ */
public class RestRecoveryAction extends AbstractCatAction { public class RestRecoveryAction extends AbstractCatAction {
public RestRecoveryAction(Settings settings, RestController restController) {
@Inject
public RestRecoveryAction(Settings settings, RestController restController, RestController controller) {
super(settings); super(settings);
restController.registerHandler(GET, "/_cat/recovery", this); restController.registerHandler(GET, "/_cat/recovery", this);
restController.registerHandler(GET, "/_cat/recovery/{index}", this); restController.registerHandler(GET, "/_cat/recovery/{index}", this);

View File

@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.cluster.repositories.get.GetRepositoriesRe
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.cluster.metadata.RepositoryMetaData; import org.elasticsearch.cluster.metadata.RepositoryMetaData;
import org.elasticsearch.common.Table; import org.elasticsearch.common.Table;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestRequest;
@ -37,7 +36,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
* Cat API class to display information about snapshot repositories * Cat API class to display information about snapshot repositories
*/ */
public class RestRepositoriesAction extends AbstractCatAction { public class RestRepositoriesAction extends AbstractCatAction {
@Inject
public RestRepositoriesAction(Settings settings, RestController controller) { public RestRepositoriesAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_cat/repositories", this); controller.registerHandler(GET, "/_cat/repositories", this);

View File

@ -30,7 +30,6 @@ import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.Table; import org.elasticsearch.common.Table;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.engine.Segment; import org.elasticsearch.index.engine.Segment;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -45,8 +44,6 @@ import java.util.Map;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.GET;
public class RestSegmentsAction extends AbstractCatAction { public class RestSegmentsAction extends AbstractCatAction {
@Inject
public RestSegmentsAction(Settings settings, RestController controller) { public RestSegmentsAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_cat/segments", this); controller.registerHandler(GET, "/_cat/segments", this);

View File

@ -31,7 +31,6 @@ import org.elasticsearch.cluster.routing.ShardRouting;
import org.elasticsearch.cluster.routing.UnassignedInfo; import org.elasticsearch.cluster.routing.UnassignedInfo;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.Table; import org.elasticsearch.common.Table;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.index.engine.CommitStats; import org.elasticsearch.index.engine.CommitStats;
@ -47,8 +46,6 @@ import java.util.Locale;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.GET;
public class RestShardsAction extends AbstractCatAction { public class RestShardsAction extends AbstractCatAction {
@Inject
public RestShardsAction(Settings settings, RestController controller) { public RestShardsAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_cat/shards", this); controller.registerHandler(GET, "/_cat/shards", this);

View File

@ -24,7 +24,6 @@ import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsRequest;
import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse; import org.elasticsearch.action.admin.cluster.snapshots.get.GetSnapshotsResponse;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Table; import org.elasticsearch.common.Table;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -44,7 +43,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
* Cat API class to display information about snapshots * Cat API class to display information about snapshots
*/ */
public class RestSnapshotAction extends AbstractCatAction { public class RestSnapshotAction extends AbstractCatAction {
@Inject
public RestSnapshotAction(Settings settings, RestController controller) { public RestSnapshotAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_cat/snapshots", this); controller.registerHandler(GET, "/_cat/snapshots", this);

View File

@ -24,12 +24,9 @@ import org.elasticsearch.action.admin.cluster.node.tasks.list.TaskGroup;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.Table; import org.elasticsearch.common.Table;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.TransportAddress;
import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestRequest;
@ -44,18 +41,18 @@ import java.util.Collections;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
import java.util.function.Supplier;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.GET;
import static org.elasticsearch.rest.action.admin.cluster.RestListTasksAction.generateListTasksRequest; import static org.elasticsearch.rest.action.admin.cluster.RestListTasksAction.generateListTasksRequest;
public class RestTasksAction extends AbstractCatAction { public class RestTasksAction extends AbstractCatAction {
private final ClusterService clusterService; private final Supplier<DiscoveryNodes> nodesInCluster;
@Inject public RestTasksAction(Settings settings, RestController controller, Supplier<DiscoveryNodes> nodesInCluster) {
public RestTasksAction(Settings settings, RestController controller, ClusterService clusterService) {
super(settings); super(settings);
controller.registerHandler(GET, "/_cat/tasks", this); controller.registerHandler(GET, "/_cat/tasks", this);
this.clusterService = clusterService; this.nodesInCluster = nodesInCluster;
} }
@Override @Override
@ -155,7 +152,7 @@ public class RestTasksAction extends AbstractCatAction {
} }
private void buildGroups(Table table, boolean fullId, boolean detailed, List<TaskGroup> taskGroups) { private void buildGroups(Table table, boolean fullId, boolean detailed, List<TaskGroup> taskGroups) {
DiscoveryNodes discoveryNodes = clusterService.state().nodes(); DiscoveryNodes discoveryNodes = nodesInCluster.get();
List<TaskGroup> sortedGroups = new ArrayList<>(taskGroups); List<TaskGroup> sortedGroups = new ArrayList<>(taskGroups);
sortedGroups.sort((o1, o2) -> Long.compare(o1.getTaskInfo().getStartTime(), o2.getTaskInfo().getStartTime())); sortedGroups.sort((o1, o2) -> Long.compare(o1.getTaskInfo().getStartTime(), o2.getTaskInfo().getStartTime()));
for (TaskGroup taskGroup : sortedGroups) { for (TaskGroup taskGroup : sortedGroups) {

View File

@ -20,13 +20,13 @@
package org.elasticsearch.rest.action.cat; package org.elasticsearch.rest.action.cat;
import com.carrotsearch.hppc.cursors.ObjectObjectCursor; import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
import org.elasticsearch.action.admin.cluster.state.ClusterStateRequest; import org.elasticsearch.action.admin.cluster.state.ClusterStateRequest;
import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse; import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.cluster.metadata.IndexTemplateMetaData; import org.elasticsearch.cluster.metadata.IndexTemplateMetaData;
import org.elasticsearch.cluster.metadata.MetaData; import org.elasticsearch.cluster.metadata.MetaData;
import org.elasticsearch.common.Table; import org.elasticsearch.common.Table;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.regex.Regex;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
@ -37,7 +37,6 @@ import org.elasticsearch.rest.action.RestResponseListener;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.GET;
public class RestTemplatesAction extends AbstractCatAction { public class RestTemplatesAction extends AbstractCatAction {
@Inject
public RestTemplatesAction(Settings settings, RestController controller) { public RestTemplatesAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_cat/templates", this); controller.registerHandler(GET, "/_cat/templates", this);

View File

@ -31,10 +31,8 @@ import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.cluster.node.DiscoveryNodes; import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.Table; import org.elasticsearch.common.Table;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.regex.Regex;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.TransportAddress;
import org.elasticsearch.rest.RestController; import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestRequest; import org.elasticsearch.rest.RestRequest;
import org.elasticsearch.rest.RestResponse; import org.elasticsearch.rest.RestResponse;
@ -53,8 +51,6 @@ import java.util.TreeMap;
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestRequest.Method.GET;
public class RestThreadPoolAction extends AbstractCatAction { public class RestThreadPoolAction extends AbstractCatAction {
@Inject
public RestThreadPoolAction(Settings settings, RestController controller) { public RestThreadPoolAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/_cat/thread_pool", this); controller.registerHandler(GET, "/_cat/thread_pool", this);

View File

@ -27,7 +27,6 @@ import org.elasticsearch.action.support.ActiveShardCount;
import org.elasticsearch.client.Requests; import org.elasticsearch.client.Requests;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
@ -61,7 +60,6 @@ public class RestBulkAction extends BaseRestHandler {
private final boolean allowExplicitIndex; private final boolean allowExplicitIndex;
@Inject
public RestBulkAction(Settings settings, RestController controller) { public RestBulkAction(Settings settings, RestController controller) {
super(settings); super(settings);

View File

@ -24,7 +24,6 @@ import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilder;
@ -45,7 +44,6 @@ import static org.elasticsearch.rest.action.RestActions.buildBroadcastShardsHead
import static org.elasticsearch.search.internal.SearchContext.DEFAULT_TERMINATE_AFTER; import static org.elasticsearch.search.internal.SearchContext.DEFAULT_TERMINATE_AFTER;
public class RestCountAction extends BaseRestHandler { public class RestCountAction extends BaseRestHandler {
@Inject
public RestCountAction(Settings settings, RestController controller) { public RestCountAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(POST, "/_count", this); controller.registerHandler(POST, "/_count", this);

View File

@ -22,7 +22,6 @@ package org.elasticsearch.rest.action.document;
import org.elasticsearch.action.delete.DeleteRequest; import org.elasticsearch.action.delete.DeleteRequest;
import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.action.support.ActiveShardCount;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.VersionType; import org.elasticsearch.index.VersionType;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -36,8 +35,6 @@ import java.io.IOException;
import static org.elasticsearch.rest.RestRequest.Method.DELETE; import static org.elasticsearch.rest.RestRequest.Method.DELETE;
public class RestDeleteAction extends BaseRestHandler { public class RestDeleteAction extends BaseRestHandler {
@Inject
public RestDeleteAction(Settings settings, RestController controller) { public RestDeleteAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(DELETE, "/{index}/{type}/{id}", this); controller.registerHandler(DELETE, "/{index}/{type}/{id}", this);

View File

@ -23,7 +23,6 @@ import org.elasticsearch.action.get.GetRequest;
import org.elasticsearch.action.get.GetResponse; import org.elasticsearch.action.get.GetResponse;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.VersionType; import org.elasticsearch.index.VersionType;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -41,8 +40,6 @@ import static org.elasticsearch.rest.RestStatus.NOT_FOUND;
import static org.elasticsearch.rest.RestStatus.OK; import static org.elasticsearch.rest.RestStatus.OK;
public class RestGetAction extends BaseRestHandler { public class RestGetAction extends BaseRestHandler {
@Inject
public RestGetAction(Settings settings, RestController controller) { public RestGetAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/{index}/{type}/{id}", this); controller.registerHandler(GET, "/{index}/{type}/{id}", this);

View File

@ -23,7 +23,6 @@ import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.get.GetRequest; import org.elasticsearch.action.get.GetRequest;
import org.elasticsearch.action.get.GetResponse; import org.elasticsearch.action.get.GetResponse;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -41,8 +40,6 @@ import static org.elasticsearch.rest.RestStatus.NOT_FOUND;
import static org.elasticsearch.rest.RestStatus.OK; import static org.elasticsearch.rest.RestStatus.OK;
public class RestGetSourceAction extends BaseRestHandler { public class RestGetSourceAction extends BaseRestHandler {
@Inject
public RestGetSourceAction(Settings settings, RestController controller) { public RestGetSourceAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(GET, "/{index}/{type}/{id}/_source", this); controller.registerHandler(GET, "/{index}/{type}/{id}/_source", this);

View File

@ -24,7 +24,6 @@ import org.elasticsearch.action.get.GetResponse;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.BytesRestResponse;
@ -48,8 +47,6 @@ public abstract class RestHeadAction extends BaseRestHandler {
* Handler to check for document existence. * Handler to check for document existence.
*/ */
public static class Document extends RestHeadAction { public static class Document extends RestHeadAction {
@Inject
public Document(Settings settings, RestController controller) { public Document(Settings settings, RestController controller) {
super(settings, false); super(settings, false);
controller.registerHandler(HEAD, "/{index}/{type}/{id}", this); controller.registerHandler(HEAD, "/{index}/{type}/{id}", this);
@ -60,8 +57,6 @@ public abstract class RestHeadAction extends BaseRestHandler {
* Handler to check for document source existence (may be disabled in the mapping). * Handler to check for document source existence (may be disabled in the mapping).
*/ */
public static class Source extends RestHeadAction { public static class Source extends RestHeadAction {
@Inject
public Source(Settings settings, RestController controller) { public Source(Settings settings, RestController controller) {
super(settings, true); super(settings, true);
controller.registerHandler(HEAD, "/{index}/{type}/{id}/_source", this); controller.registerHandler(HEAD, "/{index}/{type}/{id}/_source", this);

View File

@ -22,7 +22,6 @@ package org.elasticsearch.rest.action.document;
import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.action.support.ActiveShardCount;
import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.client.node.NodeClient;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.VersionType; import org.elasticsearch.index.VersionType;
import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BaseRestHandler;
@ -38,8 +37,6 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
import static org.elasticsearch.rest.RestRequest.Method.PUT; import static org.elasticsearch.rest.RestRequest.Method.PUT;
public class RestIndexAction extends BaseRestHandler { public class RestIndexAction extends BaseRestHandler {
@Inject
public RestIndexAction(Settings settings, RestController controller) { public RestIndexAction(Settings settings, RestController controller) {
super(settings); super(settings);
controller.registerHandler(POST, "/{index}/{type}", this); // auto id creation controller.registerHandler(POST, "/{index}/{type}", this); // auto id creation

Some files were not shown because too many files have changed in this diff Show More