Core: Remove ThreadPool from base TransportAction (#31492)
Most transport actions don't need the node ThreadPool. This commit removes the ThreadPool as a super constructor parameter for TransportAction. The actions that do need the thread pool then have a member added to keep it from their own constructor.
This commit is contained in:
parent
60204af0cb
commit
4f9332ee16
|
@ -19,8 +19,8 @@
|
|||
package org.elasticsearch.plugin.noop.action.bulk;
|
||||
|
||||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.DocWriteResponse;
|
||||
import org.elasticsearch.action.DocWriteRequest;
|
||||
import org.elasticsearch.action.DocWriteResponse;
|
||||
import org.elasticsearch.action.bulk.BulkItemResponse;
|
||||
import org.elasticsearch.action.bulk.BulkRequest;
|
||||
import org.elasticsearch.action.bulk.BulkResponse;
|
||||
|
@ -30,7 +30,6 @@ import org.elasticsearch.action.update.UpdateResponse;
|
|||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
public class TransportNoopBulkAction extends HandledTransportAction<BulkRequest, BulkResponse> {
|
||||
|
@ -38,9 +37,8 @@ public class TransportNoopBulkAction extends HandledTransportAction<BulkRequest,
|
|||
new UpdateResponse(new ShardId("mock", "", 1), "mock_type", "1", 1L, DocWriteResponse.Result.CREATED));
|
||||
|
||||
@Inject
|
||||
public TransportNoopBulkAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters) {
|
||||
super(settings, NoopBulkAction.NAME, threadPool, transportService, actionFilters, BulkRequest::new);
|
||||
public TransportNoopBulkAction(Settings settings, TransportService transportService, ActionFilters actionFilters) {
|
||||
super(settings, NoopBulkAction.NAME, transportService, actionFilters, BulkRequest::new);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -27,23 +27,20 @@ import org.elasticsearch.action.support.HandledTransportAction;
|
|||
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;
|
||||
import org.elasticsearch.search.SearchHits;
|
||||
import org.elasticsearch.search.aggregations.InternalAggregations;
|
||||
import org.elasticsearch.search.internal.InternalSearchResponse;
|
||||
import org.elasticsearch.search.profile.SearchProfileShardResults;
|
||||
import org.elasticsearch.search.suggest.Suggest;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
public class TransportNoopSearchAction extends HandledTransportAction<SearchRequest, SearchResponse> {
|
||||
@Inject
|
||||
public TransportNoopSearchAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters) {
|
||||
super(settings, NoopSearchAction.NAME, threadPool, transportService, actionFilters,
|
||||
(Writeable.Reader<SearchRequest>) SearchRequest::new);
|
||||
public TransportNoopSearchAction(Settings settings, TransportService transportService, ActionFilters actionFilters) {
|
||||
super(settings, NoopSearchAction.NAME, transportService, actionFilters, (Writeable.Reader<SearchRequest>) SearchRequest::new);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -41,7 +41,6 @@ import org.elasticsearch.rest.RestController;
|
|||
import org.elasticsearch.rest.RestRequest;
|
||||
import org.elasticsearch.rest.RestResponse;
|
||||
import org.elasticsearch.rest.action.RestBuilderListener;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -114,9 +113,8 @@ public class GrokProcessorGetAction extends Action<GrokProcessorGetAction.Respon
|
|||
public static class TransportAction extends HandledTransportAction<Request, Response> {
|
||||
|
||||
@Inject
|
||||
public TransportAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters) {
|
||||
super(settings, NAME, threadPool, transportService, actionFilters, Request::new);
|
||||
public TransportAction(Settings settings, TransportService transportService, ActionFilters actionFilters) {
|
||||
super(settings, NAME, transportService, actionFilters, Request::new);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -30,7 +30,6 @@ import org.elasticsearch.common.inject.Inject;
|
|||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -45,10 +44,10 @@ public class TransportMultiSearchTemplateAction extends HandledTransportAction<M
|
|||
private final NodeClient client;
|
||||
|
||||
@Inject
|
||||
public TransportMultiSearchTemplateAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
public TransportMultiSearchTemplateAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, ScriptService scriptService,
|
||||
NamedXContentRegistry xContentRegistry, NodeClient client) {
|
||||
super(settings, MultiSearchTemplateAction.NAME, threadPool, transportService, actionFilters, MultiSearchTemplateRequest::new);
|
||||
super(settings, MultiSearchTemplateAction.NAME, transportService, actionFilters, MultiSearchTemplateRequest::new);
|
||||
this.scriptService = scriptService;
|
||||
this.xContentRegistry = xContentRegistry;
|
||||
this.client = client;
|
||||
|
|
|
@ -38,7 +38,6 @@ import org.elasticsearch.script.ScriptService;
|
|||
import org.elasticsearch.script.ScriptType;
|
||||
import org.elasticsearch.script.TemplateScript;
|
||||
import org.elasticsearch.search.builder.SearchSourceBuilder;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -54,11 +53,10 @@ public class TransportSearchTemplateAction extends HandledTransportAction<Search
|
|||
private final NodeClient client;
|
||||
|
||||
@Inject
|
||||
public TransportSearchTemplateAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, ScriptService scriptService, NamedXContentRegistry xContentRegistry,
|
||||
NodeClient client) {
|
||||
super(settings, SearchTemplateAction.NAME, threadPool, transportService, actionFilters,
|
||||
(Supplier<SearchTemplateRequest>) SearchTemplateRequest::new);
|
||||
public TransportSearchTemplateAction(Settings settings, TransportService transportService, ActionFilters actionFilters,
|
||||
ScriptService scriptService, NamedXContentRegistry xContentRegistry, NodeClient client) {
|
||||
super(settings, SearchTemplateAction.NAME, transportService, actionFilters,
|
||||
(Supplier<SearchTemplateRequest>) SearchTemplateRequest::new);
|
||||
this.scriptService = scriptService;
|
||||
this.xContentRegistry = xContentRegistry;
|
||||
this.client = client;
|
||||
|
|
|
@ -48,7 +48,6 @@ import org.elasticsearch.script.Script;
|
|||
import org.elasticsearch.script.ScriptContext;
|
||||
import org.elasticsearch.script.ScriptService;
|
||||
import org.elasticsearch.script.ScriptType;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -280,9 +279,9 @@ public class PainlessExecuteAction extends Action<PainlessExecuteAction.Response
|
|||
private final ScriptService scriptService;
|
||||
|
||||
@Inject
|
||||
public TransportAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
public TransportAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, ScriptService scriptService) {
|
||||
super(settings, NAME, threadPool, transportService, actionFilters, Request::new);
|
||||
super(settings, NAME, transportService, actionFilters, Request::new);
|
||||
this.scriptService = scriptService;
|
||||
}
|
||||
@Override
|
||||
|
|
|
@ -40,7 +40,6 @@ import org.elasticsearch.script.ScriptService;
|
|||
import org.elasticsearch.script.TemplateScript;
|
||||
import org.elasticsearch.search.SearchHit;
|
||||
import org.elasticsearch.search.builder.SearchSourceBuilder;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -73,10 +72,10 @@ public class TransportRankEvalAction extends HandledTransportAction<RankEvalRequ
|
|||
private final NamedXContentRegistry namedXContentRegistry;
|
||||
|
||||
@Inject
|
||||
public TransportRankEvalAction(Settings settings, ThreadPool threadPool, ActionFilters actionFilters, Client client,
|
||||
public TransportRankEvalAction(Settings settings, ActionFilters actionFilters, Client client,
|
||||
TransportService transportService, ScriptService scriptService,
|
||||
NamedXContentRegistry namedXContentRegistry) {
|
||||
super(settings, RankEvalAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, RankEvalAction.NAME, transportService, actionFilters,
|
||||
(Writeable.Reader<RankEvalRequest>) RankEvalRequest::new);
|
||||
this.scriptService = scriptService;
|
||||
this.namedXContentRegistry = namedXContentRegistry;
|
||||
|
|
|
@ -19,8 +19,6 @@
|
|||
|
||||
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;
|
||||
|
@ -35,7 +33,11 @@ import org.elasticsearch.tasks.Task;
|
|||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class TransportDeleteByQueryAction extends HandledTransportAction<DeleteByQueryRequest, BulkByScrollResponse> {
|
||||
|
||||
private final ThreadPool threadPool;
|
||||
private final Client client;
|
||||
private final ScriptService scriptService;
|
||||
private final ClusterService clusterService;
|
||||
|
@ -43,8 +45,9 @@ public class TransportDeleteByQueryAction extends HandledTransportAction<DeleteB
|
|||
@Inject
|
||||
public TransportDeleteByQueryAction(Settings settings, ThreadPool threadPool, ActionFilters actionFilters, Client client,
|
||||
TransportService transportService, ScriptService scriptService, ClusterService clusterService) {
|
||||
super(settings, DeleteByQueryAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, DeleteByQueryAction.NAME, transportService, actionFilters,
|
||||
(Supplier<DeleteByQueryRequest>) DeleteByQueryRequest::new);
|
||||
this.threadPool = threadPool;
|
||||
this.client = client;
|
||||
this.scriptService = scriptService;
|
||||
this.clusterService = clusterService;
|
||||
|
|
|
@ -92,6 +92,7 @@ public class TransportReindexAction extends HandledTransportAction<ReindexReques
|
|||
public static final Setting<List<String>> REMOTE_CLUSTER_WHITELIST =
|
||||
Setting.listSetting("reindex.remote.whitelist", emptyList(), Function.identity(), Property.NodeScope);
|
||||
|
||||
private final ThreadPool threadPool;
|
||||
private final ClusterService clusterService;
|
||||
private final ScriptService scriptService;
|
||||
private final AutoCreateIndex autoCreateIndex;
|
||||
|
@ -103,8 +104,8 @@ public class TransportReindexAction extends HandledTransportAction<ReindexReques
|
|||
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,
|
||||
ReindexRequest::new);
|
||||
super(settings, ReindexAction.NAME, transportService, actionFilters, ReindexRequest::new);
|
||||
this.threadPool = threadPool;
|
||||
this.clusterService = clusterService;
|
||||
this.scriptService = scriptService;
|
||||
this.autoCreateIndex = autoCreateIndex;
|
||||
|
|
|
@ -43,9 +43,9 @@ public class TransportRethrottleAction extends TransportTasksAction<BulkByScroll
|
|||
private final Client client;
|
||||
|
||||
@Inject
|
||||
public TransportRethrottleAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
public TransportRethrottleAction(Settings settings, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters, Client client) {
|
||||
super(settings, RethrottleAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
super(settings, RethrottleAction.NAME, clusterService, transportService, actionFilters,
|
||||
RethrottleRequest::new, ListTasksResponse::new, ThreadPool.Names.MANAGEMENT);
|
||||
this.client = client;
|
||||
}
|
||||
|
|
|
@ -46,6 +46,8 @@ import java.util.function.BiFunction;
|
|||
import java.util.function.Supplier;
|
||||
|
||||
public class TransportUpdateByQueryAction extends HandledTransportAction<UpdateByQueryRequest, BulkByScrollResponse> {
|
||||
|
||||
private final ThreadPool threadPool;
|
||||
private final Client client;
|
||||
private final ScriptService scriptService;
|
||||
private final ClusterService clusterService;
|
||||
|
@ -53,8 +55,9 @@ public class TransportUpdateByQueryAction extends HandledTransportAction<UpdateB
|
|||
@Inject
|
||||
public TransportUpdateByQueryAction(Settings settings, ThreadPool threadPool, ActionFilters actionFilters, Client client,
|
||||
TransportService transportService, ScriptService scriptService, ClusterService clusterService) {
|
||||
super(settings, UpdateByQueryAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, UpdateByQueryAction.NAME, transportService, actionFilters,
|
||||
(Supplier<UpdateByQueryRequest>) UpdateByQueryRequest::new);
|
||||
this.threadPool = threadPool;
|
||||
this.client = client;
|
||||
this.scriptService = scriptService;
|
||||
this.clusterService = clusterService;
|
||||
|
|
|
@ -62,9 +62,9 @@ public class TransportCancelTasksAction extends TransportTasksAction<Cancellable
|
|||
public static final String BAN_PARENT_ACTION_NAME = "internal:admin/tasks/ban";
|
||||
|
||||
@Inject
|
||||
public TransportCancelTasksAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
public TransportCancelTasksAction(Settings settings, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters) {
|
||||
super(settings, CancelTasksAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
super(settings, CancelTasksAction.NAME, clusterService, transportService, actionFilters,
|
||||
CancelTasksRequest::new, CancelTasksResponse::new, ThreadPool.Names.MANAGEMENT);
|
||||
transportService.registerRequestHandler(BAN_PARENT_ACTION_NAME, BanParentTaskRequest::new, ThreadPool.Names.SAME, new
|
||||
BanParentRequestHandler());
|
||||
|
|
|
@ -64,6 +64,7 @@ import static org.elasticsearch.action.admin.cluster.node.tasks.list.TransportLi
|
|||
* </ul>
|
||||
*/
|
||||
public class TransportGetTaskAction extends HandledTransportAction<GetTaskRequest, GetTaskResponse> {
|
||||
private final ThreadPool threadPool;
|
||||
private final ClusterService clusterService;
|
||||
private final TransportService transportService;
|
||||
private final Client client;
|
||||
|
@ -72,7 +73,8 @@ public class TransportGetTaskAction extends HandledTransportAction<GetTaskReques
|
|||
@Inject
|
||||
public TransportGetTaskAction(Settings settings, ThreadPool threadPool, TransportService transportService, ActionFilters actionFilters,
|
||||
ClusterService clusterService, Client client, NamedXContentRegistry xContentRegistry) {
|
||||
super(settings, GetTaskAction.NAME, threadPool, transportService, actionFilters, GetTaskRequest::new);
|
||||
super(settings, GetTaskAction.NAME, transportService, actionFilters, GetTaskRequest::new);
|
||||
this.threadPool = threadPool;
|
||||
this.clusterService = clusterService;
|
||||
this.transportService = transportService;
|
||||
this.client = client;
|
||||
|
|
|
@ -51,9 +51,9 @@ public class TransportListTasksAction extends TransportTasksAction<Task, ListTas
|
|||
private static final TimeValue DEFAULT_WAIT_FOR_COMPLETION_TIMEOUT = timeValueSeconds(30);
|
||||
|
||||
@Inject
|
||||
public TransportListTasksAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
public TransportListTasksAction(Settings settings, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters) {
|
||||
super(settings, ListTasksAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
super(settings, ListTasksAction.NAME, clusterService, transportService, actionFilters,
|
||||
ListTasksRequest::new, ListTasksResponse::new, ThreadPool.Names.MANAGEMENT);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,6 @@ import org.elasticsearch.action.support.ActionFilters;
|
|||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import static java.util.stream.Collectors.toList;
|
||||
|
@ -38,9 +37,9 @@ public final class TransportRemoteInfoAction extends HandledTransportAction<Remo
|
|||
private final RemoteClusterService remoteClusterService;
|
||||
|
||||
@Inject
|
||||
public TransportRemoteInfoAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
public TransportRemoteInfoAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, SearchTransportService searchTransportService) {
|
||||
super(settings, RemoteInfoAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, RemoteInfoAction.NAME, transportService, actionFilters,
|
||||
(Supplier<RemoteInfoRequest>) RemoteInfoRequest::new);
|
||||
this.remoteClusterService = searchTransportService.getRemoteClusterService();
|
||||
}
|
||||
|
|
|
@ -49,10 +49,10 @@ public class TransportClearIndicesCacheAction extends TransportBroadcastByNodeAc
|
|||
private final IndicesService indicesService;
|
||||
|
||||
@Inject
|
||||
public TransportClearIndicesCacheAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
public TransportClearIndicesCacheAction(Settings settings, ClusterService clusterService,
|
||||
TransportService transportService, IndicesService indicesService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, ClearIndicesCacheAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
super(settings, ClearIndicesCacheAction.NAME, clusterService, transportService, actionFilters,
|
||||
indexNameExpressionResolver, ClearIndicesCacheRequest::new, ThreadPool.Names.MANAGEMENT, false);
|
||||
this.indicesService = indicesService;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@ import org.elasticsearch.cluster.service.ClusterService;
|
|||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -39,11 +38,10 @@ import java.util.List;
|
|||
public class TransportFlushAction extends TransportBroadcastReplicationAction<FlushRequest, FlushResponse, ShardFlushRequest, ReplicationResponse> {
|
||||
|
||||
@Inject
|
||||
public TransportFlushAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
public TransportFlushAction(Settings settings, ClusterService clusterService, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
TransportShardFlushAction replicatedFlushAction) {
|
||||
super(FlushAction.NAME, FlushRequest::new, settings, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver, replicatedFlushAction);
|
||||
super(FlushAction.NAME, FlushRequest::new, settings, clusterService, transportService, actionFilters, indexNameExpressionResolver, replicatedFlushAction);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -27,7 +27,6 @@ import org.elasticsearch.action.support.HandledTransportAction;
|
|||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.indices.flush.SyncedFlushService;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
/**
|
||||
|
@ -38,9 +37,9 @@ public class TransportSyncedFlushAction extends HandledTransportAction<SyncedFlu
|
|||
SyncedFlushService syncedFlushService;
|
||||
|
||||
@Inject
|
||||
public TransportSyncedFlushAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
public TransportSyncedFlushAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, SyncedFlushService syncedFlushService) {
|
||||
super(settings, SyncedFlushAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, SyncedFlushAction.NAME, transportService, actionFilters,
|
||||
(Supplier<SyncedFlushRequest>) SyncedFlushRequest::new);
|
||||
this.syncedFlushService = syncedFlushService;
|
||||
}
|
||||
|
|
|
@ -48,10 +48,10 @@ public class TransportForceMergeAction extends TransportBroadcastByNodeAction<Fo
|
|||
private final IndicesService indicesService;
|
||||
|
||||
@Inject
|
||||
public TransportForceMergeAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
public TransportForceMergeAction(Settings settings, ClusterService clusterService,
|
||||
TransportService transportService, IndicesService indicesService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, ForceMergeAction.NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
super(settings, ForceMergeAction.NAME, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
ForceMergeRequest::new, ThreadPool.Names.FORCE_MERGE);
|
||||
this.indicesService = indicesService;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,6 @@ import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
|
|||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -45,9 +44,9 @@ public class TransportGetFieldMappingsAction extends HandledTransportAction<GetF
|
|||
|
||||
@Inject
|
||||
public TransportGetFieldMappingsAction(Settings settings, TransportService transportService, ClusterService clusterService,
|
||||
ThreadPool threadPool, TransportGetFieldMappingsIndexAction shardAction,
|
||||
TransportGetFieldMappingsIndexAction shardAction,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, GetFieldMappingsAction.NAME, threadPool, transportService, actionFilters, GetFieldMappingsRequest::new);
|
||||
super(settings, GetFieldMappingsAction.NAME, transportService, actionFilters, GetFieldMappingsRequest::new);
|
||||
this.clusterService = clusterService;
|
||||
this.shardAction = shardAction;
|
||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||
|
|
|
@ -54,10 +54,10 @@ public class TransportRecoveryAction extends TransportBroadcastByNodeAction<Reco
|
|||
private final IndicesService indicesService;
|
||||
|
||||
@Inject
|
||||
public TransportRecoveryAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
public TransportRecoveryAction(Settings settings, ClusterService clusterService,
|
||||
TransportService transportService, IndicesService indicesService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, RecoveryAction.NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
super(settings, RecoveryAction.NAME, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
RecoveryRequest::new, ThreadPool.Names.MANAGEMENT);
|
||||
this.indicesService = indicesService;
|
||||
}
|
||||
|
|
|
@ -30,7 +30,6 @@ import org.elasticsearch.cluster.service.ClusterService;
|
|||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -41,11 +40,11 @@ import java.util.List;
|
|||
public class TransportRefreshAction extends TransportBroadcastReplicationAction<RefreshRequest, RefreshResponse, BasicReplicationRequest, ReplicationResponse> {
|
||||
|
||||
@Inject
|
||||
public TransportRefreshAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
public TransportRefreshAction(Settings settings, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
TransportShardRefreshAction shardRefreshAction) {
|
||||
super(RefreshAction.NAME, RefreshRequest::new, settings, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver, shardRefreshAction);
|
||||
super(RefreshAction.NAME, RefreshRequest::new, settings, clusterService, transportService, actionFilters, indexNameExpressionResolver, shardRefreshAction);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -46,9 +46,9 @@ public class TransportIndicesSegmentsAction extends TransportBroadcastByNodeActi
|
|||
private final IndicesService indicesService;
|
||||
|
||||
@Inject
|
||||
public TransportIndicesSegmentsAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService,
|
||||
public TransportIndicesSegmentsAction(Settings settings, ClusterService clusterService, TransportService transportService,
|
||||
IndicesService indicesService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, IndicesSegmentsAction.NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
super(settings, IndicesSegmentsAction.NAME, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
IndicesSegmentsRequest::new, ThreadPool.Names.MANAGEMENT);
|
||||
this.indicesService = indicesService;
|
||||
}
|
||||
|
|
|
@ -47,10 +47,10 @@ public class TransportIndicesStatsAction extends TransportBroadcastByNodeAction<
|
|||
private final IndicesService indicesService;
|
||||
|
||||
@Inject
|
||||
public TransportIndicesStatsAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
public TransportIndicesStatsAction(Settings settings, ClusterService clusterService,
|
||||
TransportService transportService, IndicesService indicesService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, IndicesStatsAction.NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
super(settings, IndicesStatsAction.NAME, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
IndicesStatsRequest::new, ThreadPool.Names.MANAGEMENT);
|
||||
this.indicesService = indicesService;
|
||||
}
|
||||
|
|
|
@ -48,9 +48,9 @@ public class TransportUpgradeStatusAction extends TransportBroadcastByNodeAction
|
|||
private final IndicesService indicesService;
|
||||
|
||||
@Inject
|
||||
public TransportUpgradeStatusAction(Settings settings, ThreadPool threadPool, ClusterService clusterService, TransportService transportService,
|
||||
public TransportUpgradeStatusAction(Settings settings, ClusterService clusterService, TransportService transportService,
|
||||
IndicesService indicesService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, UpgradeStatusAction.NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
super(settings, UpgradeStatusAction.NAME, clusterService, transportService, actionFilters, indexNameExpressionResolver,
|
||||
UpgradeStatusRequest::new, ThreadPool.Names.MANAGEMENT);
|
||||
this.indicesService = indicesService;
|
||||
}
|
||||
|
|
|
@ -62,10 +62,10 @@ public class TransportUpgradeAction extends TransportBroadcastByNodeAction<Upgra
|
|||
private final NodeClient client;
|
||||
|
||||
@Inject
|
||||
public TransportUpgradeAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
public TransportUpgradeAction(Settings settings, ClusterService clusterService,
|
||||
TransportService transportService, IndicesService indicesService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver, NodeClient client) {
|
||||
super(settings, UpgradeAction.NAME, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver, UpgradeRequest::new, ThreadPool.Names.FORCE_MERGE);
|
||||
super(settings, UpgradeAction.NAME, clusterService, transportService, actionFilters, indexNameExpressionResolver, UpgradeRequest::new, ThreadPool.Names.FORCE_MERGE);
|
||||
this.indicesService = indicesService;
|
||||
this.client = client;
|
||||
}
|
||||
|
|
|
@ -64,10 +64,10 @@ public class TransportValidateQueryAction extends TransportBroadcastAction<Valid
|
|||
private final SearchService searchService;
|
||||
|
||||
@Inject
|
||||
public TransportValidateQueryAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
public TransportValidateQueryAction(Settings settings, ClusterService clusterService,
|
||||
TransportService transportService, SearchService searchService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, ValidateQueryAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
super(settings, ValidateQueryAction.NAME, clusterService, transportService, actionFilters,
|
||||
indexNameExpressionResolver, ValidateQueryRequest::new, ShardValidateQueryRequest::new, ThreadPool.Names.SEARCH);
|
||||
this.searchService = searchService;
|
||||
}
|
||||
|
|
|
@ -84,6 +84,7 @@ import static java.util.Collections.emptyMap;
|
|||
*/
|
||||
public class TransportBulkAction extends HandledTransportAction<BulkRequest, BulkResponse> {
|
||||
|
||||
private final ThreadPool threadPool;
|
||||
private final AutoCreateIndex autoCreateIndex;
|
||||
private final ClusterService clusterService;
|
||||
private final IngestService ingestService;
|
||||
|
@ -108,8 +109,9 @@ public class TransportBulkAction extends HandledTransportAction<BulkRequest, Bul
|
|||
TransportShardBulkAction shardBulkAction, NodeClient client,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
AutoCreateIndex autoCreateIndex, LongSupplier relativeTimeProvider) {
|
||||
super(settings, BulkAction.NAME, threadPool, transportService, actionFilters, BulkRequest::new);
|
||||
super(settings, BulkAction.NAME, transportService, actionFilters, BulkRequest::new);
|
||||
Objects.requireNonNull(relativeTimeProvider);
|
||||
this.threadPool = threadPool;
|
||||
this.clusterService = clusterService;
|
||||
this.ingestService = ingestService;
|
||||
this.shardBulkAction = shardBulkAction;
|
||||
|
|
|
@ -76,6 +76,7 @@ public class TransportShardBulkAction extends TransportWriteAction<BulkShardRequ
|
|||
|
||||
private static final Logger logger = ESLoggerFactory.getLogger(TransportShardBulkAction.class);
|
||||
|
||||
private final ThreadPool threadPool;
|
||||
private final UpdateHelper updateHelper;
|
||||
private final MappingUpdatedAction mappingUpdatedAction;
|
||||
|
||||
|
@ -86,6 +87,7 @@ public class TransportShardBulkAction extends TransportWriteAction<BulkShardRequ
|
|||
IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, ACTION_NAME, transportService, clusterService, indicesService, threadPool, shardStateAction, actionFilters,
|
||||
indexNameExpressionResolver, BulkShardRequest::new, BulkShardRequest::new, ThreadPool.Names.WRITE);
|
||||
this.threadPool = threadPool;
|
||||
this.updateHelper = updateHelper;
|
||||
this.mappingUpdatedAction = mappingUpdatedAction;
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
|
||||
public class TransportFieldCapabilitiesAction extends HandledTransportAction<FieldCapabilitiesRequest, FieldCapabilitiesResponse> {
|
||||
private final ThreadPool threadPool;
|
||||
private final ClusterService clusterService;
|
||||
private final TransportFieldCapabilitiesIndexAction shardAction;
|
||||
private final RemoteClusterService remoteClusterService;
|
||||
|
@ -53,7 +54,8 @@ public class TransportFieldCapabilitiesAction extends HandledTransportAction<Fie
|
|||
ClusterService clusterService, ThreadPool threadPool,
|
||||
TransportFieldCapabilitiesIndexAction shardAction,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, FieldCapabilitiesAction.NAME, threadPool, transportService, actionFilters, FieldCapabilitiesRequest::new);
|
||||
super(settings, FieldCapabilitiesAction.NAME, transportService, actionFilters, FieldCapabilitiesRequest::new);
|
||||
this.threadPool = threadPool;
|
||||
this.clusterService = clusterService;
|
||||
this.remoteClusterService = transportService.getRemoteClusterService();
|
||||
this.shardAction = shardAction;
|
||||
|
|
|
@ -30,7 +30,6 @@ import org.elasticsearch.common.inject.Inject;
|
|||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.util.concurrent.AtomicArray;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -44,10 +43,10 @@ public class TransportMultiGetAction extends HandledTransportAction<MultiGetRequ
|
|||
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||
|
||||
@Inject
|
||||
public TransportMultiGetAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
public TransportMultiGetAction(Settings settings, TransportService transportService,
|
||||
ClusterService clusterService, TransportShardMultiGetAction shardAction,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver resolver) {
|
||||
super(settings, MultiGetAction.NAME, threadPool, transportService, actionFilters, MultiGetRequest::new);
|
||||
super(settings, MultiGetAction.NAME, transportService, actionFilters, MultiGetRequest::new);
|
||||
this.clusterService = clusterService;
|
||||
this.shardAction = shardAction;
|
||||
this.indexNameExpressionResolver = resolver;
|
||||
|
|
|
@ -41,7 +41,7 @@ public class SimulatePipelineTransportAction extends HandledTransportAction<Simu
|
|||
@Inject
|
||||
public SimulatePipelineTransportAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, NodeService nodeService) {
|
||||
super(settings, SimulatePipelineAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, SimulatePipelineAction.NAME, transportService, actionFilters,
|
||||
(Writeable.Reader<SimulatePipelineRequest>) SimulatePipelineRequest::new);
|
||||
this.pipelineStore = nodeService.getIngestService().getPipelineStore();
|
||||
this.executionService = new SimulateExecutionService(threadPool);
|
||||
|
|
|
@ -30,7 +30,6 @@ import org.elasticsearch.common.inject.Inject;
|
|||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.node.Node;
|
||||
import org.elasticsearch.rest.RestStatus;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
public class TransportMainAction extends HandledTransportAction<MainRequest, MainResponse> {
|
||||
|
@ -38,9 +37,9 @@ public class TransportMainAction extends HandledTransportAction<MainRequest, Mai
|
|||
private final ClusterService clusterService;
|
||||
|
||||
@Inject
|
||||
public TransportMainAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
public TransportMainAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, ClusterService clusterService) {
|
||||
super(settings, MainAction.NAME, threadPool, transportService, actionFilters, MainRequest::new);
|
||||
super(settings, MainAction.NAME, transportService, actionFilters, MainRequest::new);
|
||||
this.clusterService = clusterService;
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@ import org.elasticsearch.action.support.HandledTransportAction;
|
|||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
public class TransportClearScrollAction extends HandledTransportAction<ClearScrollRequest, ClearScrollResponse> {
|
||||
|
@ -34,10 +33,10 @@ public class TransportClearScrollAction extends HandledTransportAction<ClearScro
|
|||
private final SearchTransportService searchTransportService;
|
||||
|
||||
@Inject
|
||||
public TransportClearScrollAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
public TransportClearScrollAction(Settings settings, TransportService transportService,
|
||||
ClusterService clusterService, ActionFilters actionFilters,
|
||||
SearchTransportService searchTransportService) {
|
||||
super(settings, ClearScrollAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, ClearScrollAction.NAME, transportService, actionFilters,
|
||||
ClearScrollRequest::new);
|
||||
this.clusterService = clusterService;
|
||||
this.searchTransportService = searchTransportService;
|
||||
|
|
|
@ -42,6 +42,7 @@ import java.util.function.LongSupplier;
|
|||
public class TransportMultiSearchAction extends HandledTransportAction<MultiSearchRequest, MultiSearchResponse> {
|
||||
|
||||
private final int availableProcessors;
|
||||
private final ThreadPool threadPool;
|
||||
private final ClusterService clusterService;
|
||||
private final LongSupplier relativeTimeProvider;
|
||||
private final NodeClient client;
|
||||
|
@ -49,7 +50,8 @@ public class TransportMultiSearchAction extends HandledTransportAction<MultiSear
|
|||
@Inject
|
||||
public TransportMultiSearchAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ClusterService clusterService, ActionFilters actionFilters, NodeClient client) {
|
||||
super(settings, MultiSearchAction.NAME, threadPool, transportService, actionFilters, MultiSearchRequest::new);
|
||||
super(settings, MultiSearchAction.NAME, transportService, actionFilters, MultiSearchRequest::new);
|
||||
this.threadPool = threadPool;
|
||||
this.clusterService = clusterService;
|
||||
this.availableProcessors = EsExecutors.numberOfProcessors(settings);
|
||||
this.relativeTimeProvider = System::nanoTime;
|
||||
|
@ -59,7 +61,8 @@ public class TransportMultiSearchAction extends HandledTransportAction<MultiSear
|
|||
TransportMultiSearchAction(ThreadPool threadPool, ActionFilters actionFilters, TransportService transportService,
|
||||
ClusterService clusterService, int availableProcessors,
|
||||
LongSupplier relativeTimeProvider, NodeClient client) {
|
||||
super(Settings.EMPTY, MultiSearchAction.NAME, threadPool, transportService, actionFilters, MultiSearchRequest::new);
|
||||
super(Settings.EMPTY, MultiSearchAction.NAME, transportService, actionFilters, MultiSearchRequest::new);
|
||||
this.threadPool = threadPool;
|
||||
this.clusterService = clusterService;
|
||||
this.availableProcessors = availableProcessors;
|
||||
this.relativeTimeProvider = relativeTimeProvider;
|
||||
|
|
|
@ -70,6 +70,7 @@ public class TransportSearchAction extends HandledTransportAction<SearchRequest,
|
|||
public static final Setting<Long> SHARD_COUNT_LIMIT_SETTING = Setting.longSetting(
|
||||
"action.search.shard_count.limit", Long.MAX_VALUE, 1L, Property.Dynamic, Property.NodeScope);
|
||||
|
||||
private final ThreadPool threadPool;
|
||||
private final ClusterService clusterService;
|
||||
private final SearchTransportService searchTransportService;
|
||||
private final RemoteClusterService remoteClusterService;
|
||||
|
@ -82,8 +83,8 @@ public class TransportSearchAction extends HandledTransportAction<SearchRequest,
|
|||
SearchTransportService searchTransportService, SearchPhaseController searchPhaseController,
|
||||
ClusterService clusterService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, SearchAction.NAME, threadPool, transportService, actionFilters,
|
||||
(Writeable.Reader<SearchRequest>) SearchRequest::new);
|
||||
super(settings, SearchAction.NAME, transportService, actionFilters, (Writeable.Reader<SearchRequest>) SearchRequest::new);
|
||||
this.threadPool = threadPool;
|
||||
this.searchPhaseController = searchPhaseController;
|
||||
this.searchTransportService = searchTransportService;
|
||||
this.remoteClusterService = searchTransportService.getRemoteClusterService();
|
||||
|
|
|
@ -27,7 +27,6 @@ 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;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import static org.elasticsearch.action.search.ParsedScrollId.QUERY_AND_FETCH_TYPE;
|
||||
|
@ -41,10 +40,10 @@ public class TransportSearchScrollAction extends HandledTransportAction<SearchSc
|
|||
private final SearchPhaseController searchPhaseController;
|
||||
|
||||
@Inject
|
||||
public TransportSearchScrollAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
public TransportSearchScrollAction(Settings settings, TransportService transportService,
|
||||
ClusterService clusterService, ActionFilters actionFilters,
|
||||
SearchTransportService searchTransportService, SearchPhaseController searchPhaseController) {
|
||||
super(settings, SearchScrollAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, SearchScrollAction.NAME, transportService, actionFilters,
|
||||
(Writeable.Reader<SearchScrollRequest>) SearchScrollRequest::new);
|
||||
this.clusterService = clusterService;
|
||||
this.searchTransportService = searchTransportService;
|
||||
|
|
|
@ -37,29 +37,27 @@ 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,
|
||||
Supplier<Request> request) {
|
||||
this(settings, actionName, true, threadPool, transportService, actionFilters, request);
|
||||
protected HandledTransportAction(Settings settings, String actionName, TransportService transportService,
|
||||
ActionFilters actionFilters, Supplier<Request> request) {
|
||||
this(settings, actionName, true, transportService, actionFilters, request);
|
||||
}
|
||||
|
||||
protected HandledTransportAction(Settings settings, String actionName, ThreadPool threadPool, TransportService transportService,
|
||||
protected HandledTransportAction(Settings settings, String actionName, TransportService transportService,
|
||||
ActionFilters actionFilters, Writeable.Reader<Request> requestReader) {
|
||||
this(settings, actionName, true, threadPool, transportService, actionFilters, requestReader);
|
||||
this(settings, actionName, true, transportService, actionFilters, requestReader);
|
||||
}
|
||||
|
||||
protected HandledTransportAction(Settings settings, String actionName, boolean canTripCircuitBreaker, ThreadPool threadPool,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
Supplier<Request> request) {
|
||||
super(settings, actionName, threadPool, actionFilters, transportService.getTaskManager());
|
||||
protected HandledTransportAction(Settings settings, String actionName, boolean canTripCircuitBreaker,
|
||||
TransportService transportService, ActionFilters actionFilters, Supplier<Request> request) {
|
||||
super(settings, actionName, actionFilters, transportService.getTaskManager());
|
||||
transportService.registerRequestHandler(actionName, request, ThreadPool.Names.SAME, false, canTripCircuitBreaker,
|
||||
new TransportHandler());
|
||||
}
|
||||
|
||||
protected HandledTransportAction(Settings settings, String actionName, boolean canTripCircuitBreaker, ThreadPool threadPool,
|
||||
protected HandledTransportAction(Settings settings, String actionName, boolean canTripCircuitBreaker,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
Writeable.Reader<Request> requestReader) {
|
||||
super(settings, actionName, threadPool, actionFilters, transportService.getTaskManager());
|
||||
super(settings, actionName, actionFilters, transportService.getTaskManager());
|
||||
transportService.registerRequestHandler(actionName, ThreadPool.Names.SAME, false, canTripCircuitBreaker, requestReader,
|
||||
new TransportHandler());
|
||||
}
|
||||
|
|
|
@ -29,21 +29,17 @@ import org.elasticsearch.common.settings.Settings;
|
|||
import org.elasticsearch.tasks.Task;
|
||||
import org.elasticsearch.tasks.TaskListener;
|
||||
import org.elasticsearch.tasks.TaskManager;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public abstract class TransportAction<Request extends ActionRequest, Response extends ActionResponse> extends AbstractComponent {
|
||||
|
||||
protected final ThreadPool threadPool;
|
||||
protected final String actionName;
|
||||
private final ActionFilter[] filters;
|
||||
protected final TaskManager taskManager;
|
||||
|
||||
protected TransportAction(Settings settings, String actionName, ThreadPool threadPool, ActionFilters actionFilters,
|
||||
TaskManager taskManager) {
|
||||
protected TransportAction(Settings settings, String actionName, ActionFilters actionFilters, TaskManager taskManager) {
|
||||
super(settings);
|
||||
this.threadPool = threadPool;
|
||||
this.actionName = actionName;
|
||||
this.filters = actionFilters.filters();
|
||||
this.taskManager = taskManager;
|
||||
|
|
|
@ -58,10 +58,10 @@ public abstract class TransportBroadcastAction<Request extends BroadcastRequest<
|
|||
|
||||
final String transportShardAction;
|
||||
|
||||
protected TransportBroadcastAction(Settings settings, String actionName, ThreadPool threadPool, ClusterService clusterService,
|
||||
protected TransportBroadcastAction(Settings settings, String actionName, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<Request> request, Supplier<ShardRequest> shardRequest, String shardExecutor) {
|
||||
super(settings, actionName, threadPool, transportService, actionFilters, request);
|
||||
super(settings, actionName, transportService, actionFilters, request);
|
||||
this.clusterService = clusterService;
|
||||
this.transportService = transportService;
|
||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||
|
|
|
@ -88,21 +88,18 @@ public abstract class TransportBroadcastByNodeAction<Request extends BroadcastRe
|
|||
public TransportBroadcastByNodeAction(
|
||||
Settings settings,
|
||||
String actionName,
|
||||
ThreadPool threadPool,
|
||||
ClusterService clusterService,
|
||||
TransportService transportService,
|
||||
ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
Supplier<Request> request,
|
||||
String executor) {
|
||||
this(settings, actionName, threadPool, clusterService, transportService, actionFilters, indexNameExpressionResolver, request,
|
||||
executor, true);
|
||||
this(settings, actionName, clusterService, transportService, actionFilters, indexNameExpressionResolver, request, executor, true);
|
||||
}
|
||||
|
||||
public TransportBroadcastByNodeAction(
|
||||
Settings settings,
|
||||
String actionName,
|
||||
ThreadPool threadPool,
|
||||
ClusterService clusterService,
|
||||
TransportService transportService,
|
||||
ActionFilters actionFilters,
|
||||
|
@ -110,8 +107,7 @@ public abstract class TransportBroadcastByNodeAction<Request extends BroadcastRe
|
|||
Supplier<Request> request,
|
||||
String executor,
|
||||
boolean canTripCircuitBreaker) {
|
||||
super(settings, actionName, canTripCircuitBreaker, threadPool, transportService, actionFilters,
|
||||
request);
|
||||
super(settings, actionName, canTripCircuitBreaker, transportService, actionFilters, request);
|
||||
|
||||
this.clusterService = clusterService;
|
||||
this.transportService = transportService;
|
||||
|
|
|
@ -54,6 +54,7 @@ import java.util.function.Supplier;
|
|||
* A base class for operations that needs to be performed on the master node.
|
||||
*/
|
||||
public abstract class TransportMasterNodeAction<Request extends MasterNodeRequest<Request>, Response extends ActionResponse> extends HandledTransportAction<Request, Response> {
|
||||
protected final ThreadPool threadPool;
|
||||
protected final TransportService transportService;
|
||||
protected final ClusterService clusterService;
|
||||
protected final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||
|
@ -75,10 +76,10 @@ 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,
|
||||
request);
|
||||
super(settings, actionName, canTripCircuitBreaker, transportService, actionFilters, request);
|
||||
this.transportService = transportService;
|
||||
this.clusterService = clusterService;
|
||||
this.threadPool = threadPool;
|
||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||
this.executor = executor();
|
||||
}
|
||||
|
@ -87,10 +88,10 @@ 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
|
||||
);
|
||||
super(settings, actionName, canTripCircuitBreaker, transportService, actionFilters, request);
|
||||
this.transportService = transportService;
|
||||
this.clusterService = clusterService;
|
||||
this.threadPool = threadPool;
|
||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||
this.executor = executor();
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@ public abstract class TransportNodesAction<NodesRequest extends BaseNodesRequest
|
|||
NodeResponse extends BaseNodeResponse>
|
||||
extends HandledTransportAction<NodesRequest, NodesResponse> {
|
||||
|
||||
protected final ThreadPool threadPool;
|
||||
protected final ClusterService clusterService;
|
||||
protected final TransportService transportService;
|
||||
protected final Class<NodeResponse> nodeResponseClass;
|
||||
|
@ -64,7 +65,8 @@ public abstract class TransportNodesAction<NodesRequest extends BaseNodesRequest
|
|||
ClusterService clusterService, TransportService transportService, ActionFilters actionFilters,
|
||||
Supplier<NodesRequest> request, Supplier<NodeRequest> nodeRequest, String nodeExecutor,
|
||||
Class<NodeResponse> nodeResponseClass) {
|
||||
super(settings, actionName, threadPool, transportService, actionFilters, request);
|
||||
super(settings, actionName, transportService, actionFilters, request);
|
||||
this.threadPool = threadPool;
|
||||
this.clusterService = Objects.requireNonNull(clusterService);
|
||||
this.transportService = Objects.requireNonNull(transportService);
|
||||
this.nodeResponseClass = Objects.requireNonNull(nodeResponseClass);
|
||||
|
|
|
@ -38,7 +38,6 @@ import org.elasticsearch.common.settings.Settings;
|
|||
import org.elasticsearch.common.util.concurrent.CountDown;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
import org.elasticsearch.tasks.Task;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -58,10 +57,10 @@ public abstract class TransportBroadcastReplicationAction<Request extends Broadc
|
|||
private final ClusterService clusterService;
|
||||
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||
|
||||
public TransportBroadcastReplicationAction(String name, Supplier<Request> request, Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
public TransportBroadcastReplicationAction(String name, Supplier<Request> request, Settings settings, ClusterService clusterService,
|
||||
TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, TransportReplicationAction replicatedBroadcastShardAction) {
|
||||
super(settings, name, threadPool, transportService, actionFilters, request);
|
||||
super(settings, name, transportService, actionFilters, request);
|
||||
this.replicatedBroadcastShardAction = replicatedBroadcastShardAction;
|
||||
this.clusterService = clusterService;
|
||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||
|
|
|
@ -100,6 +100,7 @@ public abstract class TransportReplicationAction<
|
|||
Response extends ReplicationResponse
|
||||
> extends TransportAction<Request, Response> {
|
||||
|
||||
protected final ThreadPool threadPool;
|
||||
protected final TransportService transportService;
|
||||
protected final ClusterService clusterService;
|
||||
protected final ShardStateAction shardStateAction;
|
||||
|
@ -132,7 +133,8 @@ public abstract class TransportReplicationAction<
|
|||
IndexNameExpressionResolver indexNameExpressionResolver, Supplier<Request> request,
|
||||
Supplier<ReplicaRequest> replicaRequest, String executor,
|
||||
boolean syncGlobalCheckpointAfterOperation) {
|
||||
super(settings, actionName, threadPool, actionFilters, transportService.getTaskManager());
|
||||
super(settings, actionName, actionFilters, transportService.getTaskManager());
|
||||
this.threadPool = threadPool;
|
||||
this.transportService = transportService;
|
||||
this.clusterService = clusterService;
|
||||
this.indicesService = indicesService;
|
||||
|
|
|
@ -50,6 +50,8 @@ import java.util.function.Supplier;
|
|||
|
||||
public abstract class TransportInstanceSingleOperationAction<Request extends InstanceShardOperationRequest<Request>, Response extends ActionResponse>
|
||||
extends HandledTransportAction<Request, Response> {
|
||||
|
||||
protected final ThreadPool threadPool;
|
||||
protected final ClusterService clusterService;
|
||||
protected final TransportService transportService;
|
||||
protected final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||
|
@ -60,7 +62,8 @@ 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, request);
|
||||
super(settings, actionName, transportService, actionFilters, request);
|
||||
this.threadPool = threadPool;
|
||||
this.clusterService = clusterService;
|
||||
this.transportService = transportService;
|
||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||
|
|
|
@ -60,6 +60,7 @@ 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 ThreadPool threadPool;
|
||||
protected final ClusterService clusterService;
|
||||
protected final TransportService transportService;
|
||||
protected final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||
|
@ -70,7 +71,8 @@ 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, transportService.getTaskManager());
|
||||
super(settings, actionName, actionFilters, transportService.getTaskManager());
|
||||
this.threadPool = threadPool;
|
||||
this.clusterService = clusterService;
|
||||
this.transportService = transportService;
|
||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||
|
|
|
@ -77,10 +77,10 @@ public abstract class TransportTasksAction<
|
|||
|
||||
protected final String transportNodeAction;
|
||||
|
||||
protected TransportTasksAction(Settings settings, String actionName, ThreadPool threadPool, ClusterService clusterService,
|
||||
protected TransportTasksAction(Settings settings, String actionName, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters, Supplier<TasksRequest> requestSupplier,
|
||||
Supplier<TasksResponse> responseSupplier, String nodeExecutor) {
|
||||
super(settings, actionName, threadPool, transportService, actionFilters, requestSupplier);
|
||||
super(settings, actionName, transportService, actionFilters, requestSupplier);
|
||||
this.clusterService = clusterService;
|
||||
this.transportService = transportService;
|
||||
this.transportNodeAction = actionName + "[n]";
|
||||
|
|
|
@ -31,7 +31,6 @@ import org.elasticsearch.common.settings.Settings;
|
|||
import org.elasticsearch.common.util.concurrent.AtomicArray;
|
||||
import org.elasticsearch.index.IndexNotFoundException;
|
||||
import org.elasticsearch.index.shard.ShardId;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -45,10 +44,10 @@ public class TransportMultiTermVectorsAction extends HandledTransportAction<Mult
|
|||
private final IndexNameExpressionResolver indexNameExpressionResolver;
|
||||
|
||||
@Inject
|
||||
public TransportMultiTermVectorsAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
public TransportMultiTermVectorsAction(Settings settings, TransportService transportService,
|
||||
ClusterService clusterService, TransportShardMultiTermsVectorAction shardAction,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
|
||||
super(settings, MultiTermVectorsAction.NAME, threadPool, transportService, actionFilters, MultiTermVectorsRequest::new);
|
||||
super(settings, MultiTermVectorsAction.NAME, transportService, actionFilters, MultiTermVectorsRequest::new);
|
||||
this.clusterService = clusterService;
|
||||
this.shardAction = shardAction;
|
||||
this.indexNameExpressionResolver = indexNameExpressionResolver;
|
||||
|
|
|
@ -79,9 +79,8 @@ 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, taskManager);
|
||||
protected FakeTransportAction(Settings settings, String actionName, ActionFilters actionFilters, TaskManager taskManager) {
|
||||
super(settings, actionName, actionFilters, taskManager);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -192,9 +192,8 @@ public abstract class TaskManagerTestCase extends ESTestCase {
|
|||
clusterService = createClusterService(threadPool, discoveryNode.get());
|
||||
clusterService.addStateApplier(transportService.getTaskManager());
|
||||
ActionFilters actionFilters = new ActionFilters(emptySet());
|
||||
transportListTasksAction = new TransportListTasksAction(settings, threadPool, clusterService, transportService, actionFilters);
|
||||
transportCancelTasksAction = new TransportCancelTasksAction(settings, threadPool, clusterService,
|
||||
transportService, actionFilters);
|
||||
transportListTasksAction = new TransportListTasksAction(settings, clusterService, transportService, actionFilters);
|
||||
transportCancelTasksAction = new TransportCancelTasksAction(settings, clusterService, transportService, actionFilters);
|
||||
transportService.acceptIncomingRequests();
|
||||
}
|
||||
|
||||
|
|
|
@ -424,12 +424,9 @@ public class TestTaskPlugin extends Plugin implements ActionPlugin {
|
|||
UnblockTestTasksResponse, UnblockTestTaskResponse> {
|
||||
|
||||
@Inject
|
||||
public TransportUnblockTestTasksAction(Settings settings,ThreadPool threadPool, ClusterService
|
||||
clusterService,
|
||||
TransportService transportService) {
|
||||
super(settings, UnblockTestTasksAction.NAME, threadPool, clusterService, transportService, new ActionFilters(new
|
||||
HashSet<>()),
|
||||
UnblockTestTasksRequest::new, UnblockTestTasksResponse::new, ThreadPool.Names.MANAGEMENT);
|
||||
public TransportUnblockTestTasksAction(Settings settings, ClusterService clusterService, TransportService transportService) {
|
||||
super(settings, UnblockTestTasksAction.NAME, clusterService, transportService, new ActionFilters(new HashSet<>()),
|
||||
UnblockTestTasksRequest::new, UnblockTestTasksResponse::new, ThreadPool.Names.MANAGEMENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -254,9 +254,9 @@ public class TransportTasksActionTests extends TaskManagerTestCase {
|
|||
*/
|
||||
abstract static class TestTasksAction extends TransportTasksAction<Task, TestTasksRequest, TestTasksResponse, TestTaskResponse> {
|
||||
|
||||
protected TestTasksAction(Settings settings, String actionName, ThreadPool threadPool,
|
||||
protected TestTasksAction(Settings settings, String actionName,
|
||||
ClusterService clusterService, TransportService transportService) {
|
||||
super(settings, actionName, threadPool, clusterService, transportService, new ActionFilters(new HashSet<>()),
|
||||
super(settings, actionName, clusterService, transportService, new ActionFilters(new HashSet<>()),
|
||||
TestTasksRequest::new, TestTasksResponse::new,
|
||||
ThreadPool.Names.MANAGEMENT);
|
||||
}
|
||||
|
@ -622,7 +622,7 @@ public class TransportTasksActionTests extends TaskManagerTestCase {
|
|||
for (int i = 0; i < testNodes.length; i++) {
|
||||
final int node = i;
|
||||
// Simulate task action that fails on one of the tasks on one of the nodes
|
||||
tasksActions[i] = new TestTasksAction(CLUSTER_SETTINGS, "testTasksAction", threadPool, testNodes[i].clusterService,
|
||||
tasksActions[i] = new TestTasksAction(CLUSTER_SETTINGS, "testTasksAction", testNodes[i].clusterService,
|
||||
testNodes[i].transportService) {
|
||||
@Override
|
||||
protected void taskOperation(TestTasksRequest request, Task task, ActionListener<TestTaskResponse> listener) {
|
||||
|
@ -701,7 +701,7 @@ public class TransportTasksActionTests extends TaskManagerTestCase {
|
|||
final int node = i;
|
||||
// Simulate a task action that works on all nodes except nodes listed in filterNodes.
|
||||
// We are testing that it works.
|
||||
tasksActions[i] = new TestTasksAction(CLUSTER_SETTINGS, "testTasksAction", threadPool,
|
||||
tasksActions[i] = new TestTasksAction(CLUSTER_SETTINGS, "testTasksAction",
|
||||
testNodes[i].clusterService, testNodes[i].transportService) {
|
||||
|
||||
@Override
|
||||
|
|
|
@ -30,7 +30,6 @@ import org.elasticsearch.cluster.service.ClusterService;
|
|||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.RestStatus;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
|
||||
import java.util.Collections;
|
||||
|
@ -68,8 +67,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),
|
||||
clusterService);
|
||||
TransportMainAction action = new TransportMainAction(settings, transportService, mock(ActionFilters.class), clusterService);
|
||||
AtomicReference<MainResponse> responseRef = new AtomicReference<>();
|
||||
action.doExecute(new MainRequest(), new ActionListener<MainResponse>() {
|
||||
@Override
|
||||
|
|
|
@ -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,
|
||||
new TransportAction<TestRequest, TestResponse>(Settings.EMPTY, actionName, 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, new TaskManager(Settings.EMPTY, threadPool, Collections.emptySet())) {
|
||||
actionName, actionFilters, new TaskManager(Settings.EMPTY, threadPool, Collections.emptySet())) {
|
||||
@Override
|
||||
protected void doExecute(TestRequest request, ActionListener<TestResponse> listener) {
|
||||
listener.onResponse(new TestResponse());
|
||||
|
|
|
@ -118,7 +118,7 @@ public class TransportBroadcastByNodeActionTests extends ESTestCase {
|
|||
private final Map<ShardRouting, Object> shards = new HashMap<>();
|
||||
|
||||
TestTransportBroadcastByNodeAction(Settings settings, TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, Supplier<Request> request, String executor) {
|
||||
super(settings, "indices:admin/test", THREAD_POOL, TransportBroadcastByNodeActionTests.this.clusterService, transportService, actionFilters, indexNameExpressionResolver, request, executor);
|
||||
super(settings, "indices:admin/test", TransportBroadcastByNodeActionTests.this.clusterService, transportService, actionFilters, indexNameExpressionResolver, request, executor);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -100,7 +100,7 @@ public class BroadcastReplicationTests extends ESTestCase {
|
|||
TransportService.NOOP_TRANSPORT_INTERCEPTOR, x -> clusterService.localNode(), null, Collections.emptySet());
|
||||
transportService.start();
|
||||
transportService.acceptIncomingRequests();
|
||||
broadcastReplicationAction = new TestBroadcastReplicationAction(Settings.EMPTY, threadPool, clusterService, transportService,
|
||||
broadcastReplicationAction = new TestBroadcastReplicationAction(Settings.EMPTY, clusterService, transportService,
|
||||
new ActionFilters(new HashSet<>()), new IndexNameExpressionResolver(Settings.EMPTY), null);
|
||||
}
|
||||
|
||||
|
@ -206,10 +206,10 @@ public class BroadcastReplicationTests extends ESTestCase {
|
|||
private class TestBroadcastReplicationAction extends TransportBroadcastReplicationAction<DummyBroadcastRequest, BroadcastResponse, BasicReplicationRequest, ReplicationResponse> {
|
||||
protected final Set<Tuple<ShardId, ActionListener<ReplicationResponse>>> capturedShardRequests = ConcurrentCollections.newConcurrentSet();
|
||||
|
||||
TestBroadcastReplicationAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
TransportReplicationAction replicatedBroadcastShardAction) {
|
||||
super("test-broadcast-replication-action", DummyBroadcastRequest::new, settings, threadPool, clusterService, transportService,
|
||||
TestBroadcastReplicationAction(Settings settings, ClusterService clusterService, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
TransportReplicationAction replicatedBroadcastShardAction) {
|
||||
super("test-broadcast-replication-action", DummyBroadcastRequest::new, settings, clusterService, transportService,
|
||||
actionFilters, indexNameExpressionResolver, replicatedBroadcastShardAction);
|
||||
}
|
||||
|
||||
|
|
|
@ -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, new TaskManager(settings, threadPool, Collections.emptySet()));
|
||||
super(settings, actionName, EMPTY_FILTERS, new TaskManager(settings, threadPool, Collections.emptySet()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -34,7 +34,6 @@ import org.elasticsearch.action.support.tasks.TransportTasksAction;
|
|||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.client.ElasticsearchClient;
|
||||
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.ParseField;
|
||||
|
@ -511,10 +510,9 @@ public class TestPersistentTasksPlugin extends Plugin implements ActionPlugin, P
|
|||
TestTasksRequest, TestTasksResponse, TestTaskResponse> {
|
||||
|
||||
@Inject
|
||||
public TransportTestTaskAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
IndexNameExpressionResolver indexNameExpressionResolver, String nodeExecutor) {
|
||||
super(settings, TestTaskAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
public TransportTestTaskAction(Settings settings, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters) {
|
||||
super(settings, TestTaskAction.NAME, clusterService, transportService, actionFilters,
|
||||
TestTasksRequest::new, TestTasksResponse::new, ThreadPool.Names.MANAGEMENT);
|
||||
}
|
||||
|
||||
|
|
|
@ -10,15 +10,14 @@ import org.elasticsearch.action.support.ActionFilters;
|
|||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.license.XPackInfoResponse;
|
||||
import org.elasticsearch.license.License;
|
||||
import org.elasticsearch.license.LicenseService;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.license.XPackInfoResponse;
|
||||
import org.elasticsearch.license.XPackInfoResponse.FeatureSetsInfo.FeatureSet;
|
||||
import org.elasticsearch.license.XPackInfoResponse.LicenseInfo;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.XPackBuild;
|
||||
import org.elasticsearch.xpack.core.XPackFeatureSet;
|
||||
import org.elasticsearch.license.XPackInfoResponse.FeatureSetsInfo.FeatureSet;
|
||||
import org.elasticsearch.license.XPackInfoResponse.LicenseInfo;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
@ -29,9 +28,9 @@ public class TransportXPackInfoAction extends HandledTransportAction<XPackInfoRe
|
|||
private final Set<XPackFeatureSet> featureSets;
|
||||
|
||||
@Inject
|
||||
public TransportXPackInfoAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
public TransportXPackInfoAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, LicenseService licenseService, Set<XPackFeatureSet> featureSets) {
|
||||
super(settings, XPackInfoAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, XPackInfoAction.NAME, transportService, actionFilters,
|
||||
XPackInfoRequest::new);
|
||||
this.licenseService = licenseService;
|
||||
this.featureSets = featureSets;
|
||||
|
|
|
@ -10,7 +10,6 @@ import org.elasticsearch.action.support.ActionFilters;
|
|||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ssl.SSLService;
|
||||
import org.elasticsearch.xpack.core.ssl.cert.CertificateInfo;
|
||||
|
@ -25,10 +24,9 @@ public class TransportGetCertificateInfoAction extends HandledTransportAction<Ge
|
|||
private final SSLService sslService;
|
||||
|
||||
@Inject
|
||||
public TransportGetCertificateInfoAction(Settings settings, ThreadPool threadPool,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
public TransportGetCertificateInfoAction(Settings settings, TransportService transportService, ActionFilters actionFilters,
|
||||
SSLService sslService) {
|
||||
super(settings, GetCertificateInfoAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, GetCertificateInfoAction.NAME, transportService, actionFilters,
|
||||
GetCertificateInfoAction.Request::new);
|
||||
this.sslService = sslService;
|
||||
}
|
||||
|
|
|
@ -8,14 +8,13 @@ package org.elasticsearch.xpack.core.action;
|
|||
import org.elasticsearch.action.ActionListener;
|
||||
import org.elasticsearch.action.support.ActionFilters;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.license.XPackInfoResponse;
|
||||
import org.elasticsearch.license.License;
|
||||
import org.elasticsearch.license.LicenseService;
|
||||
import org.elasticsearch.license.XPackInfoResponse;
|
||||
import org.elasticsearch.license.XPackInfoResponse.FeatureSetsInfo.FeatureSet;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.XPackFeatureSet;
|
||||
import org.elasticsearch.license.XPackInfoResponse.FeatureSetsInfo.FeatureSet;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
|
@ -54,8 +53,8 @@ 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), licenseService, featureSets);
|
||||
TransportXPackInfoAction action = new TransportXPackInfoAction(Settings.EMPTY, transportService,
|
||||
mock(ActionFilters.class), licenseService, featureSets);
|
||||
|
||||
License license = mock(License.class);
|
||||
long expiryDate = randomLong();
|
||||
|
|
|
@ -65,6 +65,7 @@ import java.util.function.Supplier;
|
|||
*/
|
||||
public class TransportGraphExploreAction extends HandledTransportAction<GraphExploreRequest, GraphExploreResponse> {
|
||||
|
||||
private final ThreadPool threadPool;
|
||||
private final NodeClient client;
|
||||
protected final XPackLicenseState licenseState;
|
||||
|
||||
|
@ -83,10 +84,9 @@ public class TransportGraphExploreAction extends HandledTransportAction<GraphExp
|
|||
|
||||
@Inject
|
||||
public TransportGraphExploreAction(Settings settings, ThreadPool threadPool, NodeClient client,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
XPackLicenseState licenseState) {
|
||||
super(settings, GraphExploreAction.NAME, threadPool, transportService, actionFilters,
|
||||
(Supplier<GraphExploreRequest>)GraphExploreRequest::new);
|
||||
TransportService transportService, ActionFilters actionFilters, XPackLicenseState licenseState) {
|
||||
super(settings, GraphExploreAction.NAME, transportService, actionFilters, (Supplier<GraphExploreRequest>)GraphExploreRequest::new);
|
||||
this.threadPool = threadPool;
|
||||
this.client = client;
|
||||
this.licenseState = licenseState;
|
||||
}
|
||||
|
|
|
@ -57,6 +57,7 @@ import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin;
|
|||
public class TransportCloseJobAction extends TransportTasksAction<TransportOpenJobAction.JobTask, CloseJobAction.Request,
|
||||
CloseJobAction.Response, CloseJobAction.Response> {
|
||||
|
||||
private final ThreadPool threadPool;
|
||||
private final Client client;
|
||||
private final ClusterService clusterService;
|
||||
private final Auditor auditor;
|
||||
|
@ -67,8 +68,9 @@ public class TransportCloseJobAction extends TransportTasksAction<TransportOpenJ
|
|||
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,
|
||||
super(settings, CloseJobAction.NAME, clusterService, transportService, actionFilters,
|
||||
CloseJobAction.Request::new, CloseJobAction.Response::new, ThreadPool.Names.SAME);
|
||||
this.threadPool = threadPool;
|
||||
this.client = client;
|
||||
this.clusterService = clusterService;
|
||||
this.auditor = auditor;
|
||||
|
|
|
@ -5,8 +5,6 @@
|
|||
*/
|
||||
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;
|
||||
|
@ -20,7 +18,6 @@ import org.elasticsearch.index.query.QueryBuilders;
|
|||
import org.elasticsearch.index.reindex.DeleteByQueryAction;
|
||||
import org.elasticsearch.index.reindex.DeleteByQueryRequest;
|
||||
import org.elasticsearch.search.builder.SearchSourceBuilder;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.MlMetaIndex;
|
||||
import org.elasticsearch.xpack.core.ml.action.DeleteCalendarAction;
|
||||
|
@ -28,6 +25,8 @@ import org.elasticsearch.xpack.core.ml.calendars.Calendar;
|
|||
import org.elasticsearch.xpack.ml.job.JobManager;
|
||||
import org.elasticsearch.xpack.ml.job.persistence.JobProvider;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static org.elasticsearch.xpack.core.ClientHelper.ML_ORIGIN;
|
||||
import static org.elasticsearch.xpack.core.ClientHelper.executeAsyncWithOrigin;
|
||||
|
||||
|
@ -38,9 +37,9 @@ public class TransportDeleteCalendarAction extends HandledTransportAction<Delete
|
|||
private final JobProvider jobProvider;
|
||||
|
||||
@Inject
|
||||
public TransportDeleteCalendarAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
public TransportDeleteCalendarAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, Client client, JobManager jobManager, JobProvider jobProvider) {
|
||||
super(settings, DeleteCalendarAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, DeleteCalendarAction.NAME, transportService, actionFilters,
|
||||
(Supplier<DeleteCalendarAction.Request>) DeleteCalendarAction.Request::new);
|
||||
this.client = client;
|
||||
this.jobManager = jobManager;
|
||||
|
|
|
@ -19,7 +19,6 @@ import org.elasticsearch.client.Client;
|
|||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.RestStatus;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.MlMetaIndex;
|
||||
import org.elasticsearch.xpack.core.ml.action.DeleteCalendarEventAction;
|
||||
|
@ -41,10 +40,9 @@ public class TransportDeleteCalendarEventAction extends HandledTransportAction<D
|
|||
private final JobManager jobManager;
|
||||
|
||||
@Inject
|
||||
public TransportDeleteCalendarEventAction(Settings settings, ThreadPool threadPool,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
Client client, JobProvider jobProvider, JobManager jobManager) {
|
||||
super(settings, DeleteCalendarEventAction.NAME, threadPool, transportService, actionFilters,
|
||||
public TransportDeleteCalendarEventAction(Settings settings, TransportService transportService, ActionFilters actionFilters,
|
||||
Client client, JobProvider jobProvider, JobManager jobManager) {
|
||||
super(settings, DeleteCalendarEventAction.NAME, transportService, actionFilters,
|
||||
DeleteCalendarEventAction.Request::new);
|
||||
this.client = client;
|
||||
this.jobProvider = jobProvider;
|
||||
|
|
|
@ -32,13 +32,15 @@ import java.util.List;
|
|||
public class TransportDeleteExpiredDataAction extends HandledTransportAction<DeleteExpiredDataAction.Request,
|
||||
DeleteExpiredDataAction.Response> {
|
||||
|
||||
private final ThreadPool threadPool;
|
||||
private final Client client;
|
||||
private final ClusterService clusterService;
|
||||
|
||||
@Inject
|
||||
public TransportDeleteExpiredDataAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, Client client, ClusterService clusterService) {
|
||||
super(settings, DeleteExpiredDataAction.NAME, threadPool, transportService, actionFilters, DeleteExpiredDataAction.Request::new);
|
||||
super(settings, DeleteExpiredDataAction.NAME, transportService, actionFilters, DeleteExpiredDataAction.Request::new);
|
||||
this.threadPool = threadPool;
|
||||
this.client = ClientHelper.clientWithOrigin(client, ClientHelper.ML_ORIGIN);
|
||||
this.clusterService = clusterService;
|
||||
}
|
||||
|
|
|
@ -20,11 +20,10 @@ import org.elasticsearch.cluster.service.ClusterService;
|
|||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.rest.RestStatus;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.action.DeleteFilterAction;
|
||||
import org.elasticsearch.xpack.core.ml.MlMetaIndex;
|
||||
import org.elasticsearch.xpack.core.ml.MlMetadata;
|
||||
import org.elasticsearch.xpack.core.ml.action.DeleteFilterAction;
|
||||
import org.elasticsearch.xpack.core.ml.job.config.Detector;
|
||||
import org.elasticsearch.xpack.core.ml.job.config.Job;
|
||||
import org.elasticsearch.xpack.core.ml.job.config.MlFilter;
|
||||
|
@ -44,9 +43,9 @@ public class TransportDeleteFilterAction extends HandledTransportAction<DeleteFi
|
|||
private final ClusterService clusterService;
|
||||
|
||||
@Inject
|
||||
public TransportDeleteFilterAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
public TransportDeleteFilterAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, ClusterService clusterService, Client client) {
|
||||
super(settings, DeleteFilterAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, DeleteFilterAction.NAME, transportService, actionFilters,
|
||||
(Supplier<DeleteFilterAction.Request>) DeleteFilterAction.Request::new);
|
||||
this.clusterService = clusterService;
|
||||
this.client = client;
|
||||
|
|
|
@ -14,7 +14,6 @@ import org.elasticsearch.client.Client;
|
|||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.action.DeleteModelSnapshotAction;
|
||||
import org.elasticsearch.xpack.core.ml.job.config.Job;
|
||||
|
@ -37,10 +36,9 @@ public class TransportDeleteModelSnapshotAction extends HandledTransportAction<D
|
|||
private final Auditor auditor;
|
||||
|
||||
@Inject
|
||||
public TransportDeleteModelSnapshotAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
ActionFilters actionFilters,
|
||||
public TransportDeleteModelSnapshotAction(Settings settings, TransportService transportService, ActionFilters actionFilters,
|
||||
JobProvider jobProvider, ClusterService clusterService, Client client, Auditor auditor) {
|
||||
super(settings, DeleteModelSnapshotAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, DeleteModelSnapshotAction.NAME, transportService, actionFilters,
|
||||
DeleteModelSnapshotAction.Request::new);
|
||||
this.client = client;
|
||||
this.jobProvider = jobProvider;
|
||||
|
|
|
@ -23,10 +23,10 @@ import java.io.IOException;
|
|||
public class TransportFlushJobAction extends TransportJobTaskAction<FlushJobAction.Request, FlushJobAction.Response> {
|
||||
|
||||
@Inject
|
||||
public TransportFlushJobAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
public TransportFlushJobAction(Settings settings, TransportService transportService,
|
||||
ClusterService clusterService, ActionFilters actionFilters,
|
||||
AutodetectProcessManager processManager) {
|
||||
super(settings, FlushJobAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
super(settings, FlushJobAction.NAME, clusterService, transportService, actionFilters,
|
||||
FlushJobAction.Request::new, FlushJobAction.Response::new, ThreadPool.Names.SAME, processManager);
|
||||
// ThreadPool.Names.SAME, because operations is executed by autodetect worker thread
|
||||
}
|
||||
|
|
|
@ -42,10 +42,10 @@ public class TransportForecastJobAction extends TransportJobTaskAction<ForecastJ
|
|||
|
||||
private final JobProvider jobProvider;
|
||||
@Inject
|
||||
public TransportForecastJobAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
public TransportForecastJobAction(Settings settings, TransportService transportService,
|
||||
ClusterService clusterService, ActionFilters actionFilters,
|
||||
JobProvider jobProvider, AutodetectProcessManager processManager) {
|
||||
super(settings, ForecastJobAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
super(settings, ForecastJobAction.NAME, clusterService, transportService, actionFilters,
|
||||
ForecastJobAction.Request::new, ForecastJobAction.Response::new,
|
||||
ThreadPool.Names.SAME, processManager);
|
||||
this.jobProvider = jobProvider;
|
||||
|
|
|
@ -5,21 +5,20 @@
|
|||
*/
|
||||
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.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetBucketsAction;
|
||||
import org.elasticsearch.xpack.ml.job.persistence.BucketsQueryBuilder;
|
||||
import org.elasticsearch.xpack.ml.job.JobManager;
|
||||
import org.elasticsearch.xpack.ml.job.persistence.BucketsQueryBuilder;
|
||||
import org.elasticsearch.xpack.ml.job.persistence.JobProvider;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class TransportGetBucketsAction extends HandledTransportAction<GetBucketsAction.Request, GetBucketsAction.Response> {
|
||||
|
||||
private final JobProvider jobProvider;
|
||||
|
@ -27,9 +26,9 @@ public class TransportGetBucketsAction extends HandledTransportAction<GetBuckets
|
|||
private final Client client;
|
||||
|
||||
@Inject
|
||||
public TransportGetBucketsAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
public TransportGetBucketsAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, JobProvider jobProvider, JobManager jobManager, Client client) {
|
||||
super(settings, GetBucketsAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, GetBucketsAction.NAME, transportService, actionFilters,
|
||||
(Supplier<GetBucketsAction.Request>) GetBucketsAction.Request::new);
|
||||
this.jobProvider = jobProvider;
|
||||
this.jobManager = jobManager;
|
||||
|
|
|
@ -12,7 +12,6 @@ import org.elasticsearch.cluster.ClusterState;
|
|||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.MlMetadata;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetCalendarEventsAction;
|
||||
|
@ -20,9 +19,9 @@ import org.elasticsearch.xpack.core.ml.action.GetCalendarsAction;
|
|||
import org.elasticsearch.xpack.core.ml.action.util.QueryPage;
|
||||
import org.elasticsearch.xpack.core.ml.calendars.ScheduledEvent;
|
||||
import org.elasticsearch.xpack.core.ml.job.config.Job;
|
||||
import org.elasticsearch.xpack.ml.job.persistence.ScheduledEventsQueryBuilder;
|
||||
import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
|
||||
import org.elasticsearch.xpack.ml.job.persistence.JobProvider;
|
||||
import org.elasticsearch.xpack.ml.job.persistence.ScheduledEventsQueryBuilder;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
@ -35,9 +34,9 @@ public class TransportGetCalendarEventsAction extends HandledTransportAction<Get
|
|||
private final ClusterService clusterService;
|
||||
|
||||
@Inject
|
||||
public TransportGetCalendarEventsAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
public TransportGetCalendarEventsAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, ClusterService clusterService, JobProvider jobProvider) {
|
||||
super(settings, GetCalendarEventsAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, GetCalendarEventsAction.NAME, transportService, actionFilters,
|
||||
(Supplier<GetCalendarEventsAction.Request>) GetCalendarEventsAction.Request::new);
|
||||
this.jobProvider = jobProvider;
|
||||
this.clusterService = clusterService;
|
||||
|
|
|
@ -10,7 +10,6 @@ import org.elasticsearch.action.support.ActionFilters;
|
|||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetCalendarsAction;
|
||||
import org.elasticsearch.xpack.core.ml.action.util.PageParams;
|
||||
|
@ -26,9 +25,9 @@ public class TransportGetCalendarsAction extends HandledTransportAction<GetCalen
|
|||
private final JobProvider jobProvider;
|
||||
|
||||
@Inject
|
||||
public TransportGetCalendarsAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
public TransportGetCalendarsAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, JobProvider jobProvider) {
|
||||
super(settings, GetCalendarsAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, GetCalendarsAction.NAME, transportService, actionFilters,
|
||||
GetCalendarsAction.Request::new);
|
||||
this.jobProvider = jobProvider;
|
||||
}
|
||||
|
|
|
@ -5,20 +5,19 @@
|
|||
*/
|
||||
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.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetCategoriesAction;
|
||||
import org.elasticsearch.xpack.ml.job.JobManager;
|
||||
import org.elasticsearch.xpack.ml.job.persistence.JobProvider;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class TransportGetCategoriesAction extends HandledTransportAction<GetCategoriesAction.Request, GetCategoriesAction.Response> {
|
||||
|
||||
private final JobProvider jobProvider;
|
||||
|
@ -26,9 +25,9 @@ public class TransportGetCategoriesAction extends HandledTransportAction<GetCate
|
|||
private final JobManager jobManager;
|
||||
|
||||
@Inject
|
||||
public TransportGetCategoriesAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
public TransportGetCategoriesAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, JobProvider jobProvider, Client client, JobManager jobManager) {
|
||||
super(settings, GetCategoriesAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, GetCategoriesAction.NAME, transportService, actionFilters,
|
||||
(Supplier<GetCategoriesAction.Request>) GetCategoriesAction.Request::new);
|
||||
this.jobProvider = jobProvider;
|
||||
this.client = client;
|
||||
|
|
|
@ -26,7 +26,6 @@ import org.elasticsearch.common.xcontent.XContentParser;
|
|||
import org.elasticsearch.index.query.QueryBuilders;
|
||||
import org.elasticsearch.search.SearchHit;
|
||||
import org.elasticsearch.search.builder.SearchSourceBuilder;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.MlMetaIndex;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetFiltersAction;
|
||||
|
@ -49,9 +48,9 @@ public class TransportGetFiltersAction extends HandledTransportAction<GetFilters
|
|||
private final Client client;
|
||||
|
||||
@Inject
|
||||
public TransportGetFiltersAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
public TransportGetFiltersAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, Client client) {
|
||||
super(settings, GetFiltersAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, GetFiltersAction.NAME, transportService, actionFilters,
|
||||
GetFiltersAction.Request::new);
|
||||
this.client = client;
|
||||
}
|
||||
|
|
|
@ -5,21 +5,20 @@
|
|||
*/
|
||||
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.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetInfluencersAction;
|
||||
import org.elasticsearch.xpack.ml.job.persistence.InfluencersQueryBuilder;
|
||||
import org.elasticsearch.xpack.ml.job.JobManager;
|
||||
import org.elasticsearch.xpack.ml.job.persistence.InfluencersQueryBuilder;
|
||||
import org.elasticsearch.xpack.ml.job.persistence.JobProvider;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class TransportGetInfluencersAction extends HandledTransportAction<GetInfluencersAction.Request, GetInfluencersAction.Response> {
|
||||
|
||||
private final JobProvider jobProvider;
|
||||
|
@ -27,9 +26,9 @@ public class TransportGetInfluencersAction extends HandledTransportAction<GetInf
|
|||
private final JobManager jobManager;
|
||||
|
||||
@Inject
|
||||
public TransportGetInfluencersAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
public TransportGetInfluencersAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, JobProvider jobProvider, Client client, JobManager jobManager) {
|
||||
super(settings, GetInfluencersAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, GetInfluencersAction.NAME, transportService, actionFilters,
|
||||
(Supplier<GetInfluencersAction.Request>) GetInfluencersAction.Request::new);
|
||||
this.jobProvider = jobProvider;
|
||||
this.client = client;
|
||||
|
|
|
@ -53,10 +53,10 @@ public class TransportGetJobsStatsAction extends TransportTasksAction<TransportO
|
|||
private final JobProvider jobProvider;
|
||||
|
||||
@Inject
|
||||
public TransportGetJobsStatsAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
public TransportGetJobsStatsAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, ClusterService clusterService,
|
||||
AutodetectProcessManager processManager, JobProvider jobProvider) {
|
||||
super(settings, GetJobsStatsAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
super(settings, GetJobsStatsAction.NAME, clusterService, transportService, actionFilters,
|
||||
GetJobsStatsAction.Request::new, GetJobsStatsAction.Response::new,
|
||||
ThreadPool.Names.MANAGEMENT);
|
||||
this.clusterService = clusterService;
|
||||
|
|
|
@ -10,7 +10,6 @@ import org.elasticsearch.action.support.ActionFilters;
|
|||
import org.elasticsearch.action.support.HandledTransportAction;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetModelSnapshotsAction;
|
||||
import org.elasticsearch.xpack.core.ml.action.util.QueryPage;
|
||||
|
@ -27,9 +26,9 @@ public class TransportGetModelSnapshotsAction extends HandledTransportAction<Get
|
|||
private final JobManager jobManager;
|
||||
|
||||
@Inject
|
||||
public TransportGetModelSnapshotsAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
public TransportGetModelSnapshotsAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, JobProvider jobProvider, JobManager jobManager) {
|
||||
super(settings, GetModelSnapshotsAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, GetModelSnapshotsAction.NAME, transportService, actionFilters,
|
||||
GetModelSnapshotsAction.Request::new);
|
||||
this.jobProvider = jobProvider;
|
||||
this.jobManager = jobManager;
|
||||
|
|
|
@ -56,6 +56,7 @@ public class TransportGetOverallBucketsAction extends HandledTransportAction<Get
|
|||
private static final String EARLIEST_TIME = "earliest_time";
|
||||
private static final String LATEST_TIME = "latest_time";
|
||||
|
||||
private final ThreadPool threadPool;
|
||||
private final Client client;
|
||||
private final ClusterService clusterService;
|
||||
private final JobManager jobManager;
|
||||
|
@ -64,8 +65,9 @@ public class TransportGetOverallBucketsAction extends HandledTransportAction<Get
|
|||
public TransportGetOverallBucketsAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, ClusterService clusterService,
|
||||
JobManager jobManager, Client client) {
|
||||
super(settings, GetOverallBucketsAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, GetOverallBucketsAction.NAME, transportService, actionFilters,
|
||||
(Supplier<GetOverallBucketsAction.Request>) GetOverallBucketsAction.Request::new);
|
||||
this.threadPool = threadPool;
|
||||
this.clusterService = clusterService;
|
||||
this.client = client;
|
||||
this.jobManager = jobManager;
|
||||
|
|
|
@ -5,20 +5,19 @@
|
|||
*/
|
||||
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.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.action.GetRecordsAction;
|
||||
import org.elasticsearch.xpack.ml.job.persistence.RecordsQueryBuilder;
|
||||
import org.elasticsearch.xpack.ml.job.JobManager;
|
||||
import org.elasticsearch.xpack.ml.job.persistence.JobProvider;
|
||||
import org.elasticsearch.xpack.ml.job.persistence.RecordsQueryBuilder;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class TransportGetRecordsAction extends HandledTransportAction<GetRecordsAction.Request, GetRecordsAction.Response> {
|
||||
|
||||
|
@ -27,9 +26,9 @@ public class TransportGetRecordsAction extends HandledTransportAction<GetRecords
|
|||
private final Client client;
|
||||
|
||||
@Inject
|
||||
public TransportGetRecordsAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
public TransportGetRecordsAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, JobProvider jobProvider, JobManager jobManager, Client client) {
|
||||
super(settings, GetRecordsAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, GetRecordsAction.NAME, transportService, actionFilters,
|
||||
(Supplier<GetRecordsAction.Request>) GetRecordsAction.Request::new);
|
||||
this.jobProvider = jobProvider;
|
||||
this.jobManager = jobManager;
|
||||
|
|
|
@ -18,12 +18,11 @@ import org.elasticsearch.cluster.service.ClusterService;
|
|||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.persistent.PersistentTasksCustomMetaData;
|
||||
import org.elasticsearch.tasks.Task;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.MlMetadata;
|
||||
import org.elasticsearch.xpack.core.ml.action.IsolateDatafeedAction;
|
||||
import org.elasticsearch.persistent.PersistentTasksCustomMetaData;
|
||||
import org.elasticsearch.xpack.ml.MachineLearning;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -33,9 +32,9 @@ public class TransportIsolateDatafeedAction extends TransportTasksAction<Transpo
|
|||
IsolateDatafeedAction.Request, IsolateDatafeedAction.Response, IsolateDatafeedAction.Response> {
|
||||
|
||||
@Inject
|
||||
public TransportIsolateDatafeedAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
public TransportIsolateDatafeedAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, ClusterService clusterService) {
|
||||
super(settings, IsolateDatafeedAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
super(settings, IsolateDatafeedAction.NAME, clusterService, transportService, actionFilters,
|
||||
IsolateDatafeedAction.Request::new, IsolateDatafeedAction.Response::new,
|
||||
MachineLearning.UTILITY_THREAD_POOL_NAME);
|
||||
}
|
||||
|
|
|
@ -15,13 +15,12 @@ import org.elasticsearch.cluster.ClusterState;
|
|||
import org.elasticsearch.cluster.service.ClusterService;
|
||||
import org.elasticsearch.common.io.stream.Writeable;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.persistent.PersistentTasksCustomMetaData;
|
||||
import org.elasticsearch.tasks.Task;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.MlMetadata;
|
||||
import org.elasticsearch.xpack.core.ml.action.JobTaskRequest;
|
||||
import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
|
||||
import org.elasticsearch.persistent.PersistentTasksCustomMetaData;
|
||||
import org.elasticsearch.xpack.ml.job.JobManager;
|
||||
import org.elasticsearch.xpack.ml.job.process.autodetect.AutodetectProcessManager;
|
||||
|
||||
|
@ -39,11 +38,11 @@ public abstract class TransportJobTaskAction<Request extends JobTaskRequest<Requ
|
|||
|
||||
protected final AutodetectProcessManager processManager;
|
||||
|
||||
TransportJobTaskAction(Settings settings, String actionName, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportJobTaskAction(Settings settings, String actionName, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
Supplier<Request> requestSupplier,
|
||||
Supplier<Response> responseSupplier, String nodeExecutor, AutodetectProcessManager processManager) {
|
||||
super(settings, actionName, threadPool, clusterService, transportService, actionFilters,
|
||||
super(settings, actionName, clusterService, transportService, actionFilters,
|
||||
requestSupplier, responseSupplier, nodeExecutor);
|
||||
this.processManager = processManager;
|
||||
}
|
||||
|
|
|
@ -15,14 +15,13 @@ import org.elasticsearch.cluster.service.ClusterService;
|
|||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.io.stream.StreamInput;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.persistent.PersistentTasksCustomMetaData;
|
||||
import org.elasticsearch.tasks.Task;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.MlMetadata;
|
||||
import org.elasticsearch.xpack.core.ml.action.KillProcessAction;
|
||||
import org.elasticsearch.xpack.core.ml.job.messages.Messages;
|
||||
import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
|
||||
import org.elasticsearch.persistent.PersistentTasksCustomMetaData;
|
||||
import org.elasticsearch.xpack.ml.MachineLearning;
|
||||
import org.elasticsearch.xpack.ml.job.process.autodetect.AutodetectProcessManager;
|
||||
import org.elasticsearch.xpack.ml.notifications.Auditor;
|
||||
|
@ -34,10 +33,10 @@ public class TransportKillProcessAction extends TransportJobTaskAction<KillProce
|
|||
private final Auditor auditor;
|
||||
|
||||
@Inject
|
||||
public TransportKillProcessAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
public TransportKillProcessAction(Settings settings, TransportService transportService,
|
||||
ClusterService clusterService, ActionFilters actionFilters,
|
||||
AutodetectProcessManager processManager, Auditor auditor) {
|
||||
super(settings, KillProcessAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
super(settings, KillProcessAction.NAME, clusterService, transportService, actionFilters,
|
||||
KillProcessAction.Request::new, KillProcessAction.Response::new, MachineLearning.UTILITY_THREAD_POOL_NAME, processManager);
|
||||
this.auditor = auditor;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@ import org.elasticsearch.common.inject.Inject;
|
|||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.unit.ByteSizeUnit;
|
||||
import org.elasticsearch.common.unit.ByteSizeValue;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.MachineLearningField;
|
||||
import org.elasticsearch.xpack.core.ml.action.MlInfoAction;
|
||||
|
@ -30,9 +29,9 @@ public class TransportMlInfoAction extends HandledTransportAction<MlInfoAction.R
|
|||
private final ClusterService clusterService;
|
||||
|
||||
@Inject
|
||||
public TransportMlInfoAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
public TransportMlInfoAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, ClusterService clusterService) {
|
||||
super(settings, MlInfoAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, MlInfoAction.NAME, transportService, actionFilters,
|
||||
(Supplier<MlInfoAction.Request>) MlInfoAction.Request::new);
|
||||
this.clusterService = clusterService;
|
||||
}
|
||||
|
|
|
@ -29,9 +29,9 @@ import java.io.IOException;
|
|||
public class TransportPersistJobAction extends TransportJobTaskAction<PersistJobAction.Request, PersistJobAction.Response> {
|
||||
|
||||
@Inject
|
||||
public TransportPersistJobAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
public TransportPersistJobAction(Settings settings, TransportService transportService,
|
||||
ClusterService clusterService, ActionFilters actionFilters, AutodetectProcessManager processManager) {
|
||||
super(settings, PersistJobAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
super(settings, PersistJobAction.NAME, clusterService, transportService, actionFilters,
|
||||
PersistJobAction.Request::new, PersistJobAction.Response::new, ThreadPool.Names.SAME, processManager);
|
||||
// ThreadPool.Names.SAME, because operations is executed by autodetect worker thread
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ import org.elasticsearch.common.settings.Settings;
|
|||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.MlMetaIndex;
|
||||
import org.elasticsearch.xpack.core.ml.action.PostCalendarEventsAction;
|
||||
|
@ -44,9 +43,9 @@ public class TransportPostCalendarEventsAction extends HandledTransportAction<Po
|
|||
private final JobManager jobManager;
|
||||
|
||||
@Inject
|
||||
public TransportPostCalendarEventsAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
public TransportPostCalendarEventsAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, Client client, JobProvider jobProvider, JobManager jobManager) {
|
||||
super(settings, PostCalendarEventsAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, PostCalendarEventsAction.NAME, transportService, actionFilters,
|
||||
PostCalendarEventsAction.Request::new);
|
||||
this.client = client;
|
||||
this.jobProvider = jobProvider;
|
||||
|
|
|
@ -27,10 +27,10 @@ public class TransportPostDataAction extends TransportJobTaskAction<PostDataActi
|
|||
private final AnalysisRegistry analysisRegistry;
|
||||
|
||||
@Inject
|
||||
public TransportPostDataAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
public TransportPostDataAction(Settings settings, TransportService transportService,
|
||||
ClusterService clusterService, ActionFilters actionFilters,
|
||||
AutodetectProcessManager processManager, AnalysisRegistry analysisRegistry) {
|
||||
super(settings, PostDataAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
super(settings, PostDataAction.NAME, 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;
|
||||
|
|
|
@ -36,14 +36,16 @@ import java.util.stream.Collectors;
|
|||
|
||||
public class TransportPreviewDatafeedAction extends HandledTransportAction<PreviewDatafeedAction.Request, PreviewDatafeedAction.Response> {
|
||||
|
||||
private final ThreadPool threadPool;
|
||||
private final Client client;
|
||||
private final ClusterService clusterService;
|
||||
|
||||
@Inject
|
||||
public TransportPreviewDatafeedAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, Client client, ClusterService clusterService) {
|
||||
super(settings, PreviewDatafeedAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, PreviewDatafeedAction.NAME, transportService, actionFilters,
|
||||
(Supplier<PreviewDatafeedAction.Request>) PreviewDatafeedAction.Request::new);
|
||||
this.threadPool = threadPool;
|
||||
this.client = client;
|
||||
this.clusterService = clusterService;
|
||||
}
|
||||
|
|
|
@ -20,10 +20,9 @@ import org.elasticsearch.common.xcontent.ToXContent;
|
|||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
import org.elasticsearch.index.engine.VersionConflictEngineException;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.action.PutCalendarAction;
|
||||
import org.elasticsearch.xpack.core.ml.MlMetaIndex;
|
||||
import org.elasticsearch.xpack.core.ml.action.PutCalendarAction;
|
||||
import org.elasticsearch.xpack.core.ml.calendars.Calendar;
|
||||
import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
|
||||
|
||||
|
@ -39,9 +38,9 @@ public class TransportPutCalendarAction extends HandledTransportAction<PutCalend
|
|||
private final Client client;
|
||||
|
||||
@Inject
|
||||
public TransportPutCalendarAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
public TransportPutCalendarAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, Client client) {
|
||||
super(settings, PutCalendarAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, PutCalendarAction.NAME, transportService, actionFilters,
|
||||
(Supplier<PutCalendarAction.Request>) PutCalendarAction.Request::new);
|
||||
this.client = client;
|
||||
}
|
||||
|
|
|
@ -19,13 +19,12 @@ import org.elasticsearch.common.settings.Settings;
|
|||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.action.PutFilterAction;
|
||||
import org.elasticsearch.xpack.core.ml.MlMetaIndex;
|
||||
import org.elasticsearch.xpack.ml.job.JobManager;
|
||||
import org.elasticsearch.xpack.core.ml.action.PutFilterAction;
|
||||
import org.elasticsearch.xpack.core.ml.job.config.MlFilter;
|
||||
import org.elasticsearch.xpack.core.ml.utils.ExceptionsHelper;
|
||||
import org.elasticsearch.xpack.ml.job.JobManager;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Collections;
|
||||
|
@ -40,10 +39,9 @@ public class TransportPutFilterAction extends HandledTransportAction<PutFilterAc
|
|||
private final JobManager jobManager;
|
||||
|
||||
@Inject
|
||||
public TransportPutFilterAction(Settings settings, ThreadPool threadPool,
|
||||
TransportService transportService, ActionFilters actionFilters,
|
||||
public TransportPutFilterAction(Settings settings, TransportService transportService, ActionFilters actionFilters,
|
||||
Client client, JobManager jobManager) {
|
||||
super(settings, PutFilterAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, PutFilterAction.NAME, transportService, actionFilters,
|
||||
(Supplier<PutFilterAction.Request>) PutFilterAction.Request::new);
|
||||
this.client = client;
|
||||
this.jobManager = jobManager;
|
||||
|
|
|
@ -48,14 +48,16 @@ import java.util.stream.Stream;
|
|||
public class TransportStopDatafeedAction extends TransportTasksAction<TransportStartDatafeedAction.DatafeedTask, StopDatafeedAction.Request,
|
||||
StopDatafeedAction.Response, StopDatafeedAction.Response> {
|
||||
|
||||
private final ThreadPool threadPool;
|
||||
private final PersistentTasksService persistentTasksService;
|
||||
|
||||
@Inject
|
||||
public TransportStopDatafeedAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
ActionFilters actionFilters, ClusterService clusterService,
|
||||
PersistentTasksService persistentTasksService) {
|
||||
super(settings, StopDatafeedAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
super(settings, StopDatafeedAction.NAME, clusterService, transportService, actionFilters,
|
||||
StopDatafeedAction.Request::new, StopDatafeedAction.Response::new, MachineLearning.UTILITY_THREAD_POOL_NAME);
|
||||
this.threadPool = threadPool;
|
||||
this.persistentTasksService = persistentTasksService;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ import org.elasticsearch.action.support.HandledTransportAction;
|
|||
import org.elasticsearch.common.Strings;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.action.PutCalendarAction;
|
||||
import org.elasticsearch.xpack.core.ml.action.UpdateCalendarJobAction;
|
||||
|
@ -26,9 +25,9 @@ public class TransportUpdateCalendarJobAction extends HandledTransportAction<Upd
|
|||
private final JobManager jobManager;
|
||||
|
||||
@Inject
|
||||
public TransportUpdateCalendarJobAction(Settings settings, ThreadPool threadPool, TransportService transportService,
|
||||
public TransportUpdateCalendarJobAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, JobProvider jobProvider, JobManager jobManager) {
|
||||
super(settings, UpdateCalendarJobAction.NAME, threadPool, transportService, actionFilters, UpdateCalendarJobAction.Request::new);
|
||||
super(settings, UpdateCalendarJobAction.NAME, transportService, actionFilters, UpdateCalendarJobAction.Request::new);
|
||||
this.jobProvider = jobProvider;
|
||||
this.jobManager = jobManager;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ import org.elasticsearch.common.settings.Settings;
|
|||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.action.UpdateModelSnapshotAction;
|
||||
import org.elasticsearch.xpack.core.ml.job.messages.Messages;
|
||||
|
@ -42,9 +41,9 @@ public class TransportUpdateModelSnapshotAction extends HandledTransportAction<U
|
|||
private final Client client;
|
||||
|
||||
@Inject
|
||||
public TransportUpdateModelSnapshotAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
public TransportUpdateModelSnapshotAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, JobProvider jobProvider, Client client) {
|
||||
super(settings, UpdateModelSnapshotAction.NAME, threadPool, transportService, actionFilters,
|
||||
super(settings, UpdateModelSnapshotAction.NAME, transportService, actionFilters,
|
||||
UpdateModelSnapshotAction.Request::new);
|
||||
this.jobProvider = jobProvider;
|
||||
this.client = client;
|
||||
|
|
|
@ -22,10 +22,9 @@ import java.io.IOException;
|
|||
public class TransportUpdateProcessAction extends TransportJobTaskAction<UpdateProcessAction.Request, UpdateProcessAction.Response> {
|
||||
|
||||
@Inject
|
||||
public TransportUpdateProcessAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
ClusterService clusterService, ActionFilters actionFilters,
|
||||
AutodetectProcessManager processManager) {
|
||||
super(settings, UpdateProcessAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
public TransportUpdateProcessAction(Settings settings, TransportService transportService, ClusterService clusterService,
|
||||
ActionFilters actionFilters, AutodetectProcessManager processManager) {
|
||||
super(settings, UpdateProcessAction.NAME, 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,24 +5,22 @@
|
|||
*/
|
||||
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.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.action.ValidateDetectorAction;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class TransportValidateDetectorAction extends HandledTransportAction<ValidateDetectorAction.Request,
|
||||
ValidateDetectorAction.Response> {
|
||||
|
||||
@Inject
|
||||
public TransportValidateDetectorAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
ActionFilters actionFilters) {
|
||||
super(settings, ValidateDetectorAction.NAME, threadPool, transportService, actionFilters,
|
||||
public TransportValidateDetectorAction(Settings settings, TransportService transportService, ActionFilters actionFilters) {
|
||||
super(settings, ValidateDetectorAction.NAME, transportService, actionFilters,
|
||||
(Supplier<ValidateDetectorAction.Request>) ValidateDetectorAction.Request::new);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,24 +5,22 @@
|
|||
*/
|
||||
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.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.ml.action.ValidateJobConfigAction;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class TransportValidateJobConfigAction extends HandledTransportAction<ValidateJobConfigAction.Request,
|
||||
ValidateJobConfigAction.Response> {
|
||||
|
||||
@Inject
|
||||
public TransportValidateJobConfigAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
ActionFilters actionFilters) {
|
||||
super(settings, ValidateJobConfigAction.NAME, threadPool, transportService, actionFilters,
|
||||
public TransportValidateJobConfigAction(Settings settings, TransportService transportService, ActionFilters actionFilters) {
|
||||
super(settings, ValidateJobConfigAction.NAME, transportService, actionFilters,
|
||||
(Supplier< ValidateJobConfigAction.Request>) ValidateJobConfigAction.Request::new);
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ import java.util.stream.Collectors;
|
|||
|
||||
public class TransportMonitoringBulkAction extends HandledTransportAction<MonitoringBulkRequest, MonitoringBulkResponse> {
|
||||
|
||||
private final ThreadPool threadPool;
|
||||
private final ClusterService clusterService;
|
||||
private final Exporters exportService;
|
||||
private final MonitoringService monitoringService;
|
||||
|
@ -42,7 +43,8 @@ public class TransportMonitoringBulkAction extends HandledTransportAction<Monito
|
|||
public TransportMonitoringBulkAction(Settings settings, ThreadPool threadPool, ClusterService clusterService,
|
||||
TransportService transportService, ActionFilters actionFilters, Exporters exportService,
|
||||
MonitoringService monitoringService) {
|
||||
super(settings, MonitoringBulkAction.NAME, threadPool, transportService, actionFilters, MonitoringBulkRequest::new);
|
||||
super(settings, MonitoringBulkAction.NAME, transportService, actionFilters, MonitoringBulkRequest::new);
|
||||
this.threadPool = threadPool;
|
||||
this.clusterService = clusterService;
|
||||
this.exportService = exportService;
|
||||
this.monitoringService = monitoringService;
|
||||
|
|
|
@ -17,7 +17,6 @@ import org.elasticsearch.common.bytes.BytesArray;
|
|||
import org.elasticsearch.common.collect.ImmutableOpenMap;
|
||||
import org.elasticsearch.common.inject.Inject;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.threadpool.ThreadPool;
|
||||
import org.elasticsearch.transport.TransportService;
|
||||
import org.elasticsearch.xpack.core.rollup.RollupField;
|
||||
import org.elasticsearch.xpack.core.rollup.action.GetRollupCapsAction;
|
||||
|
@ -36,8 +35,8 @@ public class TransportGetRollupCapsAction extends HandledTransportAction<GetRoll
|
|||
|
||||
@Inject
|
||||
public TransportGetRollupCapsAction(Settings settings, TransportService transportService, ClusterService clusterService,
|
||||
ThreadPool threadPool, ActionFilters actionFilters) {
|
||||
super(settings, GetRollupCapsAction.NAME, threadPool, transportService, actionFilters,
|
||||
ActionFilters actionFilters) {
|
||||
super(settings, GetRollupCapsAction.NAME, transportService, actionFilters,
|
||||
(Supplier<GetRollupCapsAction.Request>) GetRollupCapsAction.Request::new);
|
||||
this.clusterService = clusterService;
|
||||
}
|
||||
|
|
|
@ -38,9 +38,9 @@ public class TransportGetRollupJobAction extends TransportTasksAction<RollupJobT
|
|||
GetRollupJobsAction.Response, GetRollupJobsAction.Response> {
|
||||
|
||||
@Inject
|
||||
public TransportGetRollupJobAction(Settings settings, TransportService transportService, ThreadPool threadPool,
|
||||
public TransportGetRollupJobAction(Settings settings, TransportService transportService,
|
||||
ActionFilters actionFilters, ClusterService clusterService) {
|
||||
super(settings, GetRollupJobsAction.NAME, threadPool, clusterService, transportService, actionFilters,
|
||||
super(settings, GetRollupJobsAction.NAME, clusterService, transportService, actionFilters,
|
||||
GetRollupJobsAction.Request::new, GetRollupJobsAction.Response::new, ThreadPool.Names.SAME);
|
||||
}
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue