mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-22 04:45:37 +00:00
Core: Remove index name resolver from base TransportAction (#31002)
Most transport actions don't need to resolve index names. This commit removes the index name resolver as a super constructor parameter for TransportAction. The actions that do need the resolver then have a member added to keep the resolver from their own constructor.
This commit is contained in:
parent
5971eb83c4
commit
401800d958
@ -27,7 +27,6 @@ import org.elasticsearch.action.bulk.BulkResponse;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.action.update.UpdateResponse;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
@ -40,8 +39,8 @@ public class TransportNoopBulkAction extends HandledTransportAction<BulkRequest,
|
||||
|
||||
@Inject
|
||||
public TransportNoopBulkAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, NoopBulkAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver, BulkRequest::new);
|
||||
ActionFilters actionFilters) {
|
||||
super(settings, NoopBulkAction.NAME, threadPool, transportService, actionFilters, BulkRequest::new);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -24,8 +24,8 @@ import org.elasticsearch.action.search.SearchResponse;
|
||||
import org.elasticsearch.action.search.ShardSearchFailure;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.search.aggregations.InternalAggregations;
|
||||
import org.elasticsearch.search.SearchHit;
|
||||
@ -40,10 +40,10 @@ import java.util.Collections;
|
||||
|
||||
public class TransportNoopSearchAction extends HandledTransportAction<SearchRequest, SearchResponse> {
|
||||
@Inject
|
||||
public TransportNoopSearchAction(Settings settings, ThreadPool threadPool, TransportService transportService, ActionFilters
|
||||
actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, NoopSearchAction.NAME, threadPool, transportService, actionFilters, SearchRequest::new,
|
||||
indexNameExpressionResolver);
|
||||
public TransportNoopSearchAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters) {
|
||||
super(settings, NoopSearchAction.NAME, threadPool, transportService, actionFilters,
|
||||
(Writeable.Reader<SearchRequest>) SearchRequest::new);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -28,7 +28,6 @@ import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.io.stream.StreamOutput;
|
||||
@ -116,9 +115,8 @@ public class GrokProcessorGetAction extends Action<GrokProcessorGetAction.Respon
|
||||
|
||||
@Inject
|
||||
public TransportAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, NAME, threadPool, transportService, actionFilters,
|
||||
indexNameExpressionResolver, Request::new);
|
||||
ActionFilters actionFilters) {
|
||||
super(settings, NAME, threadPool, transportService, actionFilters, Request::new);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -26,7 +26,6 @@ import org.elasticsearch.action.search.SearchRequest;
|
||||
import org.elasticsearch.action.search.TransportMultiSearchAction;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||
@ -47,11 +46,9 @@ public class TransportMultiSearchTemplateAction extends HandledTransportAction<M
|
||||
|
||||
@Inject
|
||||
public TransportMultiSearchTemplateAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver resolver,
|
||||
ScriptService scriptService, NamedXContentRegistry xContentRegistry,
|
||||
TransportMultiSearchAction multiSearchAction) {
|
||||
super(settings, MultiSearchTemplateAction.NAME, threadPool, transportService, actionFilters, resolver,
|
||||
MultiSearchTemplateRequest::new);
|
||||
ActionFilters actionFilters, ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry, TransportMultiSearchAction multiSearchAction) {
|
||||
super(settings, MultiSearchTemplateAction.NAME, threadPool, transportService, actionFilters, MultiSearchTemplateRequest::new);
|
||||
this.scriptService = scriptService;
|
||||
this.xContentRegistry = xContentRegistry;
|
||||
this.multiSearchAction = multiSearchAction;
|
||||
|
@ -25,7 +25,6 @@ import org.elasticsearch.action.search.SearchResponse;
|
||||
import org.elasticsearch.action.search.TransportSearchAction;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.bytes.BytesArray;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -44,6 +43,7 @@ import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class TransportSearchTemplateAction extends HandledTransportAction<SearchTemplateRequest, SearchTemplateResponse> {
|
||||
|
||||
@ -55,11 +55,12 @@ public class TransportSearchTemplateAction extends HandledTransportAction<Search
|
||||
|
||||
@Inject
|
||||
public TransportSearchTemplateAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver resolver,
|
||||
ActionFilters actionFilters,
|
||||
ScriptService scriptService,
|
||||
TransportSearchAction searchAction,
|
||||
NamedXContentRegistry xContentRegistry) {
|
||||
super(settings, SearchTemplateAction.NAME, threadPool, transportService, actionFilters, resolver, SearchTemplateRequest::new);
|
||||
super(settings, SearchTemplateAction.NAME, threadPool, transportService, actionFilters,
|
||||
(Supplier<SearchTemplateRequest>) SearchTemplateRequest::new);
|
||||
this.scriptService = scriptService;
|
||||
this.searchAction = searchAction;
|
||||
this.xContentRegistry = xContentRegistry;
|
||||
|
@ -28,7 +28,6 @@ import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.client.node.NodeClient;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.ParseField;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
@ -282,9 +281,8 @@ public class PainlessExecuteAction extends Action<PainlessExecuteAction.Response
|
||||
|
||||
@Inject
|
||||
public TransportAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
ScriptService scriptService) {
|
||||
super(settings, NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver, Request::new);
|
||||
ActionFilters actionFilters, ScriptService scriptService) {
|
||||
super(settings, NAME, threadPool, transportService, actionFilters, Request::new);
|
||||
this.scriptService = scriptService;
|
||||
}
|
||||
@Override
|
||||
|
@ -27,9 +27,9 @@ import org.elasticsearch.action.search.SearchRequest;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.bytes.BytesArray;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
|
||||
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||
@ -73,11 +73,11 @@ public class TransportRankEvalAction extends HandledTransportAction<RankEvalRequ
|
||||
private final NamedXContentRegistry namedXContentRegistry;
|
||||
|
||||
@Inject
|
||||
public TransportRankEvalAction(Settings settings, ThreadPool threadPool, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver, Client client, TransportService transportService,
|
||||
ScriptService scriptService, NamedXContentRegistry namedXContentRegistry) {
|
||||
super(settings, RankEvalAction.NAME, threadPool, transportService, actionFilters, RankEvalRequest::new,
|
||||
indexNameExpressionResolver);
|
||||
public TransportRankEvalAction(Settings settings, ThreadPool threadPool, ActionFilters actionFilters, Client client,
|
||||
TransportService transportService, ScriptService scriptService,
|
||||
NamedXContentRegistry namedXContentRegistry) {
|
||||
super(settings, RankEvalAction.NAME, threadPool, transportService, actionFilters,
|
||||
(Writeable.Reader<RankEvalRequest>) RankEvalRequest::new);
|
||||
this.scriptService = scriptService;
|
||||
this.namedXContentRegistry = namedXContentRegistry;
|
||||
this.client = client;
|
||||
|
@ -19,13 +19,14 @@
|
||||
|
||||
package org.elasticsearch.index.reindex;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.client.ParentTaskAssigningClient;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -40,10 +41,10 @@ public class TransportDeleteByQueryAction extends HandledTransportAction<DeleteB
|
||||
private final ClusterService clusterService;
|
||||
|
||||
@Inject
|
||||
public TransportDeleteByQueryAction(Settings settings, ThreadPool threadPool, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver resolver, Client client, TransportService transportService,
|
||||
ScriptService scriptService, ClusterService clusterService) {
|
||||
super(settings, DeleteByQueryAction.NAME, threadPool, transportService, actionFilters, resolver, DeleteByQueryRequest::new);
|
||||
public TransportDeleteByQueryAction(Settings settings, ThreadPool threadPool, ActionFilters actionFilters, Client client,
|
||||
TransportService transportService, ScriptService scriptService, ClusterService clusterService) {
|
||||
super(settings, DeleteByQueryAction.NAME, threadPool, transportService, actionFilters,
|
||||
(Supplier<DeleteByQueryRequest>) DeleteByQueryRequest::new);
|
||||
this.client = client;
|
||||
this.scriptService = scriptService;
|
||||
this.clusterService = clusterService;
|
||||
|
@ -97,18 +97,20 @@ public class TransportReindexAction extends HandledTransportAction<ReindexReques
|
||||
private final AutoCreateIndex autoCreateIndex;
|
||||
private final Client client;
|
||||
private final CharacterRunAutomaton remoteWhitelist;
|
||||
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||
|
||||
@Inject
|
||||
public TransportReindexAction(Settings settings, ThreadPool threadPool, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver, ClusterService clusterService, ScriptService scriptService,
|
||||
AutoCreateIndex autoCreateIndex, Client client, TransportService transportService) {
|
||||
super(settings, ReindexAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver,
|
||||
ReindexRequest::new);
|
||||
super(settings, ReindexAction.NAME, threadPool, transportService, actionFilters,
|
||||
ReindexRequest::new);
|
||||
this.clusterService = clusterService;
|
||||
this.scriptService = scriptService;
|
||||
this.autoCreateIndex = autoCreateIndex;
|
||||
this.client = client;
|
||||
remoteWhitelist = buildRemoteWhitelist(REMOTE_CLUSTER_WHITELIST.get(settings));
|
||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -27,7 +27,6 @@ import org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.tasks.TransportTasksAction;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
@ -45,10 +44,9 @@ public class TransportRethrottleAction extends TransportTasksAction<BulkByScroll
|
||||
|
||||
@Inject
|
||||
public TransportRethrottleAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Client client) {
|
||||
super(settings, RethrottleAction.NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
RethrottleRequest::new, ListTasksResponse::new, ThreadPool.Names.MANAGEMENT);
|
||||
TransportService transportService, ActionFilters actionFilters, Client client) {
|
||||
super(settings, RethrottleAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
RethrottleRequest::new, ListTasksResponse::new, ThreadPool.Names.MANAGEMENT);
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,6 @@ import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.client.ParentTaskAssigningClient;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -44,6 +43,7 @@ import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class TransportUpdateByQueryAction extends HandledTransportAction<UpdateByQueryRequest, BulkByScrollResponse> {
|
||||
private final Client client;
|
||||
@ -51,11 +51,10 @@ public class TransportUpdateByQueryAction extends HandledTransportAction<UpdateB
|
||||
private final ClusterService clusterService;
|
||||
|
||||
@Inject
|
||||
public TransportUpdateByQueryAction(Settings settings, ThreadPool threadPool, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver, Client client, TransportService transportService,
|
||||
ScriptService scriptService, ClusterService clusterService) {
|
||||
public TransportUpdateByQueryAction(Settings settings, ThreadPool threadPool, ActionFilters actionFilters, Client client,
|
||||
TransportService transportService, ScriptService scriptService, ClusterService clusterService) {
|
||||
super(settings, UpdateByQueryAction.NAME, threadPool, transportService, actionFilters,
|
||||
indexNameExpressionResolver, UpdateByQueryRequest::new);
|
||||
(Supplier<UpdateByQueryRequest>) UpdateByQueryRequest::new);
|
||||
this.client = client;
|
||||
this.scriptService = scriptService;
|
||||
this.clusterService = clusterService;
|
||||
|
@ -24,7 +24,6 @@ import org.elasticsearch.action.FailedNodeException;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.nodes.BaseNodeRequest;
|
||||
import org.elasticsearch.action.support.nodes.TransportNodesAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
@ -43,11 +42,10 @@ public class TransportNodesHotThreadsAction extends TransportNodesAction<NodesHo
|
||||
NodeHotThreads> {
|
||||
|
||||
@Inject
|
||||
public TransportNodesHotThreadsAction(Settings settings, ThreadPool threadPool,
|
||||
ClusterService clusterService, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
public TransportNodesHotThreadsAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters) {
|
||||
super(settings, NodesHotThreadsAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
indexNameExpressionResolver, NodesHotThreadsRequest::new, NodeRequest::new, ThreadPool.Names.GENERIC, NodeHotThreads.class);
|
||||
NodesHotThreadsRequest::new, NodeRequest::new, ThreadPool.Names.GENERIC, NodeHotThreads.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -23,7 +23,6 @@ import org.elasticsearch.action.FailedNodeException;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.nodes.BaseNodeRequest;
|
||||
import org.elasticsearch.action.support.nodes.TransportNodesAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
@ -44,12 +43,10 @@ public class TransportNodesInfoAction extends TransportNodesAction<NodesInfoRequ
|
||||
private final NodeService nodeService;
|
||||
|
||||
@Inject
|
||||
public TransportNodesInfoAction(Settings settings, ThreadPool threadPool,
|
||||
ClusterService clusterService, TransportService transportService,
|
||||
NodeService nodeService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
public TransportNodesInfoAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportService transportService, NodeService nodeService, ActionFilters actionFilters) {
|
||||
super(settings, NodesInfoAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
indexNameExpressionResolver, NodesInfoRequest::new, NodeInfoRequest::new, ThreadPool.Names.MANAGEMENT, NodeInfo.class);
|
||||
NodesInfoRequest::new, NodeInfoRequest::new, ThreadPool.Names.MANAGEMENT, NodeInfo.class);
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,6 @@ import org.elasticsearch.action.FailedNodeException;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.nodes.BaseNodeRequest;
|
||||
import org.elasticsearch.action.support.nodes.TransportNodesAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
@ -55,11 +54,11 @@ public class TransportNodesReloadSecureSettingsAction extends TransportNodesActi
|
||||
@Inject
|
||||
public TransportNodesReloadSecureSettingsAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver, Environment environment,
|
||||
Environment environment,
|
||||
PluginsService pluginService) {
|
||||
super(settings, NodesReloadSecureSettingsAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
indexNameExpressionResolver, NodesReloadSecureSettingsRequest::new, NodeRequest::new, ThreadPool.Names.GENERIC,
|
||||
NodesReloadSecureSettingsResponse.NodeResponse.class);
|
||||
NodesReloadSecureSettingsRequest::new, NodeRequest::new, ThreadPool.Names.GENERIC,
|
||||
NodesReloadSecureSettingsResponse.NodeResponse.class);
|
||||
this.environment = environment;
|
||||
this.pluginsService = pluginService;
|
||||
}
|
||||
|
@ -23,7 +23,6 @@ import org.elasticsearch.action.FailedNodeException;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.nodes.BaseNodeRequest;
|
||||
import org.elasticsearch.action.support.nodes.TransportNodesAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
@ -46,10 +45,9 @@ public class TransportNodesStatsAction extends TransportNodesAction<NodesStatsRe
|
||||
@Inject
|
||||
public TransportNodesStatsAction(Settings settings, ThreadPool threadPool,
|
||||
ClusterService clusterService, TransportService transportService,
|
||||
NodeService nodeService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
NodeService nodeService, ActionFilters actionFilters) {
|
||||
super(settings, NodesStatsAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
indexNameExpressionResolver, NodesStatsRequest::new, NodeStatsRequest::new, ThreadPool.Names.MANAGEMENT, NodeStats.class);
|
||||
NodesStatsRequest::new, NodeStatsRequest::new, ThreadPool.Names.MANAGEMENT, NodeStats.class);
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,6 @@ import org.elasticsearch.action.FailedNodeException;
|
||||
import org.elasticsearch.action.TaskOperationFailure;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.tasks.TransportTasksAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
@ -64,11 +63,9 @@ public class TransportCancelTasksAction extends TransportTasksAction<Cancellable
|
||||
|
||||
@Inject
|
||||
public TransportCancelTasksAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver
|
||||
indexNameExpressionResolver) {
|
||||
TransportService transportService, ActionFilters actionFilters) {
|
||||
super(settings, CancelTasksAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
indexNameExpressionResolver, CancelTasksRequest::new, CancelTasksResponse::new,
|
||||
ThreadPool.Names.MANAGEMENT);
|
||||
CancelTasksRequest::new, CancelTasksResponse::new, ThreadPool.Names.MANAGEMENT);
|
||||
transportService.registerRequestHandler(BAN_PARENT_ACTION_NAME, BanParentTaskRequest::new, ThreadPool.Names.SAME, new
|
||||
BanParentRequestHandler());
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ import org.elasticsearch.action.get.GetResponse;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
@ -72,9 +71,8 @@ public class TransportGetTaskAction extends HandledTransportAction<GetTaskReques
|
||||
|
||||
@Inject
|
||||
public TransportGetTaskAction(Settings settings, ThreadPool threadPool, TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver, ClusterService clusterService, Client client,
|
||||
NamedXContentRegistry xContentRegistry) {
|
||||
super(settings, GetTaskAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver, GetTaskRequest::new);
|
||||
ClusterService clusterService, Client client, NamedXContentRegistry xContentRegistry) {
|
||||
super(settings, GetTaskAction.NAME, threadPool, transportService, actionFilters, GetTaskRequest::new);
|
||||
this.clusterService = clusterService;
|
||||
this.transportService = transportService;
|
||||
this.client = client;
|
||||
|
@ -24,7 +24,6 @@ import org.elasticsearch.action.FailedNodeException;
|
||||
import org.elasticsearch.action.TaskOperationFailure;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.tasks.TransportTasksAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
@ -53,9 +52,9 @@ public class TransportListTasksAction extends TransportTasksAction<Task, ListTas
|
||||
|
||||
@Inject
|
||||
public TransportListTasksAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, ListTasksAction.NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
ListTasksRequest::new, ListTasksResponse::new, ThreadPool.Names.MANAGEMENT);
|
||||
TransportService transportService, ActionFilters actionFilters) {
|
||||
super(settings, ListTasksAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
ListTasksRequest::new, ListTasksResponse::new, ThreadPool.Names.MANAGEMENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -23,7 +23,6 @@ import org.elasticsearch.action.FailedNodeException;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.nodes.BaseNodeRequest;
|
||||
import org.elasticsearch.action.support.nodes.TransportNodesAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
@ -43,10 +42,9 @@ public class TransportNodesUsageAction
|
||||
|
||||
@Inject
|
||||
public TransportNodesUsageAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver, UsageService usageService) {
|
||||
super(settings, NodesUsageAction.NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
NodesUsageRequest::new, NodeUsageRequest::new, ThreadPool.Names.MANAGEMENT, NodeUsage.class);
|
||||
TransportService transportService, ActionFilters actionFilters, UsageService usageService) {
|
||||
super(settings, NodesUsageAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
NodesUsageRequest::new, NodeUsageRequest::new, ThreadPool.Names.MANAGEMENT, NodeUsage.class);
|
||||
this.usageService = usageService;
|
||||
}
|
||||
|
||||
|
@ -19,12 +19,13 @@
|
||||
|
||||
package org.elasticsearch.action.admin.cluster.remote;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.transport.RemoteClusterService;
|
||||
import org.elasticsearch.action.search.SearchTransportService;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
@ -38,10 +39,9 @@ public final class TransportRemoteInfoAction extends HandledTransportAction<Remo
|
||||
|
||||
@Inject
|
||||
public TransportRemoteInfoAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
SearchTransportService searchTransportService) {
|
||||
super(settings, RemoteInfoAction.NAME, threadPool, transportService, actionFilters, RemoteInfoRequest::new,
|
||||
indexNameExpressionResolver);
|
||||
ActionFilters actionFilters, SearchTransportService searchTransportService) {
|
||||
super(settings, RemoteInfoAction.NAME, threadPool, transportService, actionFilters,
|
||||
(Supplier<RemoteInfoRequest>) RemoteInfoRequest::new);
|
||||
this.remoteClusterService = searchTransportService.getRemoteClusterService();
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,6 @@ import org.elasticsearch.action.support.nodes.BaseNodesRequest;
|
||||
import org.elasticsearch.action.support.nodes.BaseNodesResponse;
|
||||
import org.elasticsearch.action.support.nodes.TransportNodesAction;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.snapshots.Snapshot;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
@ -63,12 +62,11 @@ public class TransportNodesSnapshotsStatus extends TransportNodesAction<Transpor
|
||||
private final SnapshotShardsService snapshotShardsService;
|
||||
|
||||
@Inject
|
||||
public TransportNodesSnapshotsStatus(Settings settings, ThreadPool threadPool,
|
||||
ClusterService clusterService, TransportService transportService,
|
||||
SnapshotShardsService snapshotShardsService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, ACTION_NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
Request::new, NodeRequest::new, ThreadPool.Names.GENERIC, NodeSnapshotStatus.class);
|
||||
public TransportNodesSnapshotsStatus(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportService transportService, SnapshotShardsService snapshotShardsService,
|
||||
ActionFilters actionFilters) {
|
||||
super(settings, ACTION_NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
Request::new, NodeRequest::new, ThreadPool.Names.GENERIC, NodeSnapshotStatus.class);
|
||||
this.snapshotShardsService = snapshotShardsService;
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,6 @@ import org.elasticsearch.action.support.nodes.BaseNodeRequest;
|
||||
import org.elasticsearch.action.support.nodes.TransportNodesAction;
|
||||
import org.elasticsearch.cluster.health.ClusterHealthStatus;
|
||||
import org.elasticsearch.cluster.health.ClusterStateHealth;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
@ -58,13 +57,11 @@ public class TransportClusterStatsAction extends TransportNodesAction<ClusterSta
|
||||
|
||||
|
||||
@Inject
|
||||
public TransportClusterStatsAction(Settings settings, ThreadPool threadPool,
|
||||
ClusterService clusterService, TransportService transportService,
|
||||
NodeService nodeService, IndicesService indicesService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
public TransportClusterStatsAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportService transportService, NodeService nodeService, IndicesService indicesService,
|
||||
ActionFilters actionFilters) {
|
||||
super(settings, ClusterStatsAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
indexNameExpressionResolver, ClusterStatsRequest::new, ClusterStatsNodeRequest::new, ThreadPool.Names.MANAGEMENT,
|
||||
ClusterStatsNodeResponse.class);
|
||||
ClusterStatsRequest::new, ClusterStatsNodeRequest::new, ThreadPool.Names.MANAGEMENT, ClusterStatsNodeResponse.class);
|
||||
this.nodeService = nodeService;
|
||||
this.indicesService = indicesService;
|
||||
}
|
||||
|
@ -19,10 +19,11 @@
|
||||
|
||||
package org.elasticsearch.action.admin.indices.flush;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.indices.flush.SyncedFlushService;
|
||||
@ -37,11 +38,10 @@ public class TransportSyncedFlushAction extends HandledTransportAction<SyncedFlu
|
||||
SyncedFlushService syncedFlushService;
|
||||
|
||||
@Inject
|
||||
public TransportSyncedFlushAction(Settings settings, ThreadPool threadPool,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
SyncedFlushService syncedFlushService) {
|
||||
super(settings, SyncedFlushAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver, SyncedFlushRequest::new);
|
||||
public TransportSyncedFlushAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, SyncedFlushService syncedFlushService) {
|
||||
super(settings, SyncedFlushAction.NAME, threadPool, transportService, actionFilters,
|
||||
(Supplier<SyncedFlushRequest>) SyncedFlushRequest::new);
|
||||
this.syncedFlushService = syncedFlushService;
|
||||
}
|
||||
|
||||
|
@ -41,14 +41,16 @@ public class TransportGetFieldMappingsAction extends HandledTransportAction<GetF
|
||||
|
||||
private final ClusterService clusterService;
|
||||
private final TransportGetFieldMappingsIndexAction shardAction;
|
||||
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||
|
||||
@Inject
|
||||
public TransportGetFieldMappingsAction(Settings settings, TransportService transportService, ClusterService clusterService,
|
||||
ThreadPool threadPool, TransportGetFieldMappingsIndexAction shardAction,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, GetFieldMappingsAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver, GetFieldMappingsRequest::new);
|
||||
super(settings, GetFieldMappingsAction.NAME, threadPool, transportService, actionFilters, GetFieldMappingsRequest::new);
|
||||
this.clusterService = clusterService;
|
||||
this.shardAction = shardAction;
|
||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -91,6 +91,7 @@ public class TransportBulkAction extends HandledTransportAction<BulkRequest, Bul
|
||||
private final TransportCreateIndexAction createIndexAction;
|
||||
private final LongSupplier relativeTimeProvider;
|
||||
private final IngestActionForwarder ingestForwarder;
|
||||
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||
|
||||
@Inject
|
||||
public TransportBulkAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
@ -110,7 +111,7 @@ public class TransportBulkAction extends HandledTransportAction<BulkRequest, Bul
|
||||
TransportShardBulkAction shardBulkAction, TransportCreateIndexAction createIndexAction,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
AutoCreateIndex autoCreateIndex, LongSupplier relativeTimeProvider) {
|
||||
super(settings, BulkAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver, BulkRequest::new);
|
||||
super(settings, BulkAction.NAME, threadPool, transportService, actionFilters, BulkRequest::new);
|
||||
Objects.requireNonNull(relativeTimeProvider);
|
||||
this.clusterService = clusterService;
|
||||
this.ingestService = ingestService;
|
||||
@ -119,6 +120,7 @@ public class TransportBulkAction extends HandledTransportAction<BulkRequest, Bul
|
||||
this.autoCreateIndex = autoCreateIndex;
|
||||
this.relativeTimeProvider = relativeTimeProvider;
|
||||
this.ingestForwarder = new IngestActionForwarder(transportService);
|
||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||
clusterService.addStateApplier(this.ingestForwarder);
|
||||
}
|
||||
|
||||
|
@ -46,19 +46,18 @@ public class TransportFieldCapabilitiesAction extends HandledTransportAction<Fie
|
||||
private final ClusterService clusterService;
|
||||
private final TransportFieldCapabilitiesIndexAction shardAction;
|
||||
private final RemoteClusterService remoteClusterService;
|
||||
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||
|
||||
@Inject
|
||||
public TransportFieldCapabilitiesAction(Settings settings, TransportService transportService,
|
||||
ClusterService clusterService, ThreadPool threadPool,
|
||||
TransportFieldCapabilitiesIndexAction shardAction,
|
||||
ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver
|
||||
indexNameExpressionResolver) {
|
||||
super(settings, FieldCapabilitiesAction.NAME, threadPool, transportService,
|
||||
actionFilters, indexNameExpressionResolver, FieldCapabilitiesRequest::new);
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, FieldCapabilitiesAction.NAME, threadPool, transportService, actionFilters, FieldCapabilitiesRequest::new);
|
||||
this.clusterService = clusterService;
|
||||
this.remoteClusterService = transportService.getRemoteClusterService();
|
||||
this.shardAction = shardAction;
|
||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -40,16 +40,17 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
public class TransportMultiGetAction extends HandledTransportAction<MultiGetRequest, MultiGetResponse> {
|
||||
|
||||
private final ClusterService clusterService;
|
||||
|
||||
private final TransportShardMultiGetAction shardAction;
|
||||
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||
|
||||
@Inject
|
||||
public TransportMultiGetAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ClusterService clusterService, TransportShardMultiGetAction shardAction,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver resolver) {
|
||||
super(settings, MultiGetAction.NAME, threadPool, transportService, actionFilters, resolver, MultiGetRequest::new);
|
||||
super(settings, MultiGetAction.NAME, threadPool, transportService, actionFilters, MultiGetRequest::new);
|
||||
this.clusterService = clusterService;
|
||||
this.shardAction = shardAction;
|
||||
this.indexNameExpressionResolver = resolver;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -22,8 +22,8 @@ package org.elasticsearch.action.ingest;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.XContentHelper;
|
||||
import org.elasticsearch.ingest.PipelineStore;
|
||||
@ -39,8 +39,10 @@ public class SimulatePipelineTransportAction extends HandledTransportAction<Simu
|
||||
private final SimulateExecutionService executionService;
|
||||
|
||||
@Inject
|
||||
public SimulatePipelineTransportAction(Settings settings, ThreadPool threadPool, TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, NodeService nodeService) {
|
||||
super(settings, SimulatePipelineAction.NAME, threadPool, transportService, actionFilters, SimulatePipelineRequest::new, indexNameExpressionResolver);
|
||||
public SimulatePipelineTransportAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, NodeService nodeService) {
|
||||
super(settings, SimulatePipelineAction.NAME, threadPool, transportService, actionFilters,
|
||||
(Writeable.Reader<SimulatePipelineRequest>) SimulatePipelineRequest::new);
|
||||
this.pipelineStore = nodeService.getIngestService().getPipelineStore();
|
||||
this.executionService = new SimulateExecutionService(threadPool);
|
||||
}
|
||||
|
@ -25,7 +25,6 @@ import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -40,9 +39,8 @@ public class TransportMainAction extends HandledTransportAction<MainRequest, Mai
|
||||
|
||||
@Inject
|
||||
public TransportMainAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
ClusterService clusterService) {
|
||||
super(settings, MainAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver, MainRequest::new);
|
||||
ActionFilters actionFilters, ClusterService clusterService) {
|
||||
super(settings, MainAction.NAME, threadPool, transportService, actionFilters, MainRequest::new);
|
||||
this.clusterService = clusterService;
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,6 @@ package org.elasticsearch.action.search;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -37,9 +36,8 @@ public class TransportClearScrollAction extends HandledTransportAction<ClearScro
|
||||
@Inject
|
||||
public TransportClearScrollAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
ClusterService clusterService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
SearchTransportService searchTransportService) {
|
||||
super(settings, ClearScrollAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver,
|
||||
super(settings, ClearScrollAction.NAME, threadPool, transportService, actionFilters,
|
||||
ClearScrollRequest::new);
|
||||
this.clusterService = clusterService;
|
||||
this.searchTransportService = searchTransportService;
|
||||
|
@ -25,7 +25,6 @@ import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.action.support.TransportAction;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -49,9 +48,8 @@ public class TransportMultiSearchAction extends HandledTransportAction<MultiSear
|
||||
|
||||
@Inject
|
||||
public TransportMultiSearchAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ClusterService clusterService, TransportSearchAction searchAction,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver resolver) {
|
||||
super(settings, MultiSearchAction.NAME, threadPool, transportService, actionFilters, resolver, MultiSearchRequest::new);
|
||||
ClusterService clusterService, TransportSearchAction searchAction, ActionFilters actionFilters) {
|
||||
super(settings, MultiSearchAction.NAME, threadPool, transportService, actionFilters, MultiSearchRequest::new);
|
||||
this.clusterService = clusterService;
|
||||
this.searchAction = searchAction;
|
||||
this.availableProcessors = EsExecutors.numberOfProcessors(settings);
|
||||
@ -60,8 +58,8 @@ public class TransportMultiSearchAction extends HandledTransportAction<MultiSear
|
||||
|
||||
TransportMultiSearchAction(ThreadPool threadPool, ActionFilters actionFilters, TransportService transportService,
|
||||
ClusterService clusterService, TransportAction<SearchRequest, SearchResponse> searchAction,
|
||||
IndexNameExpressionResolver resolver, int availableProcessors, LongSupplier relativeTimeProvider) {
|
||||
super(Settings.EMPTY, MultiSearchAction.NAME, threadPool, transportService, actionFilters, resolver, MultiSearchRequest::new);
|
||||
int availableProcessors, LongSupplier relativeTimeProvider) {
|
||||
super(Settings.EMPTY, MultiSearchAction.NAME, threadPool, transportService, actionFilters, MultiSearchRequest::new);
|
||||
this.clusterService = clusterService;
|
||||
this.searchAction = searchAction;
|
||||
this.availableProcessors = availableProcessors;
|
||||
|
@ -34,6 +34,7 @@ import org.elasticsearch.cluster.routing.GroupShardsIterator;
|
||||
import org.elasticsearch.cluster.routing.ShardIterator;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.settings.Setting;
|
||||
import org.elasticsearch.common.settings.Setting.Property;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -74,19 +75,22 @@ public class TransportSearchAction extends HandledTransportAction<SearchRequest,
|
||||
private final RemoteClusterService remoteClusterService;
|
||||
private final SearchPhaseController searchPhaseController;
|
||||
private final SearchService searchService;
|
||||
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||
|
||||
@Inject
|
||||
public TransportSearchAction(Settings settings, ThreadPool threadPool, TransportService transportService, SearchService searchService,
|
||||
SearchTransportService searchTransportService, SearchPhaseController searchPhaseController,
|
||||
ClusterService clusterService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, SearchAction.NAME, threadPool, transportService, actionFilters, SearchRequest::new, indexNameExpressionResolver);
|
||||
super(settings, SearchAction.NAME, threadPool, transportService, actionFilters,
|
||||
(Writeable.Reader<SearchRequest>) SearchRequest::new);
|
||||
this.searchPhaseController = searchPhaseController;
|
||||
this.searchTransportService = searchTransportService;
|
||||
this.remoteClusterService = searchTransportService.getRemoteClusterService();
|
||||
SearchTransportService.registerRequestHandler(transportService, searchService);
|
||||
this.clusterService = clusterService;
|
||||
this.searchService = searchService;
|
||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||
}
|
||||
|
||||
private Map<String, AliasFilter> buildPerIndexAliasFilter(SearchRequest request, ClusterState clusterState,
|
||||
|
@ -22,9 +22,9 @@ package org.elasticsearch.action.search;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.tasks.Task;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
@ -43,10 +43,9 @@ public class TransportSearchScrollAction extends HandledTransportAction<SearchSc
|
||||
@Inject
|
||||
public TransportSearchScrollAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ClusterService clusterService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
SearchTransportService searchTransportService, SearchPhaseController searchPhaseController) {
|
||||
super(settings, SearchScrollAction.NAME, threadPool, transportService, actionFilters, SearchScrollRequest::new,
|
||||
indexNameExpressionResolver);
|
||||
super(settings, SearchScrollAction.NAME, threadPool, transportService, actionFilters,
|
||||
(Writeable.Reader<SearchScrollRequest>) SearchScrollRequest::new);
|
||||
this.clusterService = clusterService;
|
||||
this.searchTransportService = searchTransportService;
|
||||
this.searchPhaseController = searchPhaseController;
|
||||
|
@ -22,7 +22,6 @@ import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.tasks.Task;
|
||||
@ -39,29 +38,28 @@ import java.util.function.Supplier;
|
||||
public abstract class HandledTransportAction<Request extends ActionRequest, Response extends ActionResponse>
|
||||
extends TransportAction<Request, Response> {
|
||||
protected HandledTransportAction(Settings settings, String actionName, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
ActionFilters actionFilters,
|
||||
Supplier<Request> request) {
|
||||
this(settings, actionName, true, threadPool, transportService, actionFilters, indexNameExpressionResolver, request);
|
||||
this(settings, actionName, true, threadPool, transportService, actionFilters, request);
|
||||
}
|
||||
|
||||
protected HandledTransportAction(Settings settings, String actionName, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, Writeable.Reader<Request> requestReader,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
this(settings, actionName, true, threadPool, transportService, actionFilters, requestReader, indexNameExpressionResolver);
|
||||
ActionFilters actionFilters, Writeable.Reader<Request> requestReader) {
|
||||
this(settings, actionName, true, threadPool, transportService, actionFilters, requestReader);
|
||||
}
|
||||
|
||||
protected HandledTransportAction(Settings settings, String actionName, boolean canTripCircuitBreaker, ThreadPool threadPool,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver, Supplier<Request> request) {
|
||||
super(settings, actionName, threadPool, actionFilters, indexNameExpressionResolver, transportService.getTaskManager());
|
||||
Supplier<Request> request) {
|
||||
super(settings, actionName, threadPool, actionFilters, transportService.getTaskManager());
|
||||
transportService.registerRequestHandler(actionName, request, ThreadPool.Names.SAME, false, canTripCircuitBreaker,
|
||||
new TransportHandler());
|
||||
}
|
||||
|
||||
protected HandledTransportAction(Settings settings, String actionName, boolean canTripCircuitBreaker, ThreadPool threadPool,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
Writeable.Reader<Request> requestReader, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, actionName, threadPool, actionFilters, indexNameExpressionResolver, transportService.getTaskManager());
|
||||
Writeable.Reader<Request> requestReader) {
|
||||
super(settings, actionName, threadPool, actionFilters, transportService.getTaskManager());
|
||||
transportService.registerRequestHandler(actionName, ThreadPool.Names.SAME, false, canTripCircuitBreaker, requestReader,
|
||||
new TransportHandler());
|
||||
}
|
||||
|
@ -24,7 +24,6 @@ import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
import org.elasticsearch.action.ActionResponse;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.component.AbstractComponent;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.tasks.Task;
|
||||
@ -39,16 +38,14 @@ public abstract class TransportAction<Request extends ActionRequest, Response ex
|
||||
protected final ThreadPool threadPool;
|
||||
protected final String actionName;
|
||||
private final ActionFilter[] filters;
|
||||
protected final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||
protected final TaskManager taskManager;
|
||||
|
||||
protected TransportAction(Settings settings, String actionName, ThreadPool threadPool, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver, TaskManager taskManager) {
|
||||
TaskManager taskManager) {
|
||||
super(settings);
|
||||
this.threadPool = threadPool;
|
||||
this.actionName = actionName;
|
||||
this.filters = actionFilters.filters();
|
||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||
this.taskManager = taskManager;
|
||||
}
|
||||
|
||||
|
@ -54,15 +54,17 @@ public abstract class TransportBroadcastAction<Request extends BroadcastRequest<
|
||||
|
||||
protected final ClusterService clusterService;
|
||||
protected final TransportService transportService;
|
||||
protected final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||
|
||||
final String transportShardAction;
|
||||
|
||||
protected TransportBroadcastAction(Settings settings, String actionName, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<Request> request, Supplier<ShardRequest> shardRequest, String shardExecutor) {
|
||||
super(settings, actionName, threadPool, transportService, actionFilters, indexNameExpressionResolver, request);
|
||||
super(settings, actionName, threadPool, transportService, actionFilters, request);
|
||||
this.clusterService = clusterService;
|
||||
this.transportService = transportService;
|
||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||
this.transportShardAction = actionName + "[s]";
|
||||
|
||||
transportService.registerRequestHandler(transportShardAction, shardRequest, shardExecutor, new ShardTransportHandler());
|
||||
|
@ -81,6 +81,7 @@ public abstract class TransportBroadcastByNodeAction<Request extends BroadcastRe
|
||||
|
||||
private final ClusterService clusterService;
|
||||
private final TransportService transportService;
|
||||
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||
|
||||
final String transportNodeBroadcastAction;
|
||||
|
||||
@ -109,11 +110,12 @@ public abstract class TransportBroadcastByNodeAction<Request extends BroadcastRe
|
||||
Supplier<Request> request,
|
||||
String executor,
|
||||
boolean canTripCircuitBreaker) {
|
||||
super(settings, actionName, canTripCircuitBreaker, threadPool, transportService, actionFilters, indexNameExpressionResolver,
|
||||
super(settings, actionName, canTripCircuitBreaker, threadPool, transportService, actionFilters,
|
||||
request);
|
||||
|
||||
this.clusterService = clusterService;
|
||||
this.transportService = transportService;
|
||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||
|
||||
transportNodeBroadcastAction = actionName + "[n]";
|
||||
|
||||
|
@ -56,6 +56,7 @@ import java.util.function.Supplier;
|
||||
public abstract class TransportMasterNodeAction<Request extends MasterNodeRequest<Request>, Response extends ActionResponse> extends HandledTransportAction<Request, Response> {
|
||||
protected final TransportService transportService;
|
||||
protected final ClusterService clusterService;
|
||||
protected final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||
|
||||
final String executor;
|
||||
|
||||
@ -74,10 +75,11 @@ public abstract class TransportMasterNodeAction<Request extends MasterNodeReques
|
||||
protected TransportMasterNodeAction(Settings settings, String actionName, boolean canTripCircuitBreaker,
|
||||
TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, Supplier<Request> request) {
|
||||
super(settings, actionName, canTripCircuitBreaker, threadPool, transportService, actionFilters, indexNameExpressionResolver,
|
||||
super(settings, actionName, canTripCircuitBreaker, threadPool, transportService, actionFilters,
|
||||
request);
|
||||
this.transportService = transportService;
|
||||
this.clusterService = clusterService;
|
||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||
this.executor = executor();
|
||||
}
|
||||
|
||||
@ -85,10 +87,11 @@ public abstract class TransportMasterNodeAction<Request extends MasterNodeReques
|
||||
TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
|
||||
ActionFilters actionFilters, Writeable.Reader<Request> request,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, actionName, canTripCircuitBreaker, threadPool, transportService, actionFilters, request,
|
||||
indexNameExpressionResolver);
|
||||
super(settings, actionName, canTripCircuitBreaker, threadPool, transportService, actionFilters, request
|
||||
);
|
||||
this.transportService = transportService;
|
||||
this.clusterService = clusterService;
|
||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||
this.executor = executor();
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,6 @@ import org.elasticsearch.action.NoSuchNodeException;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -63,11 +62,9 @@ public abstract class TransportNodesAction<NodesRequest extends BaseNodesRequest
|
||||
|
||||
protected TransportNodesAction(Settings settings, String actionName, ThreadPool threadPool,
|
||||
ClusterService clusterService, TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<NodesRequest> request, Supplier<NodeRequest> nodeRequest,
|
||||
String nodeExecutor,
|
||||
Supplier<NodesRequest> request, Supplier<NodeRequest> nodeRequest, String nodeExecutor,
|
||||
Class<NodeResponse> nodeResponseClass) {
|
||||
super(settings, actionName, threadPool, transportService, actionFilters, indexNameExpressionResolver, request);
|
||||
super(settings, actionName, threadPool, transportService, actionFilters, request);
|
||||
this.clusterService = Objects.requireNonNull(clusterService);
|
||||
this.transportService = Objects.requireNonNull(transportService);
|
||||
this.nodeResponseClass = Objects.requireNonNull(nodeResponseClass);
|
||||
|
@ -56,13 +56,15 @@ public abstract class TransportBroadcastReplicationAction<Request extends Broadc
|
||||
|
||||
private final TransportReplicationAction replicatedBroadcastShardAction;
|
||||
private final ClusterService clusterService;
|
||||
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||
|
||||
public TransportBroadcastReplicationAction(String name, Supplier<Request> request, Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, TransportReplicationAction replicatedBroadcastShardAction) {
|
||||
super(settings, name, threadPool, transportService, actionFilters, indexNameExpressionResolver, request);
|
||||
super(settings, name, threadPool, transportService, actionFilters, request);
|
||||
this.replicatedBroadcastShardAction = replicatedBroadcastShardAction;
|
||||
this.clusterService = clusterService;
|
||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||
}
|
||||
|
||||
|
||||
|
@ -104,6 +104,7 @@ public abstract class TransportReplicationAction<
|
||||
protected final ClusterService clusterService;
|
||||
protected final ShardStateAction shardStateAction;
|
||||
protected final IndicesService indicesService;
|
||||
protected final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||
protected final TransportRequestOptions transportOptions;
|
||||
protected final String executor;
|
||||
|
||||
@ -131,11 +132,12 @@ public abstract class TransportReplicationAction<
|
||||
IndexNameExpressionResolver indexNameExpressionResolver, Supplier<Request> request,
|
||||
Supplier<ReplicaRequest> replicaRequest, String executor,
|
||||
boolean syncGlobalCheckpointAfterOperation) {
|
||||
super(settings, actionName, threadPool, actionFilters, indexNameExpressionResolver, transportService.getTaskManager());
|
||||
super(settings, actionName, threadPool, actionFilters, transportService.getTaskManager());
|
||||
this.transportService = transportService;
|
||||
this.clusterService = clusterService;
|
||||
this.indicesService = indicesService;
|
||||
this.shardStateAction = shardStateAction;
|
||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||
this.executor = executor;
|
||||
|
||||
this.transportPrimaryAction = actionName + "[p]";
|
||||
|
@ -52,6 +52,7 @@ public abstract class TransportInstanceSingleOperationAction<Request extends Ins
|
||||
extends HandledTransportAction<Request, Response> {
|
||||
protected final ClusterService clusterService;
|
||||
protected final TransportService transportService;
|
||||
protected final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||
|
||||
final String executor;
|
||||
final String shardActionName;
|
||||
@ -59,9 +60,10 @@ public abstract class TransportInstanceSingleOperationAction<Request extends Ins
|
||||
protected TransportInstanceSingleOperationAction(Settings settings, String actionName, ThreadPool threadPool,
|
||||
ClusterService clusterService, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, Supplier<Request> request) {
|
||||
super(settings, actionName, threadPool, transportService, actionFilters, indexNameExpressionResolver, request);
|
||||
super(settings, actionName, threadPool, transportService, actionFilters, request);
|
||||
this.clusterService = clusterService;
|
||||
this.transportService = transportService;
|
||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||
this.executor = executor();
|
||||
this.shardActionName = actionName + "[s]";
|
||||
transportService.registerRequestHandler(shardActionName, request, executor, new ShardTransportHandler());
|
||||
|
@ -61,8 +61,8 @@ import static org.elasticsearch.action.support.TransportActions.isShardNotAvaila
|
||||
public abstract class TransportSingleShardAction<Request extends SingleShardRequest<Request>, Response extends ActionResponse> extends TransportAction<Request, Response> {
|
||||
|
||||
protected final ClusterService clusterService;
|
||||
|
||||
protected final TransportService transportService;
|
||||
protected final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||
|
||||
final String transportShardAction;
|
||||
final String executor;
|
||||
@ -70,9 +70,10 @@ public abstract class TransportSingleShardAction<Request extends SingleShardRequ
|
||||
protected TransportSingleShardAction(Settings settings, String actionName, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<Request> request, String executor) {
|
||||
super(settings, actionName, threadPool, actionFilters, indexNameExpressionResolver, transportService.getTaskManager());
|
||||
super(settings, actionName, threadPool, actionFilters, transportService.getTaskManager());
|
||||
this.clusterService = clusterService;
|
||||
this.transportService = transportService;
|
||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||
|
||||
this.transportShardAction = actionName + "[s]";
|
||||
this.executor = executor;
|
||||
|
@ -28,7 +28,6 @@ import org.elasticsearch.action.TaskOperationFailure;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
@ -78,12 +77,10 @@ public abstract class TransportTasksAction<
|
||||
|
||||
protected final String transportNodeAction;
|
||||
|
||||
protected TransportTasksAction(Settings settings, String actionName, ThreadPool threadPool,
|
||||
ClusterService clusterService, TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver, Supplier<TasksRequest> requestSupplier,
|
||||
Supplier<TasksResponse> responseSupplier,
|
||||
String nodeExecutor) {
|
||||
super(settings, actionName, threadPool, transportService, actionFilters, indexNameExpressionResolver, requestSupplier);
|
||||
protected TransportTasksAction(Settings settings, String actionName, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters, Supplier<TasksRequest> requestSupplier,
|
||||
Supplier<TasksResponse> responseSupplier, String nodeExecutor) {
|
||||
super(settings, actionName, threadPool, transportService, actionFilters, requestSupplier);
|
||||
this.clusterService = clusterService;
|
||||
this.transportService = transportService;
|
||||
this.transportNodeAction = actionName + "[n]";
|
||||
|
@ -41,16 +41,17 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
public class TransportMultiTermVectorsAction extends HandledTransportAction<MultiTermVectorsRequest, MultiTermVectorsResponse> {
|
||||
|
||||
private final ClusterService clusterService;
|
||||
|
||||
private final TransportShardMultiTermsVectorAction shardAction;
|
||||
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||
|
||||
@Inject
|
||||
public TransportMultiTermVectorsAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ClusterService clusterService, TransportShardMultiTermsVectorAction shardAction,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, MultiTermVectorsAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver, MultiTermVectorsRequest::new);
|
||||
super(settings, MultiTermVectorsAction.NAME, threadPool, transportService, actionFilters, MultiTermVectorsRequest::new);
|
||||
this.clusterService = clusterService;
|
||||
this.shardAction = shardAction;
|
||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -30,7 +30,6 @@ import org.elasticsearch.action.support.nodes.BaseNodesRequest;
|
||||
import org.elasticsearch.action.support.nodes.BaseNodesResponse;
|
||||
import org.elasticsearch.action.support.nodes.TransportNodesAction;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.metadata.MetaData;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
@ -56,12 +55,10 @@ public class TransportNodesListGatewayMetaState extends TransportNodesAction<Tra
|
||||
private final GatewayMetaState metaState;
|
||||
|
||||
@Inject
|
||||
public TransportNodesListGatewayMetaState(Settings settings, ThreadPool threadPool,
|
||||
ClusterService clusterService, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
GatewayMetaState metaState) {
|
||||
public TransportNodesListGatewayMetaState(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters, GatewayMetaState metaState) {
|
||||
super(settings, ACTION_NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
indexNameExpressionResolver, Request::new, NodeRequest::new, ThreadPool.Names.GENERIC, NodeGatewayMetaState.class);
|
||||
Request::new, NodeRequest::new, ThreadPool.Names.GENERIC, NodeGatewayMetaState.class);
|
||||
this.metaState = metaState;
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,6 @@ import org.elasticsearch.action.support.nodes.BaseNodesResponse;
|
||||
import org.elasticsearch.action.support.nodes.TransportNodesAction;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
@ -72,14 +71,11 @@ public class TransportNodesListGatewayStartedShards extends
|
||||
private final IndicesService indicesService;
|
||||
|
||||
@Inject
|
||||
public TransportNodesListGatewayStartedShards(Settings settings, ThreadPool threadPool,
|
||||
ClusterService clusterService, TransportService transportService,
|
||||
ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
public TransportNodesListGatewayStartedShards(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
NodeEnvironment env, IndicesService indicesService) {
|
||||
super(settings, ACTION_NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
indexNameExpressionResolver, Request::new, NodeRequest::new, ThreadPool.Names.FETCH_SHARD_STARTED,
|
||||
NodeGatewayStartedShards.class);
|
||||
Request::new, NodeRequest::new, ThreadPool.Names.FETCH_SHARD_STARTED, NodeGatewayStartedShards.class);
|
||||
this.nodeEnv = env;
|
||||
this.indicesService = indicesService;
|
||||
}
|
||||
|
@ -30,7 +30,6 @@ import org.elasticsearch.action.support.nodes.BaseNodesResponse;
|
||||
import org.elasticsearch.action.support.nodes.TransportNodesAction;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
@ -74,9 +73,8 @@ public class TransportNodesListShardStoreMetaData extends TransportNodesAction<T
|
||||
@Inject
|
||||
public TransportNodesListShardStoreMetaData(Settings settings, ThreadPool threadPool,
|
||||
ClusterService clusterService, TransportService transportService,
|
||||
IndicesService indicesService, NodeEnvironment nodeEnv, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, ACTION_NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
IndicesService indicesService, NodeEnvironment nodeEnv, ActionFilters actionFilters) {
|
||||
super(settings, ACTION_NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
Request::new, NodeRequest::new, ThreadPool.Names.FETCH_SHARD_STORE, NodeStoreFilesMetaData.class);
|
||||
this.indicesService = indicesService;
|
||||
this.nodeEnv = nodeEnv;
|
||||
|
@ -81,7 +81,7 @@ public class ActionModuleTests extends ESTestCase {
|
||||
class FakeTransportAction extends TransportAction<FakeRequest, ActionResponse> {
|
||||
protected FakeTransportAction(Settings settings, String actionName, ThreadPool threadPool, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver, TaskManager taskManager) {
|
||||
super(settings, actionName, threadPool, actionFilters, indexNameExpressionResolver, taskManager);
|
||||
super(settings, actionName, threadPool, actionFilters, taskManager);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -32,7 +32,6 @@ import org.elasticsearch.action.support.nodes.TransportNodesAction;
|
||||
import org.elasticsearch.action.support.replication.ClusterStateCreationUtils;
|
||||
import org.elasticsearch.cluster.ClusterModule;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
|
||||
@ -148,8 +147,8 @@ public abstract class TaskManagerTestCase extends ESTestCase {
|
||||
ClusterService clusterService, TransportService transportService, Supplier<NodesRequest> request,
|
||||
Supplier<NodeRequest> nodeRequest) {
|
||||
super(settings, actionName, threadPool, clusterService, transportService,
|
||||
new ActionFilters(new HashSet<>()), new IndexNameExpressionResolver(Settings.EMPTY),
|
||||
request, nodeRequest, ThreadPool.Names.GENERIC, NodeResponse.class);
|
||||
new ActionFilters(new HashSet<>()),
|
||||
request, nodeRequest, ThreadPool.Names.GENERIC, NodeResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -192,12 +191,10 @@ public abstract class TaskManagerTestCase extends ESTestCase {
|
||||
transportService.start();
|
||||
clusterService = createClusterService(threadPool, discoveryNode.get());
|
||||
clusterService.addStateApplier(transportService.getTaskManager());
|
||||
IndexNameExpressionResolver indexNameExpressionResolver = new IndexNameExpressionResolver(settings);
|
||||
ActionFilters actionFilters = new ActionFilters(emptySet());
|
||||
transportListTasksAction = new TransportListTasksAction(settings, threadPool, clusterService, transportService,
|
||||
actionFilters, indexNameExpressionResolver);
|
||||
transportListTasksAction = new TransportListTasksAction(settings, threadPool, clusterService, transportService, actionFilters);
|
||||
transportCancelTasksAction = new TransportCancelTasksAction(settings, threadPool, clusterService,
|
||||
transportService, actionFilters, indexNameExpressionResolver);
|
||||
transportService, actionFilters);
|
||||
transportService.acceptIncomingRequests();
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,6 @@ import org.elasticsearch.action.support.tasks.BaseTasksResponse;
|
||||
import org.elasticsearch.action.support.tasks.TransportTasksAction;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
@ -269,8 +268,8 @@ public class TestTaskPlugin extends Plugin implements ActionPlugin {
|
||||
public TransportTestTaskAction(Settings settings, ThreadPool threadPool,
|
||||
ClusterService clusterService, TransportService transportService) {
|
||||
super(settings, TestTaskAction.NAME, threadPool, clusterService, transportService,
|
||||
new ActionFilters(new HashSet<>()), new IndexNameExpressionResolver(Settings.EMPTY),
|
||||
NodesRequest::new, NodeRequest::new, ThreadPool.Names.GENERIC, NodeResponse.class);
|
||||
new ActionFilters(new HashSet<>()),
|
||||
NodesRequest::new, NodeRequest::new, ThreadPool.Names.GENERIC, NodeResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -429,7 +428,7 @@ public class TestTaskPlugin extends Plugin implements ActionPlugin {
|
||||
clusterService,
|
||||
TransportService transportService) {
|
||||
super(settings, UnblockTestTasksAction.NAME, threadPool, clusterService, transportService, new ActionFilters(new
|
||||
HashSet<>()), new IndexNameExpressionResolver(Settings.EMPTY),
|
||||
HashSet<>()),
|
||||
UnblockTestTasksRequest::new, UnblockTestTasksResponse::new, ThreadPool.Names.MANAGEMENT);
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,6 @@ import org.elasticsearch.action.support.nodes.BaseNodesRequest;
|
||||
import org.elasticsearch.action.support.tasks.BaseTasksRequest;
|
||||
import org.elasticsearch.action.support.tasks.BaseTasksResponse;
|
||||
import org.elasticsearch.action.support.tasks.TransportTasksAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.Strings;
|
||||
@ -258,7 +257,7 @@ public class TransportTasksActionTests extends TaskManagerTestCase {
|
||||
protected TestTasksAction(Settings settings, String actionName, ThreadPool threadPool,
|
||||
ClusterService clusterService, TransportService transportService) {
|
||||
super(settings, actionName, threadPool, clusterService, transportService, new ActionFilters(new HashSet<>()),
|
||||
new IndexNameExpressionResolver(Settings.EMPTY), TestTasksRequest::new, TestTasksResponse::new,
|
||||
TestTasksRequest::new, TestTasksResponse::new,
|
||||
ThreadPool.Names.MANAGEMENT);
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,6 @@ import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.block.ClusterBlock;
|
||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||
import org.elasticsearch.cluster.block.ClusterBlocks;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.RestStatus;
|
||||
@ -70,7 +69,7 @@ public class MainActionTests extends ESTestCase {
|
||||
TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR,
|
||||
x -> null, null, Collections.emptySet());
|
||||
TransportMainAction action = new TransportMainAction(settings, mock(ThreadPool.class), transportService, mock(ActionFilters.class),
|
||||
mock(IndexNameExpressionResolver.class), clusterService);
|
||||
clusterService);
|
||||
AtomicReference<MainResponse> responseRef = new AtomicReference<>();
|
||||
action.doExecute(new MainRequest(), new ActionListener<MainResponse>() {
|
||||
@Override
|
||||
|
@ -149,7 +149,7 @@ public class MultiSearchActionTookTests extends ESTestCase {
|
||||
final Set<SearchRequest> requests = Collections.newSetFromMap(Collections.synchronizedMap(new IdentityHashMap<>()));
|
||||
|
||||
TransportAction<SearchRequest, SearchResponse> searchAction = new TransportAction<SearchRequest, SearchResponse>(Settings.EMPTY,
|
||||
"action", threadPool, actionFilters, resolver, taskManager) {
|
||||
"action", threadPool, actionFilters, taskManager) {
|
||||
@Override
|
||||
protected void doExecute(SearchRequest request, ActionListener<SearchResponse> listener) {
|
||||
requests.add(request);
|
||||
@ -161,7 +161,7 @@ public class MultiSearchActionTookTests extends ESTestCase {
|
||||
};
|
||||
|
||||
if (controlledClock) {
|
||||
return new TransportMultiSearchAction(threadPool, actionFilters, transportService, clusterService, searchAction, resolver,
|
||||
return new TransportMultiSearchAction(threadPool, actionFilters, transportService, clusterService, searchAction,
|
||||
availableProcessors, expected::get) {
|
||||
@Override
|
||||
void executeSearch(final Queue<SearchRequestSlot> requests, final AtomicArray<MultiSearchResponse.Item> responses,
|
||||
@ -171,7 +171,7 @@ public class MultiSearchActionTookTests extends ESTestCase {
|
||||
}
|
||||
};
|
||||
} else {
|
||||
return new TransportMultiSearchAction(threadPool, actionFilters, transportService, clusterService, searchAction, resolver,
|
||||
return new TransportMultiSearchAction(threadPool, actionFilters, transportService, clusterService, searchAction,
|
||||
availableProcessors, System::nanoTime) {
|
||||
|
||||
@Override
|
||||
|
@ -108,7 +108,7 @@ public class TransportMultiSearchActionTests extends ESTestCase {
|
||||
final ExecutorService rarelyExecutor = threadPool.executor(threadPoolNames.get(1));
|
||||
final Set<SearchRequest> requests = Collections.newSetFromMap(Collections.synchronizedMap(new IdentityHashMap<>()));
|
||||
TransportAction<SearchRequest, SearchResponse> searchAction = new TransportAction<SearchRequest, SearchResponse>
|
||||
(Settings.EMPTY, "action", threadPool, actionFilters, resolver, taskManager) {
|
||||
(Settings.EMPTY, "action", threadPool, actionFilters, taskManager) {
|
||||
@Override
|
||||
protected void doExecute(SearchRequest request, ActionListener<SearchResponse> listener) {
|
||||
requests.add(request);
|
||||
@ -126,7 +126,7 @@ public class TransportMultiSearchActionTests extends ESTestCase {
|
||||
};
|
||||
|
||||
TransportMultiSearchAction action =
|
||||
new TransportMultiSearchAction(threadPool, actionFilters, transportService, clusterService, searchAction, resolver, 10,
|
||||
new TransportMultiSearchAction(threadPool, actionFilters, transportService, clusterService, searchAction, 10,
|
||||
System::nanoTime);
|
||||
|
||||
// Execute the multi search api and fail if we find an error after executing:
|
||||
|
@ -80,7 +80,7 @@ public class TransportActionFilterChainTests extends ESTestCase {
|
||||
String actionName = randomAlphaOfLength(randomInt(30));
|
||||
ActionFilters actionFilters = new ActionFilters(filters);
|
||||
TransportAction<TestRequest, TestResponse> transportAction =
|
||||
new TransportAction<TestRequest, TestResponse>(Settings.EMPTY, actionName, null, actionFilters, null,
|
||||
new TransportAction<TestRequest, TestResponse>(Settings.EMPTY, actionName, null, actionFilters,
|
||||
new TaskManager(Settings.EMPTY, threadPool, Collections.emptySet())) {
|
||||
@Override
|
||||
protected void doExecute(TestRequest request, ActionListener<TestResponse> listener) {
|
||||
@ -158,7 +158,7 @@ public class TransportActionFilterChainTests extends ESTestCase {
|
||||
String actionName = randomAlphaOfLength(randomInt(30));
|
||||
ActionFilters actionFilters = new ActionFilters(filters);
|
||||
TransportAction<TestRequest, TestResponse> transportAction = new TransportAction<TestRequest, TestResponse>(Settings.EMPTY,
|
||||
actionName, null, actionFilters, null, new TaskManager(Settings.EMPTY, threadPool, Collections.emptySet())) {
|
||||
actionName, null, actionFilters, new TaskManager(Settings.EMPTY, threadPool, Collections.emptySet())) {
|
||||
@Override
|
||||
protected void doExecute(TestRequest request, ActionListener<TestResponse> listener) {
|
||||
listener.onResponse(new TestResponse());
|
||||
|
@ -250,7 +250,7 @@ public class TransportNodesActionTests extends ESTestCase {
|
||||
transportService, ActionFilters actionFilters, Supplier<TestNodesRequest> request,
|
||||
Supplier<TestNodeRequest> nodeRequest, String nodeExecutor) {
|
||||
super(settings, "indices:admin/test", threadPool, clusterService, transportService, actionFilters,
|
||||
null, request, nodeRequest, nodeExecutor, TestNodeResponse.class);
|
||||
request, nodeRequest, nodeExecutor, TestNodeResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -59,7 +59,7 @@ public class NodeClientHeadersTests extends AbstractClientHeadersTestCase {
|
||||
private static class InternalTransportAction extends TransportAction {
|
||||
|
||||
private InternalTransportAction(Settings settings, String actionName, ThreadPool threadPool) {
|
||||
super(settings, actionName, threadPool, EMPTY_FILTERS, null, new TaskManager(settings, threadPool, Collections.emptySet()));
|
||||
super(settings, actionName, threadPool, EMPTY_FILTERS, new TaskManager(settings, threadPool, Collections.emptySet()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -514,8 +514,8 @@ public class TestPersistentTasksPlugin extends Plugin implements ActionPlugin, P
|
||||
public TransportTestTaskAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver, String nodeExecutor) {
|
||||
super(settings, TestTaskAction.NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
TestTasksRequest::new, TestTasksResponse::new, ThreadPool.Names.MANAGEMENT);
|
||||
super(settings, TestTaskAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
TestTasksRequest::new, TestTasksResponse::new, ThreadPool.Names.MANAGEMENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -8,7 +8,6 @@ package org.elasticsearch.xpack.core.action;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.license.XPackInfoResponse;
|
||||
@ -31,10 +30,9 @@ public class TransportXPackInfoAction extends HandledTransportAction<XPackInfoRe
|
||||
|
||||
@Inject
|
||||
public TransportXPackInfoAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
LicenseService licenseService, Set<XPackFeatureSet> featureSets) {
|
||||
super(settings, XPackInfoAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver,
|
||||
XPackInfoRequest::new);
|
||||
ActionFilters actionFilters, LicenseService licenseService, Set<XPackFeatureSet> featureSets) {
|
||||
super(settings, XPackInfoAction.NAME, threadPool, transportService, actionFilters,
|
||||
XPackInfoRequest::new);
|
||||
this.licenseService = licenseService;
|
||||
this.featureSets = featureSets;
|
||||
}
|
||||
|
@ -8,7 +8,6 @@ package org.elasticsearch.xpack.core.ssl.action;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
@ -28,10 +27,9 @@ public class TransportGetCertificateInfoAction extends HandledTransportAction<Ge
|
||||
@Inject
|
||||
public TransportGetCertificateInfoAction(Settings settings, ThreadPool threadPool,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
SSLService sslService) {
|
||||
super(settings, GetCertificateInfoAction.NAME, threadPool, transportService, actionFilters,
|
||||
indexNameExpressionResolver, GetCertificateInfoAction.Request::new);
|
||||
GetCertificateInfoAction.Request::new);
|
||||
this.sslService = sslService;
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,6 @@ package org.elasticsearch.xpack.core.action;
|
||||
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.license.XPackInfoResponse;
|
||||
import org.elasticsearch.license.License;
|
||||
@ -56,7 +55,7 @@ public class TransportXPackInfoActionTests extends ESTestCase {
|
||||
TransportService transportService = new TransportService(Settings.EMPTY, null, null, TransportService.NOOP_TRANSPORT_INTERCEPTOR,
|
||||
x -> null, null, Collections.emptySet());
|
||||
TransportXPackInfoAction action = new TransportXPackInfoAction(Settings.EMPTY, mock(ThreadPool.class), transportService,
|
||||
mock(ActionFilters.class), mock(IndexNameExpressionResolver.class), licenseService, featureSets);
|
||||
mock(ActionFilters.class), licenseService, featureSets);
|
||||
|
||||
License license = mock(License.class);
|
||||
long expiryDate = randomLong();
|
||||
|
@ -16,7 +16,6 @@ import org.elasticsearch.action.search.ShardSearchFailure;
|
||||
import org.elasticsearch.action.search.TransportSearchAction;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
@ -58,6 +57,7 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* Performs a series of elasticsearch queries and aggregations to explore
|
||||
@ -83,10 +83,10 @@ public class TransportGraphExploreAction extends HandledTransportAction<GraphExp
|
||||
|
||||
@Inject
|
||||
public TransportGraphExploreAction(Settings settings, ThreadPool threadPool, TransportSearchAction transportSearchAction,
|
||||
TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
XPackLicenseState licenseState) {
|
||||
super(settings, GraphExploreAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver,
|
||||
GraphExploreRequest::new);
|
||||
super(settings, GraphExploreAction.NAME, threadPool, transportService, actionFilters,
|
||||
(Supplier<GraphExploreRequest>)GraphExploreRequest::new);
|
||||
this.searchAction = transportSearchAction;
|
||||
this.licenseState = licenseState;
|
||||
}
|
||||
|
@ -15,7 +15,6 @@ import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.tasks.TransportTasksAction;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
@ -64,13 +63,12 @@ public class TransportCloseJobAction extends TransportTasksAction<TransportOpenJ
|
||||
private final PersistentTasksService persistentTasksService;
|
||||
|
||||
@Inject
|
||||
public TransportCloseJobAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
ClusterService clusterService, Client client,
|
||||
Auditor auditor, PersistentTasksService persistentTasksService) {
|
||||
public TransportCloseJobAction(Settings settings, TransportService transportService, ThreadPool threadPool, ActionFilters actionFilters,
|
||||
ClusterService clusterService, Client client, Auditor auditor,
|
||||
PersistentTasksService persistentTasksService) {
|
||||
// We fork in innerTaskOperation(...), so we can use ThreadPool.Names.SAME here:
|
||||
super(settings, CloseJobAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
indexNameExpressionResolver, CloseJobAction.Request::new, CloseJobAction.Response::new, ThreadPool.Names.SAME);
|
||||
CloseJobAction.Request::new, CloseJobAction.Response::new, ThreadPool.Names.SAME);
|
||||
this.client = client;
|
||||
this.clusterService = clusterService;
|
||||
this.auditor = auditor;
|
||||
|
@ -5,13 +5,14 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.action;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.elasticsearch.ResourceNotFoundException;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.search.SearchRequest;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.index.query.QueryBuilder;
|
||||
@ -37,12 +38,10 @@ public class TransportDeleteCalendarAction extends HandledTransportAction<Delete
|
||||
private final JobProvider jobProvider;
|
||||
|
||||
@Inject
|
||||
public TransportDeleteCalendarAction(Settings settings, ThreadPool threadPool,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Client client, JobManager jobManager, JobProvider jobProvider) {
|
||||
public TransportDeleteCalendarAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, Client client, JobManager jobManager, JobProvider jobProvider) {
|
||||
super(settings, DeleteCalendarAction.NAME, threadPool, transportService, actionFilters,
|
||||
indexNameExpressionResolver, DeleteCalendarAction.Request::new);
|
||||
(Supplier<DeleteCalendarAction.Request>) DeleteCalendarAction.Request::new);
|
||||
this.client = client;
|
||||
this.jobManager = jobManager;
|
||||
this.jobProvider = jobProvider;
|
||||
|
@ -16,7 +16,6 @@ import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.action.support.WriteRequest;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.RestStatus;
|
||||
@ -44,10 +43,9 @@ public class TransportDeleteCalendarEventAction extends HandledTransportAction<D
|
||||
@Inject
|
||||
public TransportDeleteCalendarEventAction(Settings settings, ThreadPool threadPool,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Client client, JobProvider jobProvider, JobManager jobManager) {
|
||||
super(settings, DeleteCalendarEventAction.NAME, threadPool, transportService, actionFilters,
|
||||
indexNameExpressionResolver, DeleteCalendarEventAction.Request::new);
|
||||
DeleteCalendarEventAction.Request::new);
|
||||
this.client = client;
|
||||
this.jobProvider = jobProvider;
|
||||
this.jobManager = jobManager;
|
||||
|
@ -9,7 +9,6 @@ import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -38,10 +37,8 @@ public class TransportDeleteExpiredDataAction extends HandledTransportAction<Del
|
||||
|
||||
@Inject
|
||||
public TransportDeleteExpiredDataAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Client client, ClusterService clusterService) {
|
||||
super(settings, DeleteExpiredDataAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver,
|
||||
DeleteExpiredDataAction.Request::new);
|
||||
ActionFilters actionFilters, Client client, ClusterService clusterService) {
|
||||
super(settings, DeleteExpiredDataAction.NAME, threadPool, transportService, actionFilters, DeleteExpiredDataAction.Request::new);
|
||||
this.client = ClientHelper.clientWithOrigin(client, ClientHelper.ML_ORIGIN);
|
||||
this.clusterService = clusterService;
|
||||
}
|
||||
|
@ -16,7 +16,6 @@ import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.action.support.WriteRequest;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -34,6 +33,7 @@ import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static org.elasticsearch.xpack.core.ClientHelper.ML_ORIGIN;
|
||||
import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin;
|
||||
@ -44,12 +44,10 @@ public class TransportDeleteFilterAction extends HandledTransportAction<DeleteFi
|
||||
private final ClusterService clusterService;
|
||||
|
||||
@Inject
|
||||
public TransportDeleteFilterAction(Settings settings, ThreadPool threadPool,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
ClusterService clusterService, Client client) {
|
||||
public TransportDeleteFilterAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, ClusterService clusterService, Client client) {
|
||||
super(settings, DeleteFilterAction.NAME, threadPool, transportService, actionFilters,
|
||||
indexNameExpressionResolver, DeleteFilterAction.Request::new);
|
||||
(Supplier<DeleteFilterAction.Request>) DeleteFilterAction.Request::new);
|
||||
this.clusterService = clusterService;
|
||||
this.client = client;
|
||||
}
|
||||
|
@ -11,7 +11,6 @@ import org.elasticsearch.action.bulk.BulkResponse;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -39,10 +38,10 @@ public class TransportDeleteModelSnapshotAction extends HandledTransportAction<D
|
||||
|
||||
@Inject
|
||||
public TransportDeleteModelSnapshotAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
ActionFilters actionFilters,
|
||||
JobProvider jobProvider, ClusterService clusterService, Client client, Auditor auditor) {
|
||||
super(settings, DeleteModelSnapshotAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver,
|
||||
DeleteModelSnapshotAction.Request::new);
|
||||
super(settings, DeleteModelSnapshotAction.NAME, threadPool, transportService, actionFilters,
|
||||
DeleteModelSnapshotAction.Request::new);
|
||||
this.client = client;
|
||||
this.jobProvider = jobProvider;
|
||||
this.clusterService = clusterService;
|
||||
|
@ -7,7 +7,6 @@ package org.elasticsearch.xpack.ml.action;
|
||||
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
@ -26,10 +25,9 @@ public class TransportFlushJobAction extends TransportJobTaskAction<FlushJobActi
|
||||
@Inject
|
||||
public TransportFlushJobAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
ClusterService clusterService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
AutodetectProcessManager processManager) {
|
||||
super(settings, FlushJobAction.NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
FlushJobAction.Request::new, FlushJobAction.Response::new, ThreadPool.Names.SAME, processManager);
|
||||
super(settings, FlushJobAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
FlushJobAction.Request::new, FlushJobAction.Response::new, ThreadPool.Names.SAME, processManager);
|
||||
// ThreadPool.Names.SAME, because operations is executed by autodetect worker thread
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,6 @@ import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
@ -45,10 +44,9 @@ public class TransportForecastJobAction extends TransportJobTaskAction<ForecastJ
|
||||
@Inject
|
||||
public TransportForecastJobAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
ClusterService clusterService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver, JobProvider jobProvider,
|
||||
AutodetectProcessManager processManager) {
|
||||
JobProvider jobProvider, AutodetectProcessManager processManager) {
|
||||
super(settings, ForecastJobAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
indexNameExpressionResolver, ForecastJobAction.Request::new, ForecastJobAction.Response::new,
|
||||
ForecastJobAction.Request::new, ForecastJobAction.Response::new,
|
||||
ThreadPool.Names.SAME, processManager);
|
||||
this.jobProvider = jobProvider;
|
||||
// ThreadPool.Names.SAME, because operations is executed by autodetect worker thread
|
||||
|
@ -5,11 +5,12 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.action;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
@ -27,10 +28,9 @@ public class TransportGetBucketsAction extends HandledTransportAction<GetBuckets
|
||||
|
||||
@Inject
|
||||
public TransportGetBucketsAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
JobProvider jobProvider, JobManager jobManager, Client client) {
|
||||
super(settings, GetBucketsAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver,
|
||||
GetBucketsAction.Request::new);
|
||||
ActionFilters actionFilters, JobProvider jobProvider, JobManager jobManager, Client client) {
|
||||
super(settings, GetBucketsAction.NAME, threadPool, transportService, actionFilters,
|
||||
(Supplier<GetBucketsAction.Request>) GetBucketsAction.Request::new);
|
||||
this.jobProvider = jobProvider;
|
||||
this.jobManager = jobManager;
|
||||
this.client = client;
|
||||
|
@ -9,7 +9,6 @@ import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -27,6 +26,7 @@ import org.elasticsearch.xpack.ml.job.persistence.JobProvider;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class TransportGetCalendarEventsAction extends HandledTransportAction<GetCalendarEventsAction.Request,
|
||||
GetCalendarEventsAction.Response> {
|
||||
@ -35,12 +35,10 @@ public class TransportGetCalendarEventsAction extends HandledTransportAction<Get
|
||||
private final ClusterService clusterService;
|
||||
|
||||
@Inject
|
||||
public TransportGetCalendarEventsAction(Settings settings, ThreadPool threadPool,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
ClusterService clusterService, JobProvider jobProvider) {
|
||||
public TransportGetCalendarEventsAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, ClusterService clusterService, JobProvider jobProvider) {
|
||||
super(settings, GetCalendarEventsAction.NAME, threadPool, transportService, actionFilters,
|
||||
indexNameExpressionResolver, GetCalendarEventsAction.Request::new);
|
||||
(Supplier<GetCalendarEventsAction.Request>) GetCalendarEventsAction.Request::new);
|
||||
this.jobProvider = jobProvider;
|
||||
this.clusterService = clusterService;
|
||||
}
|
||||
|
@ -8,7 +8,6 @@ package org.elasticsearch.xpack.ml.action;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
@ -27,12 +26,10 @@ public class TransportGetCalendarsAction extends HandledTransportAction<GetCalen
|
||||
private final JobProvider jobProvider;
|
||||
|
||||
@Inject
|
||||
public TransportGetCalendarsAction(Settings settings, ThreadPool threadPool,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
JobProvider jobProvider) {
|
||||
public TransportGetCalendarsAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, JobProvider jobProvider) {
|
||||
super(settings, GetCalendarsAction.NAME, threadPool, transportService, actionFilters,
|
||||
indexNameExpressionResolver, GetCalendarsAction.Request::new);
|
||||
GetCalendarsAction.Request::new);
|
||||
this.jobProvider = jobProvider;
|
||||
}
|
||||
|
||||
|
@ -5,11 +5,12 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.action;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
@ -26,10 +27,9 @@ public class TransportGetCategoriesAction extends HandledTransportAction<GetCate
|
||||
|
||||
@Inject
|
||||
public TransportGetCategoriesAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
JobProvider jobProvider, Client client, JobManager jobManager) {
|
||||
super(settings, GetCategoriesAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver,
|
||||
GetCategoriesAction.Request::new);
|
||||
ActionFilters actionFilters, JobProvider jobProvider, Client client, JobManager jobManager) {
|
||||
super(settings, GetCategoriesAction.NAME, threadPool, transportService, actionFilters,
|
||||
(Supplier<GetCategoriesAction.Request>) GetCategoriesAction.Request::new);
|
||||
this.jobProvider = jobProvider;
|
||||
this.client = client;
|
||||
this.jobManager = jobManager;
|
||||
|
@ -14,7 +14,6 @@ import org.elasticsearch.action.search.SearchResponse;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
@ -50,12 +49,10 @@ public class TransportGetFiltersAction extends HandledTransportAction<GetFilters
|
||||
private final Client client;
|
||||
|
||||
@Inject
|
||||
public TransportGetFiltersAction(Settings settings, ThreadPool threadPool,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Client client) {
|
||||
public TransportGetFiltersAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, Client client) {
|
||||
super(settings, GetFiltersAction.NAME, threadPool, transportService, actionFilters,
|
||||
indexNameExpressionResolver, GetFiltersAction.Request::new);
|
||||
GetFiltersAction.Request::new);
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
|
@ -5,11 +5,12 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.action;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
@ -27,10 +28,9 @@ public class TransportGetInfluencersAction extends HandledTransportAction<GetInf
|
||||
|
||||
@Inject
|
||||
public TransportGetInfluencersAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
JobProvider jobProvider, Client client, JobManager jobManager) {
|
||||
super(settings, GetInfluencersAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver,
|
||||
GetInfluencersAction.Request::new);
|
||||
ActionFilters actionFilters, JobProvider jobProvider, Client client, JobManager jobManager) {
|
||||
super(settings, GetInfluencersAction.NAME, threadPool, transportService, actionFilters,
|
||||
(Supplier<GetInfluencersAction.Request>) GetInfluencersAction.Request::new);
|
||||
this.jobProvider = jobProvider;
|
||||
this.client = client;
|
||||
this.jobManager = jobManager;
|
||||
|
@ -11,7 +11,6 @@ import org.elasticsearch.action.TaskOperationFailure;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.tasks.TransportTasksAction;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.collect.Tuple;
|
||||
@ -56,10 +55,9 @@ public class TransportGetJobsStatsAction extends TransportTasksAction<TransportO
|
||||
@Inject
|
||||
public TransportGetJobsStatsAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
ActionFilters actionFilters, ClusterService clusterService,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
AutodetectProcessManager processManager, JobProvider jobProvider) {
|
||||
super(settings, GetJobsStatsAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
indexNameExpressionResolver, GetJobsStatsAction.Request::new, GetJobsStatsAction.Response::new,
|
||||
GetJobsStatsAction.Request::new, GetJobsStatsAction.Response::new,
|
||||
ThreadPool.Names.MANAGEMENT);
|
||||
this.clusterService = clusterService;
|
||||
this.processManager = processManager;
|
||||
|
@ -8,7 +8,6 @@ package org.elasticsearch.xpack.ml.action;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
@ -29,10 +28,9 @@ public class TransportGetModelSnapshotsAction extends HandledTransportAction<Get
|
||||
|
||||
@Inject
|
||||
public TransportGetModelSnapshotsAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
JobProvider jobProvider, JobManager jobManager) {
|
||||
super(settings, GetModelSnapshotsAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver,
|
||||
GetModelSnapshotsAction.Request::new);
|
||||
ActionFilters actionFilters, JobProvider jobProvider, JobManager jobManager) {
|
||||
super(settings, GetModelSnapshotsAction.NAME, threadPool, transportService, actionFilters,
|
||||
GetModelSnapshotsAction.Request::new);
|
||||
this.jobProvider = jobProvider;
|
||||
this.jobManager = jobManager;
|
||||
}
|
||||
|
@ -11,7 +11,6 @@ import org.elasticsearch.action.search.SearchResponse;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -46,6 +45,7 @@ import org.elasticsearch.xpack.ml.job.persistence.overallbuckets.OverallBucketsP
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static org.elasticsearch.xpack.core.ClientHelper.ML_ORIGIN;
|
||||
import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin;
|
||||
@ -62,10 +62,10 @@ public class TransportGetOverallBucketsAction extends HandledTransportAction<Get
|
||||
|
||||
@Inject
|
||||
public TransportGetOverallBucketsAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
ClusterService clusterService, JobManager jobManager, Client client) {
|
||||
super(settings, GetOverallBucketsAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver,
|
||||
GetOverallBucketsAction.Request::new);
|
||||
ActionFilters actionFilters, ClusterService clusterService,
|
||||
JobManager jobManager, Client client) {
|
||||
super(settings, GetOverallBucketsAction.NAME, threadPool, transportService, actionFilters,
|
||||
(Supplier<GetOverallBucketsAction.Request>) GetOverallBucketsAction.Request::new);
|
||||
this.clusterService = clusterService;
|
||||
this.client = client;
|
||||
this.jobManager = jobManager;
|
||||
|
@ -5,11 +5,12 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.action;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
@ -27,10 +28,9 @@ public class TransportGetRecordsAction extends HandledTransportAction<GetRecords
|
||||
|
||||
@Inject
|
||||
public TransportGetRecordsAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
JobProvider jobProvider, JobManager jobManager, Client client) {
|
||||
super(settings, GetRecordsAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver,
|
||||
GetRecordsAction.Request::new);
|
||||
ActionFilters actionFilters, JobProvider jobProvider, JobManager jobManager, Client client) {
|
||||
super(settings, GetRecordsAction.NAME, threadPool, transportService, actionFilters,
|
||||
(Supplier<GetRecordsAction.Request>) GetRecordsAction.Request::new);
|
||||
this.jobProvider = jobProvider;
|
||||
this.jobManager = jobManager;
|
||||
this.client = client;
|
||||
|
@ -13,7 +13,6 @@ import org.elasticsearch.action.TaskOperationFailure;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.tasks.TransportTasksAction;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
@ -35,10 +34,9 @@ public class TransportIsolateDatafeedAction extends TransportTasksAction<Transpo
|
||||
|
||||
@Inject
|
||||
public TransportIsolateDatafeedAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
ClusterService clusterService) {
|
||||
ActionFilters actionFilters, ClusterService clusterService) {
|
||||
super(settings, IsolateDatafeedAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
indexNameExpressionResolver, IsolateDatafeedAction.Request::new, IsolateDatafeedAction.Response::new,
|
||||
IsolateDatafeedAction.Request::new, IsolateDatafeedAction.Response::new,
|
||||
MachineLearning.UTILITY_THREAD_POOL_NAME);
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,6 @@ import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.tasks.BaseTasksResponse;
|
||||
import org.elasticsearch.action.support.tasks.TransportTasksAction;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -42,10 +41,10 @@ public abstract class TransportJobTaskAction<Request extends JobTaskRequest<Requ
|
||||
|
||||
TransportJobTaskAction(Settings settings, String actionName, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver, Supplier<Request> requestSupplier,
|
||||
Supplier<Request> requestSupplier,
|
||||
Supplier<Response> responseSupplier, String nodeExecutor, AutodetectProcessManager processManager) {
|
||||
super(settings, actionName, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
requestSupplier, responseSupplier, nodeExecutor);
|
||||
super(settings, actionName, threadPool, clusterService, transportService, actionFilters,
|
||||
requestSupplier, responseSupplier, nodeExecutor);
|
||||
this.processManager = processManager;
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,6 @@ import org.elasticsearch.ElasticsearchException;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
@ -37,10 +36,9 @@ public class TransportKillProcessAction extends TransportJobTaskAction<KillProce
|
||||
@Inject
|
||||
public TransportKillProcessAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
ClusterService clusterService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
AutodetectProcessManager processManager, Auditor auditor) {
|
||||
super(settings, KillProcessAction.NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
KillProcessAction.Request::new, KillProcessAction.Response::new, MachineLearning.UTILITY_THREAD_POOL_NAME, processManager);
|
||||
super(settings, KillProcessAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
KillProcessAction.Request::new, KillProcessAction.Response::new, MachineLearning.UTILITY_THREAD_POOL_NAME, processManager);
|
||||
this.auditor = auditor;
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,6 @@ package org.elasticsearch.xpack.ml.action;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -24,6 +23,7 @@ import org.elasticsearch.xpack.core.ml.job.config.Job;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class TransportMlInfoAction extends HandledTransportAction<MlInfoAction.Request, MlInfoAction.Response> {
|
||||
|
||||
@ -31,10 +31,9 @@ public class TransportMlInfoAction extends HandledTransportAction<MlInfoAction.R
|
||||
|
||||
@Inject
|
||||
public TransportMlInfoAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
ClusterService clusterService) {
|
||||
super(settings, MlInfoAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver,
|
||||
MlInfoAction.Request::new);
|
||||
ActionFilters actionFilters, ClusterService clusterService) {
|
||||
super(settings, MlInfoAction.NAME, threadPool, transportService, actionFilters,
|
||||
(Supplier<MlInfoAction.Request>) MlInfoAction.Request::new);
|
||||
this.clusterService = clusterService;
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,6 @@ import org.elasticsearch.ElasticsearchException;
|
||||
import org.elasticsearch.Version;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
@ -31,11 +30,9 @@ public class TransportPersistJobAction extends TransportJobTaskAction<PersistJob
|
||||
|
||||
@Inject
|
||||
public TransportPersistJobAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
ClusterService clusterService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
AutodetectProcessManager processManager) {
|
||||
super(settings, PersistJobAction.NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
PersistJobAction.Request::new, PersistJobAction.Response::new, ThreadPool.Names.SAME, processManager);
|
||||
ClusterService clusterService, ActionFilters actionFilters, AutodetectProcessManager processManager) {
|
||||
super(settings, PersistJobAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
PersistJobAction.Request::new, PersistJobAction.Response::new, ThreadPool.Names.SAME, processManager);
|
||||
// ThreadPool.Names.SAME, because operations is executed by autodetect worker thread
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,6 @@ import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.action.support.WriteRequest;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
@ -45,12 +44,10 @@ public class TransportPostCalendarEventsAction extends HandledTransportAction<Po
|
||||
private final JobManager jobManager;
|
||||
|
||||
@Inject
|
||||
public TransportPostCalendarEventsAction(Settings settings, ThreadPool threadPool,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Client client, JobProvider jobProvider, JobManager jobManager) {
|
||||
public TransportPostCalendarEventsAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, Client client, JobProvider jobProvider, JobManager jobManager) {
|
||||
super(settings, PostCalendarEventsAction.NAME, threadPool, transportService, actionFilters,
|
||||
indexNameExpressionResolver, PostCalendarEventsAction.Request::new);
|
||||
PostCalendarEventsAction.Request::new);
|
||||
this.client = client;
|
||||
this.jobProvider = jobProvider;
|
||||
this.jobManager = jobManager;
|
||||
|
@ -7,7 +7,6 @@ package org.elasticsearch.xpack.ml.action;
|
||||
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
@ -30,10 +29,9 @@ public class TransportPostDataAction extends TransportJobTaskAction<PostDataActi
|
||||
@Inject
|
||||
public TransportPostDataAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
ClusterService clusterService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver, AutodetectProcessManager processManager,
|
||||
AnalysisRegistry analysisRegistry) {
|
||||
super(settings, PostDataAction.NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
PostDataAction.Request::new, PostDataAction.Response::new, ThreadPool.Names.SAME, processManager);
|
||||
AutodetectProcessManager processManager, AnalysisRegistry analysisRegistry) {
|
||||
super(settings, PostDataAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
PostDataAction.Request::new, PostDataAction.Response::new, ThreadPool.Names.SAME, processManager);
|
||||
// ThreadPool.Names.SAME, because operations is executed by autodetect worker thread
|
||||
this.analysisRegistry = analysisRegistry;
|
||||
}
|
||||
|
@ -9,7 +9,6 @@ import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.bytes.BytesArray;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
@ -32,6 +31,7 @@ import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class TransportPreviewDatafeedAction extends HandledTransportAction<PreviewDatafeedAction.Request, PreviewDatafeedAction.Response> {
|
||||
@ -41,10 +41,9 @@ public class TransportPreviewDatafeedAction extends HandledTransportAction<Previ
|
||||
|
||||
@Inject
|
||||
public TransportPreviewDatafeedAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Client client, ClusterService clusterService) {
|
||||
super(settings, PreviewDatafeedAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver,
|
||||
PreviewDatafeedAction.Request::new);
|
||||
ActionFilters actionFilters, Client client, ClusterService clusterService) {
|
||||
super(settings, PreviewDatafeedAction.NAME, threadPool, transportService, actionFilters,
|
||||
(Supplier<PreviewDatafeedAction.Request>) PreviewDatafeedAction.Request::new);
|
||||
this.client = client;
|
||||
this.clusterService = clusterService;
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.action.support.WriteRequest;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
@ -30,6 +29,7 @@ import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static org.elasticsearch.xpack.core.ClientHelper.ML_ORIGIN;
|
||||
import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin;
|
||||
@ -39,12 +39,10 @@ public class TransportPutCalendarAction extends HandledTransportAction<PutCalend
|
||||
private final Client client;
|
||||
|
||||
@Inject
|
||||
public TransportPutCalendarAction(Settings settings, ThreadPool threadPool,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Client client) {
|
||||
public TransportPutCalendarAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, Client client) {
|
||||
super(settings, PutCalendarAction.NAME, threadPool, transportService, actionFilters,
|
||||
indexNameExpressionResolver, PutCalendarAction.Request::new);
|
||||
(Supplier<PutCalendarAction.Request>) PutCalendarAction.Request::new);
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,6 @@ import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.action.support.WriteRequest;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
@ -30,6 +29,7 @@ import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static org.elasticsearch.xpack.core.ClientHelper.ML_ORIGIN;
|
||||
import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin;
|
||||
@ -42,10 +42,9 @@ public class TransportPutFilterAction extends HandledTransportAction<PutFilterAc
|
||||
@Inject
|
||||
public TransportPutFilterAction(Settings settings, ThreadPool threadPool,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Client client, JobManager jobManager) {
|
||||
super(settings, PutFilterAction.NAME, threadPool, transportService, actionFilters,
|
||||
indexNameExpressionResolver, PutFilterAction.Request::new);
|
||||
(Supplier<PutFilterAction.Request>) PutFilterAction.Request::new);
|
||||
this.client = client;
|
||||
this.jobManager = jobManager;
|
||||
}
|
||||
|
@ -14,7 +14,6 @@ import org.elasticsearch.action.TaskOperationFailure;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.tasks.TransportTasksAction;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNodes;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
@ -53,11 +52,10 @@ public class TransportStopDatafeedAction extends TransportTasksAction<TransportS
|
||||
|
||||
@Inject
|
||||
public TransportStopDatafeedAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
ClusterService clusterService, PersistentTasksService persistentTasksService) {
|
||||
ActionFilters actionFilters, ClusterService clusterService,
|
||||
PersistentTasksService persistentTasksService) {
|
||||
super(settings, StopDatafeedAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
indexNameExpressionResolver, StopDatafeedAction.Request::new, StopDatafeedAction.Response::new,
|
||||
MachineLearning.UTILITY_THREAD_POOL_NAME);
|
||||
StopDatafeedAction.Request::new, StopDatafeedAction.Response::new, MachineLearning.UTILITY_THREAD_POOL_NAME);
|
||||
this.persistentTasksService = persistentTasksService;
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,6 @@ package org.elasticsearch.xpack.ml.action;
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -27,12 +26,9 @@ public class TransportUpdateCalendarJobAction extends HandledTransportAction<Upd
|
||||
private final JobManager jobManager;
|
||||
|
||||
@Inject
|
||||
public TransportUpdateCalendarJobAction(Settings settings, ThreadPool threadPool,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
JobProvider jobProvider, JobManager jobManager) {
|
||||
super(settings, UpdateCalendarJobAction.NAME, threadPool, transportService, actionFilters,
|
||||
indexNameExpressionResolver, UpdateCalendarJobAction.Request::new);
|
||||
public TransportUpdateCalendarJobAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, JobProvider jobProvider, JobManager jobManager) {
|
||||
super(settings, UpdateCalendarJobAction.NAME, threadPool, transportService, actionFilters, UpdateCalendarJobAction.Request::new);
|
||||
this.jobProvider = jobProvider;
|
||||
this.jobManager = jobManager;
|
||||
}
|
||||
|
@ -15,7 +15,6 @@ import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.action.support.WriteRequest;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
@ -44,10 +43,9 @@ public class TransportUpdateModelSnapshotAction extends HandledTransportAction<U
|
||||
|
||||
@Inject
|
||||
public TransportUpdateModelSnapshotAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
JobProvider jobProvider, Client client) {
|
||||
super(settings, UpdateModelSnapshotAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver,
|
||||
UpdateModelSnapshotAction.Request::new);
|
||||
ActionFilters actionFilters, JobProvider jobProvider, Client client) {
|
||||
super(settings, UpdateModelSnapshotAction.NAME, threadPool, transportService, actionFilters,
|
||||
UpdateModelSnapshotAction.Request::new);
|
||||
this.jobProvider = jobProvider;
|
||||
this.client = client;
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ package org.elasticsearch.xpack.ml.action;
|
||||
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
@ -25,10 +24,9 @@ public class TransportUpdateProcessAction extends TransportJobTaskAction<UpdateP
|
||||
@Inject
|
||||
public TransportUpdateProcessAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
ClusterService clusterService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
AutodetectProcessManager processManager) {
|
||||
super(settings, UpdateProcessAction.NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
UpdateProcessAction.Request::new, UpdateProcessAction.Response::new, ThreadPool.Names.SAME, processManager);
|
||||
super(settings, UpdateProcessAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
UpdateProcessAction.Request::new, UpdateProcessAction.Response::new, ThreadPool.Names.SAME, processManager);
|
||||
// ThreadPool.Names.SAME, because operations is executed by autodetect worker thread
|
||||
}
|
||||
|
||||
|
@ -5,10 +5,11 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.action;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
@ -20,9 +21,9 @@ public class TransportValidateDetectorAction extends HandledTransportAction<Vali
|
||||
|
||||
@Inject
|
||||
public TransportValidateDetectorAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, ValidateDetectorAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver,
|
||||
ValidateDetectorAction.Request::new);
|
||||
ActionFilters actionFilters) {
|
||||
super(settings, ValidateDetectorAction.NAME, threadPool, transportService, actionFilters,
|
||||
(Supplier<ValidateDetectorAction.Request>) ValidateDetectorAction.Request::new);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -5,10 +5,11 @@
|
||||
*/
|
||||
package org.elasticsearch.xpack.ml.action;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
@ -20,9 +21,9 @@ public class TransportValidateJobConfigAction extends HandledTransportAction<Val
|
||||
|
||||
@Inject
|
||||
public TransportValidateJobConfigAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, ValidateJobConfigAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver,
|
||||
ValidateJobConfigAction.Request::new);
|
||||
ActionFilters actionFilters) {
|
||||
super(settings, ValidateJobConfigAction.NAME, threadPool, transportService, actionFilters,
|
||||
(Supplier< ValidateJobConfigAction.Request>) ValidateJobConfigAction.Request::new);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -12,7 +12,6 @@ import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.metadata.MetaData;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
@ -265,7 +264,7 @@ public class TransportCloseJobActionTests extends ESTestCase {
|
||||
when(clusterService.state()).thenReturn(clusterState);
|
||||
|
||||
TransportCloseJobAction transportAction = new TransportCloseJobAction(Settings.EMPTY,
|
||||
mock(TransportService.class), mock(ThreadPool.class), mock(ActionFilters.class), mock(IndexNameExpressionResolver.class),
|
||||
mock(TransportService.class), mock(ThreadPool.class), mock(ActionFilters.class),
|
||||
clusterService, mock(Client.class), mock(Auditor.class), mock(PersistentTasksService.class));
|
||||
|
||||
AtomicBoolean gotResponse = new AtomicBoolean(false);
|
||||
|
@ -10,7 +10,6 @@ import org.elasticsearch.action.ActionRunnable;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.cluster.block.ClusterBlockLevel;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.bytes.BytesReference;
|
||||
@ -41,11 +40,9 @@ public class TransportMonitoringBulkAction extends HandledTransportAction<Monito
|
||||
|
||||
@Inject
|
||||
public TransportMonitoringBulkAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver, Exporters exportService,
|
||||
TransportService transportService, ActionFilters actionFilters, Exporters exportService,
|
||||
MonitoringService monitoringService) {
|
||||
super(settings, MonitoringBulkAction.NAME, threadPool, transportService, actionFilters, indexNameExpressionResolver,
|
||||
MonitoringBulkRequest::new);
|
||||
super(settings, MonitoringBulkAction.NAME, threadPool, transportService, actionFilters, MonitoringBulkRequest::new);
|
||||
this.clusterService = clusterService;
|
||||
this.exportService = exportService;
|
||||
this.monitoringService = monitoringService;
|
||||
|
@ -15,7 +15,6 @@ import org.elasticsearch.cluster.ClusterName;
|
||||
import org.elasticsearch.cluster.ClusterState;
|
||||
import org.elasticsearch.cluster.block.ClusterBlockException;
|
||||
import org.elasticsearch.cluster.block.ClusterBlocks;
|
||||
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
||||
import org.elasticsearch.cluster.metadata.MetaData;
|
||||
import org.elasticsearch.cluster.node.DiscoveryNode;
|
||||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
@ -83,7 +82,6 @@ public class TransportMonitoringBulkActionTests extends ESTestCase {
|
||||
private ClusterService clusterService;
|
||||
private TransportService transportService;
|
||||
private ActionFilters filters;
|
||||
private IndexNameExpressionResolver resolver;
|
||||
private final MonitoringService monitoringService = mock(MonitoringService.class);
|
||||
|
||||
@Before
|
||||
@ -98,7 +96,6 @@ public class TransportMonitoringBulkActionTests extends ESTestCase {
|
||||
clusterService = mock(ClusterService.class);
|
||||
transportService = mock(TransportService.class);
|
||||
filters = mock(ActionFilters.class);
|
||||
resolver = mock(IndexNameExpressionResolver.class);
|
||||
|
||||
when(transportService.getTaskManager()).thenReturn(taskManager);
|
||||
when(taskManager.register(anyString(), eq(MonitoringBulkAction.NAME), any(TaskAwareRequest.class))).thenReturn(null);
|
||||
@ -117,7 +114,7 @@ public class TransportMonitoringBulkActionTests extends ESTestCase {
|
||||
when(clusterService.state()).thenReturn(ClusterState.builder(ClusterName.DEFAULT).blocks(clusterBlock).build());
|
||||
|
||||
final TransportMonitoringBulkAction action = new TransportMonitoringBulkAction(Settings.EMPTY, threadPool, clusterService,
|
||||
transportService, filters, resolver, exporters,
|
||||
transportService, filters, exporters,
|
||||
monitoringService);
|
||||
|
||||
final MonitoringBulkRequest request = randomRequest();
|
||||
@ -131,7 +128,7 @@ public class TransportMonitoringBulkActionTests extends ESTestCase {
|
||||
when(monitoringService.isMonitoringActive()).thenReturn(false);
|
||||
|
||||
final TransportMonitoringBulkAction action = new TransportMonitoringBulkAction(Settings.EMPTY, threadPool, clusterService,
|
||||
transportService, filters, resolver, exporters,
|
||||
transportService, filters, exporters,
|
||||
monitoringService);
|
||||
|
||||
final MonitoringBulkDoc doc = mock(MonitoringBulkDoc.class);
|
||||
@ -153,7 +150,7 @@ public class TransportMonitoringBulkActionTests extends ESTestCase {
|
||||
when(monitoringService.isMonitoringActive()).thenReturn(randomBoolean());
|
||||
|
||||
final TransportMonitoringBulkAction action = new TransportMonitoringBulkAction(Settings.EMPTY, threadPool, clusterService,
|
||||
transportService, filters, resolver, exporters,
|
||||
transportService, filters, exporters,
|
||||
monitoringService);
|
||||
|
||||
final MonitoringBulkRequest request = new MonitoringBulkRequest();
|
||||
@ -218,7 +215,7 @@ public class TransportMonitoringBulkActionTests extends ESTestCase {
|
||||
}).when(exporters).export(any(Collection.class), any(ActionListener.class));
|
||||
|
||||
final TransportMonitoringBulkAction action = new TransportMonitoringBulkAction(Settings.EMPTY, threadPool, clusterService,
|
||||
transportService, filters, resolver, exporters,
|
||||
transportService, filters, exporters,
|
||||
monitoringService);
|
||||
ActionTestUtils.executeBlocking(action, request);
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user