Skip to content

Commit 9dceea6

Browse files
Remove unused reader field from TransportTasksAction
Removing the unused reader field as ewll as some upstream code that becomes unused as a result.
1 parent d3e0ec1 commit 9dceea6

File tree

30 files changed

+1
-43
lines changed

30 files changed

+1
-43
lines changed

modules/reindex/src/main/java/org/elasticsearch/reindex/TransportRethrottleAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public TransportRethrottleAction(
4444
transportService,
4545
actionFilters,
4646
RethrottleRequest::new,
47-
ListTasksResponse::new,
4847
TaskInfo::from,
4948
transportService.getThreadPool().executor(ThreadPool.Names.MANAGEMENT)
5049
);

server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/cancel/TransportCancelTasksAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ public TransportCancelTasksAction(ClusterService clusterService, TransportServic
4747
transportService,
4848
actionFilters,
4949
CancelTasksRequest::new,
50-
ListTasksResponse::new,
5150
TaskInfo::from,
5251
// Cancellation is usually lightweight, and runs on the transport thread if the task didn't even start yet, but some
5352
// implementations of CancellableTask#onCancelled() are nontrivial so we use GENERIC here. TODO could it be SAME?

server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/ListTasksResponse.java

-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import org.elasticsearch.cluster.node.DiscoveryNodes;
1717
import org.elasticsearch.common.Strings;
1818
import org.elasticsearch.common.collect.Iterators;
19-
import org.elasticsearch.common.io.stream.StreamInput;
2019
import org.elasticsearch.common.io.stream.StreamOutput;
2120
import org.elasticsearch.common.xcontent.ChunkedToXContent;
2221
import org.elasticsearch.common.xcontent.ChunkedToXContentObject;
@@ -52,11 +51,6 @@ public ListTasksResponse(
5251
this.tasks = tasks == null ? List.of() : List.copyOf(tasks);
5352
}
5453

55-
public ListTasksResponse(StreamInput in) throws IOException {
56-
super(in);
57-
tasks = in.readCollectionAsImmutableList(TaskInfo::from);
58-
}
59-
6054
@Override
6155
public void writeTo(StreamOutput out) throws IOException {
6256
super.writeTo(out);

server/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/list/TransportListTasksAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ public TransportListTasksAction(ClusterService clusterService, TransportService
6060
transportService,
6161
actionFilters,
6262
ListTasksRequest::new,
63-
ListTasksResponse::new,
6463
TaskInfo::from,
6564
transportService.getThreadPool().executor(ThreadPool.Names.MANAGEMENT)
6665
);

server/src/main/java/org/elasticsearch/action/support/tasks/TransportTasksAction.java

-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ public abstract class TransportTasksAction<
5656
protected final ClusterService clusterService;
5757
protected final TransportService transportService;
5858
protected final Writeable.Reader<TasksRequest> requestReader;
59-
protected final Writeable.Reader<TasksResponse> responsesReader;
6059
protected final Writeable.Reader<TaskResponse> responseReader;
6160

6261
protected final String transportNodeAction;
@@ -67,7 +66,6 @@ protected TransportTasksAction(
6766
TransportService transportService,
6867
ActionFilters actionFilters,
6968
Writeable.Reader<TasksRequest> requestReader,
70-
Writeable.Reader<TasksResponse> responsesReader,
7169
Writeable.Reader<TaskResponse> responseReader,
7270
Executor nodeExecutor
7371
) {
@@ -77,7 +75,6 @@ protected TransportTasksAction(
7775
this.transportService = transportService;
7876
this.transportNodeAction = actionName + "[n]";
7977
this.requestReader = requestReader;
80-
this.responsesReader = responsesReader;
8178
this.responseReader = responseReader;
8279

8380
transportService.registerRequestHandler(transportNodeAction, nodeExecutor, NodeTaskRequest::new, new NodeTransportHandler());

server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TestTaskPlugin.java

-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,6 @@ public TransportUnblockTestTasksAction(ClusterService clusterService, TransportS
391391
transportService,
392392
new ActionFilters(new HashSet<>()),
393393
UnblockTestTasksRequest::new,
394-
UnblockTestTasksResponse::new,
395394
UnblockTestTaskResponse::new,
396395
transportService.getThreadPool().executor(ThreadPool.Names.MANAGEMENT)
397396
);

server/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TransportTasksActionTests.java

-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ protected TestTasksAction(String actionName, ClusterService clusterService, Tran
261261
transportService,
262262
new ActionFilters(new HashSet<>()),
263263
TestTasksRequest::new,
264-
TestTasksResponse::new,
265264
TestTaskResponse::new,
266265
transportService.getThreadPool().executor(ThreadPool.Names.MANAGEMENT)
267266
);

server/src/test/java/org/elasticsearch/persistent/TestPersistentTasksPlugin.java

-1
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,6 @@ public TransportTestTaskAction(ClusterService clusterService, TransportService t
531531
transportService,
532532
actionFilters,
533533
TestTasksRequest::new,
534-
TestTasksResponse::new,
535534
TestTaskResponse::new,
536535
transportService.getThreadPool().executor(ThreadPool.Names.MANAGEMENT)
537536
);

x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/TransportFollowStatsAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ public TransportFollowStatsAction(
5959
transportService,
6060
actionFilters,
6161
FollowStatsAction.StatsRequest::new,
62-
FollowStatsAction.StatsResponses::new,
6362
FollowStatsAction.StatsResponse::new,
6463
transportService.getThreadPool().executor(Ccr.CCR_THREAD_POOL_NAME)
6564
);

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportClearDeploymentCacheAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ public TransportClearDeploymentCacheAction(
4545
actionFilters,
4646
Request::new,
4747
Response::new,
48-
Response::new,
4948
EsExecutors.DIRECT_EXECUTOR_SERVICE
5049
);
5150
}

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportCloseJobAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ public TransportCloseJobAction(
101101
actionFilters,
102102
CloseJobAction.Request::new,
103103
CloseJobAction.Response::new,
104-
CloseJobAction.Response::new,
105104
EsExecutors.DIRECT_EXECUTOR_SERVICE
106105
);
107106
this.threadPool = threadPool;

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetDataFrameAnalyticsStatsAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ public TransportGetDataFrameAnalyticsStatsAction(
9696
transportService,
9797
actionFilters,
9898
GetDataFrameAnalyticsStatsAction.Request::new,
99-
GetDataFrameAnalyticsStatsAction.Response::new,
10099
in -> new QueryPage<>(in, GetDataFrameAnalyticsStatsAction.Response.Stats::new),
101100
transportService.getThreadPool().executor(ThreadPool.Names.MANAGEMENT)
102101
);

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetDatafeedRunningStateAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ public TransportGetDatafeedRunningStateAction(
5656
actionFilters,
5757
Request::new,
5858
Response::new,
59-
Response::new,
6059
transportService.getThreadPool().executor(ThreadPool.Names.MANAGEMENT)
6160
);
6261
}

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetDeploymentStatsAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ public TransportGetDeploymentStatsAction(
6464
transportService,
6565
actionFilters,
6666
GetDeploymentStatsAction.Request::new,
67-
GetDeploymentStatsAction.Response::new,
6867
AssignmentStats::new,
6968
transportService.getThreadPool().executor(ThreadPool.Names.MANAGEMENT)
7069
);

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportGetJobsStatsAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ public TransportGetJobsStatsAction(
8282
transportService,
8383
actionFilters,
8484
GetJobsStatsAction.Request::new,
85-
GetJobsStatsAction.Response::new,
8685
in -> new QueryPage<>(in, JobStats::new),
8786
threadPool.executor(ThreadPool.Names.MANAGEMENT)
8887
);

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportInferTrainedModelDeploymentAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ public TransportInferTrainedModelDeploymentAction(
5050
actionFilters,
5151
InferTrainedModelDeploymentAction.Request::new,
5252
InferTrainedModelDeploymentAction.Response::new,
53-
InferTrainedModelDeploymentAction.Response::new,
5453
EsExecutors.DIRECT_EXECUTOR_SERVICE
5554
);
5655
}

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportIsolateDatafeedAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public TransportIsolateDatafeedAction(TransportService transportService, ActionF
4040
actionFilters,
4141
IsolateDatafeedAction.Request::new,
4242
IsolateDatafeedAction.Response::new,
43-
IsolateDatafeedAction.Response::new,
4443
transportService.getThreadPool().executor(MachineLearning.UTILITY_THREAD_POOL_NAME)
4544
);
4645
}

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportJobTaskAction.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public abstract class TransportJobTaskAction<Request extends JobTaskRequest<Requ
4646
Executor nodeExecutor,
4747
AutodetectProcessManager processManager
4848
) {
49-
super(actionName, clusterService, transportService, actionFilters, requestReader, responseReader, responseReader, nodeExecutor);
49+
super(actionName, clusterService, transportService, actionFilters, requestReader, responseReader, nodeExecutor);
5050
this.processManager = processManager;
5151
}
5252

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportKillProcessAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public TransportKillProcessAction(
5757
actionFilters,
5858
KillProcessAction.Request::new,
5959
KillProcessAction.Response::new,
60-
KillProcessAction.Response::new,
6160
transportService.getThreadPool().executor(MachineLearning.UTILITY_THREAD_POOL_NAME)
6261
);
6362
this.auditor = auditor;

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStopDataFrameAnalyticsAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ public TransportStopDataFrameAnalyticsAction(
9292
actionFilters,
9393
StopDataFrameAnalyticsAction.Request::new,
9494
StopDataFrameAnalyticsAction.Response::new,
95-
StopDataFrameAnalyticsAction.Response::new,
9695
EsExecutors.DIRECT_EXECUTOR_SERVICE
9796
);
9897
this.threadPool = threadPool;

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStopDatafeedAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ public TransportStopDatafeedAction(
9494
actionFilters,
9595
StopDatafeedAction.Request::new,
9696
StopDatafeedAction.Response::new,
97-
StopDatafeedAction.Response::new,
9897
threadPool.executor(MachineLearning.UTILITY_THREAD_POOL_NAME)
9998
);
10099
this.threadPool = Objects.requireNonNull(threadPool);

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/action/TransportStopTrainedModelDeploymentAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ public TransportStopTrainedModelDeploymentAction(
8383
actionFilters,
8484
StopTrainedModelDeploymentAction.Request::new,
8585
StopTrainedModelDeploymentAction.Response::new,
86-
StopTrainedModelDeploymentAction.Response::new,
8786
EsExecutors.DIRECT_EXECUTOR_SERVICE
8887
);
8988
this.ingestService = ingestService;

x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/TransportDeleteRollupJobAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ public TransportDeleteRollupJobAction(TransportService transportService, ActionF
4646
actionFilters,
4747
DeleteRollupJobAction.Request::new,
4848
DeleteRollupJobAction.Response::new,
49-
DeleteRollupJobAction.Response::new,
5049
EsExecutors.DIRECT_EXECUTOR_SERVICE
5150
);
5251
}

x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/TransportGetRollupJobAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ public TransportGetRollupJobAction(TransportService transportService, ActionFilt
4949
actionFilters,
5050
GetRollupJobsAction.Request::new,
5151
GetRollupJobsAction.Response::new,
52-
GetRollupJobsAction.Response::new,
5352
EsExecutors.DIRECT_EXECUTOR_SERVICE
5453
);
5554
}

x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/TransportStartRollupAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ public TransportStartRollupAction(TransportService transportService, ActionFilte
3737
actionFilters,
3838
StartRollupJobAction.Request::new,
3939
StartRollupJobAction.Response::new,
40-
StartRollupJobAction.Response::new,
4140
EsExecutors.DIRECT_EXECUTOR_SERVICE
4241
);
4342
}

x-pack/plugin/rollup/src/main/java/org/elasticsearch/xpack/rollup/action/TransportStopRollupAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ public TransportStopRollupAction(
5151
actionFilters,
5252
StopRollupJobAction.Request::new,
5353
StopRollupJobAction.Response::new,
54-
StopRollupJobAction.Response::new,
5554
EsExecutors.DIRECT_EXECUTOR_SERVICE
5655
);
5756
this.threadPool = threadPool;

x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportGetTransformStatsAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ public TransportGetTransformStatsAction(
8989
actionFilters,
9090
Request::new,
9191
Response::new,
92-
Response::new,
9392
EsExecutors.DIRECT_EXECUTOR_SERVICE
9493
);
9594
this.transformConfigManager = transformServices.getConfigManager();

x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportScheduleNowTransformAction.java

-7
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
import org.elasticsearch.transport.ActionNotFoundTransportException;
2929
import org.elasticsearch.transport.TransportService;
3030
import org.elasticsearch.xpack.core.XPackPlugin;
31-
import org.elasticsearch.xpack.core.XPackSettings;
32-
import org.elasticsearch.xpack.core.security.SecurityContext;
3331
import org.elasticsearch.xpack.core.transform.action.ScheduleNowTransformAction;
3432
import org.elasticsearch.xpack.core.transform.action.ScheduleNowTransformAction.Request;
3533
import org.elasticsearch.xpack.core.transform.action.ScheduleNowTransformAction.Response;
@@ -50,7 +48,6 @@ public class TransportScheduleNowTransformAction extends TransportTasksAction<Tr
5048
private static final Logger logger = LogManager.getLogger(TransportScheduleNowTransformAction.class);
5149
private final TransformConfigManager transformConfigManager;
5250
private final TransformScheduler transformScheduler;
53-
private final SecurityContext securityContext;
5451

5552
@Inject
5653
public TransportScheduleNowTransformAction(
@@ -68,15 +65,11 @@ public TransportScheduleNowTransformAction(
6865
actionFilters,
6966
Request::new,
7067
Response::new,
71-
Response::new,
7268
EsExecutors.DIRECT_EXECUTOR_SERVICE
7369
);
7470

7571
this.transformConfigManager = transformServices.getConfigManager();
7672
this.transformScheduler = transformServices.getScheduler();
77-
this.securityContext = XPackSettings.SECURITY_ENABLED.get(settings)
78-
? new SecurityContext(settings, threadPool.getThreadContext())
79-
: null;
8073
}
8174

8275
@Override

x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportStopTransformAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ public TransportStopTransformAction(
8989
actionFilters,
9090
Request::new,
9191
Response::new,
92-
Response::new,
9392
EsExecutors.DIRECT_EXECUTOR_SERVICE
9493
);
9594
this.threadPool = threadPool;

x-pack/plugin/transform/src/main/java/org/elasticsearch/xpack/transform/action/TransportUpdateTransformAction.java

-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ public TransportUpdateTransformAction(
8787
actionFilters,
8888
Request::new,
8989
Response::new,
90-
Response::new,
9190
EsExecutors.DIRECT_EXECUTOR_SERVICE
9291
);
9392

0 commit comments

Comments
 (0)