Add temporary LegacyActionRequest (#128107)

In order to remove ActionType, ActionRequest will become strongly typed,
referring to the ActionResponse type. As a precursor to that, this
commit adds a LegacyActionRequest which all existing ActionRequest
implementations now inherit from. This will allow adding the
ActionResponse type to ActionRequest in a future commit without
modifying every implementation at once.
This commit is contained in:
Ryan Ernst 2025-05-20 07:09:27 -07:00 committed by GitHub
parent c0f5e00378
commit a2b4a6f246
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
238 changed files with 682 additions and 645 deletions

View file

@ -10,10 +10,10 @@ package org.elasticsearch.ingest.common;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.HandledTransportAction; import org.elasticsearch.action.support.HandledTransportAction;
import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.client.internal.node.NodeClient;
@ -43,11 +43,11 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
public class GrokProcessorGetAction { public class GrokProcessorGetAction {
static final ActionType<GrokProcessorGetAction.Response> INSTANCE = new ActionType<>("cluster:admin/ingest/processor/grok/get"); static final ActionType<Response> INSTANCE = new ActionType<>("cluster:admin/ingest/processor/grok/get");
private GrokProcessorGetAction() {/* no instances */} private GrokProcessorGetAction() {/* no instances */}
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
private final boolean sorted; private final boolean sorted;
private final String ecsCompatibility; private final String ecsCompatibility;

View file

@ -9,9 +9,9 @@
package org.elasticsearch.script.mustache; package org.elasticsearch.script.mustache;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.CompositeIndicesRequest; import org.elasticsearch.action.CompositeIndicesRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.search.MultiSearchRequest; import org.elasticsearch.action.search.MultiSearchRequest;
import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
@ -30,7 +30,7 @@ import java.util.Objects;
import static org.elasticsearch.action.ValidateActions.addValidationError; import static org.elasticsearch.action.ValidateActions.addValidationError;
public class MultiSearchTemplateRequest extends ActionRequest implements CompositeIndicesRequest { public class MultiSearchTemplateRequest extends LegacyActionRequest implements CompositeIndicesRequest {
private int maxConcurrentSearchRequests = 0; private int maxConcurrentSearchRequests = 0;
private List<SearchTemplateRequest> requests = new ArrayList<>(); private List<SearchTemplateRequest> requests = new ArrayList<>();

View file

@ -9,9 +9,9 @@
package org.elasticsearch.script.mustache; package org.elasticsearch.script.mustache;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.CompositeIndicesRequest; import org.elasticsearch.action.CompositeIndicesRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.ParsingException;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
@ -34,7 +34,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
/** /**
* A request to execute a search based on a search template. * A request to execute a search based on a search template.
*/ */
public class SearchTemplateRequest extends ActionRequest implements CompositeIndicesRequest, ToXContentObject { public class SearchTemplateRequest extends LegacyActionRequest implements CompositeIndicesRequest, ToXContentObject {
private SearchRequest request; private SearchRequest request;
private boolean simulate = false; private boolean simulate = false;
@ -171,6 +171,7 @@ public class SearchTemplateRequest extends ActionRequest implements CompositeInd
private static final ParseField PROFILE_FIELD = new ParseField("profile"); private static final ParseField PROFILE_FIELD = new ParseField("profile");
private static final ObjectParser<SearchTemplateRequest, Void> PARSER; private static final ObjectParser<SearchTemplateRequest, Void> PARSER;
static { static {
PARSER = new ObjectParser<>("search_template"); PARSER = new ObjectParser<>("search_template");
PARSER.declareField((parser, request, s) -> request.setScriptParams(parser.map()), PARAMS_FIELD, ObjectParser.ValueType.OBJECT); PARSER.declareField((parser, request, s) -> request.setScriptParams(parser.map()), PARAMS_FIELD, ObjectParser.ValueType.OBJECT);

View file

@ -10,10 +10,10 @@
package org.elasticsearch.painless.action; package org.elasticsearch.painless.action;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.HandledTransportAction; import org.elasticsearch.action.support.HandledTransportAction;
import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.client.internal.node.NodeClient;
@ -61,7 +61,7 @@ public class PainlessContextAction {
private PainlessContextAction() {/* no instances */} private PainlessContextAction() {/* no instances */}
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
private String scriptContextName; private String scriptContextName;

View file

@ -9,9 +9,9 @@
package org.elasticsearch.index.rankeval; package org.elasticsearch.index.rankeval;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.search.SearchType; import org.elasticsearch.action.search.SearchType;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
@ -26,7 +26,7 @@ import java.util.Objects;
/** /**
* Request to perform a search ranking evaluation. * Request to perform a search ranking evaluation.
*/ */
public final class RankEvalRequest extends ActionRequest implements IndicesRequest.Replaceable { public final class RankEvalRequest extends LegacyActionRequest implements IndicesRequest.Replaceable {
private RankEvalSpec rankingEvaluationSpec; private RankEvalSpec rankingEvaluationSpec;

View file

@ -9,14 +9,14 @@
package org.elasticsearch.rest.root; package org.elasticsearch.rest.root;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.TransportAction; import org.elasticsearch.action.support.TransportAction;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException; import java.io.IOException;
public class MainRequest extends ActionRequest { public class MainRequest extends LegacyActionRequest {
@Override @Override
public ActionRequestValidationException validate() { public ActionRequestValidationException validate() {
return null; return null;

View file

@ -15,11 +15,11 @@ import org.apache.lucene.util.BytesRef;
import org.elasticsearch.ESNetty4IntegTestCase; import org.elasticsearch.ESNetty4IntegTestCase;
import org.elasticsearch.ElasticsearchException; import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionRunnable; import org.elasticsearch.action.ActionRunnable;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.CountDownActionListener; import org.elasticsearch.action.support.CountDownActionListener;
import org.elasticsearch.action.support.SubscribableListener; import org.elasticsearch.action.support.SubscribableListener;
@ -337,14 +337,14 @@ public class Netty4ChunkedContinuationsIT extends ESNetty4IntegTestCase {
static final String ROUTE = "/_test/yields_continuations"; static final String ROUTE = "/_test/yields_continuations";
static final String FAIL_INDEX_PARAM = "fail_index"; static final String FAIL_INDEX_PARAM = "fail_index";
private static final ActionType<YieldsContinuationsPlugin.Response> TYPE = new ActionType<>("test:yields_continuations"); private static final ActionType<Response> TYPE = new ActionType<>("test:yields_continuations");
@Override @Override
public Collection<ActionHandler> getActions() { public Collection<ActionHandler> getActions() {
return List.of(new ActionHandler(TYPE, TransportYieldsContinuationsAction.class)); return List.of(new ActionHandler(TYPE, TransportYieldsContinuationsAction.class));
} }
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
final int failIndex; final int failIndex;
public Request(int failIndex) { public Request(int failIndex) {
@ -525,7 +525,7 @@ public class Netty4ChunkedContinuationsIT extends ESNetty4IntegTestCase {
return List.of(new ActionHandler(TYPE, TransportInfiniteContinuationsAction.class)); return List.of(new ActionHandler(TYPE, TransportInfiniteContinuationsAction.class));
} }
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
@Override @Override
public ActionRequestValidationException validate() { public ActionRequestValidationException validate() {
return null; return null;

View file

@ -14,11 +14,11 @@ import org.elasticsearch.ResourceNotFoundException;
import org.elasticsearch.action.ActionFuture; import org.elasticsearch.action.ActionFuture;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionListenerResponseHandler; import org.elasticsearch.action.ActionListenerResponseHandler;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LatchedActionListener; import org.elasticsearch.action.LatchedActionListener;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse; import org.elasticsearch.action.admin.cluster.node.tasks.list.ListTasksResponse;
import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.GroupedActionListener; import org.elasticsearch.action.support.GroupedActionListener;
@ -118,6 +118,7 @@ public class CancellableTasksIT extends ESIntegTestCase {
/** /**
* Allow some parts of the request to be completed * Allow some parts of the request to be completed
*
* @return a pending child requests * @return a pending child requests
*/ */
static Set<TestRequest> allowPartialRequest(TestRequest request) throws Exception { static Set<TestRequest> allowPartialRequest(TestRequest request) throws Exception {
@ -418,7 +419,7 @@ public class CancellableTasksIT extends ESIntegTestCase {
} }
} }
static class TestRequest extends ActionRequest { static class TestRequest extends LegacyActionRequest {
final int id; final int id;
final DiscoveryNode node; final DiscoveryNode node;
final List<TestRequest> subRequests; final List<TestRequest> subRequests;

View file

@ -10,11 +10,11 @@
package org.elasticsearch.action.admin.cluster.tasks; package org.elasticsearch.action.admin.cluster.tasks;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionRunnable; import org.elasticsearch.action.ActionRunnable;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.HandledTransportAction; import org.elasticsearch.action.support.HandledTransportAction;
import org.elasticsearch.action.support.PlainActionFuture; import org.elasticsearch.action.support.PlainActionFuture;
@ -142,7 +142,7 @@ public class ListTasksIT extends ESSingleNodeTestCase {
} }
} }
public static class TestRequest extends ActionRequest { public static class TestRequest extends LegacyActionRequest {
@Override @Override
public ActionRequestValidationException validate() { public ActionRequestValidationException validate() {
return null; return null;

View file

@ -16,10 +16,10 @@ import org.apache.lucene.search.TopDocs;
import org.elasticsearch.TransportVersion; import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.search.SearchPhaseController; import org.elasticsearch.action.search.SearchPhaseController;
import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.HandledTransportAction; import org.elasticsearch.action.support.HandledTransportAction;
@ -142,7 +142,7 @@ public class MockedRequestActionBasedRerankerIT extends AbstractRerankerIT {
} }
} }
public static class TestRerankingActionRequest extends ActionRequest { public static class TestRerankingActionRequest extends LegacyActionRequest {
private final List<String> docFeatures; private final List<String> docFeatures;

View file

@ -0,0 +1,30 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the "Elastic License
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
* Public License v 1"; you may not use this file except in compliance with, at
* your election, the "Elastic License 2.0", the "GNU Affero General Public
* License v3.0 only", or the "Server Side Public License, v 1".
*/
package org.elasticsearch.action;
import org.elasticsearch.common.io.stream.StreamInput;
import java.io.IOException;
/**
* An action request with an unspecified response type.
*
* @deprecated Use {@link ActionRequest} with a specific {@link ActionResponse} type.
*/
@Deprecated
public abstract class LegacyActionRequest extends ActionRequest {
public LegacyActionRequest() {
super();
}
public LegacyActionRequest(StreamInput in) throws IOException {
super(in);
}
}

View file

@ -10,10 +10,10 @@
package org.elasticsearch.action.admin.cluster.coordination; package org.elasticsearch.action.admin.cluster.coordination;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.HandledTransportAction; import org.elasticsearch.action.support.HandledTransportAction;
import org.elasticsearch.cluster.coordination.ClusterFormationFailureHelper; import org.elasticsearch.cluster.coordination.ClusterFormationFailureHelper;
@ -41,7 +41,7 @@ public class ClusterFormationInfoAction extends ActionType<ClusterFormationInfoA
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
public Request() {} public Request() {}
@ -105,7 +105,7 @@ public class ClusterFormationInfoAction extends ActionType<ClusterFormationInfoA
if (o == null || getClass() != o.getClass()) { if (o == null || getClass() != o.getClass()) {
return false; return false;
} }
ClusterFormationInfoAction.Response response = (ClusterFormationInfoAction.Response) o; Response response = (Response) o;
return clusterFormationState.equals(response.clusterFormationState); return clusterFormationState.equals(response.clusterFormationState);
} }
@ -118,9 +118,7 @@ public class ClusterFormationInfoAction extends ActionType<ClusterFormationInfoA
/** /**
* This transport action fetches the ClusterFormationState from a remote node. * This transport action fetches the ClusterFormationState from a remote node.
*/ */
public static class TransportAction extends HandledTransportAction< public static class TransportAction extends HandledTransportAction<Request, Response> {
ClusterFormationInfoAction.Request,
ClusterFormationInfoAction.Response> {
private final Coordinator coordinator; private final Coordinator coordinator;
@Inject @Inject
@ -129,19 +127,15 @@ public class ClusterFormationInfoAction extends ActionType<ClusterFormationInfoA
ClusterFormationInfoAction.NAME, ClusterFormationInfoAction.NAME,
transportService, transportService,
actionFilters, actionFilters,
ClusterFormationInfoAction.Request::new, Request::new,
transportService.getThreadPool().executor(ThreadPool.Names.CLUSTER_COORDINATION) transportService.getThreadPool().executor(ThreadPool.Names.CLUSTER_COORDINATION)
); );
this.coordinator = coordinator; this.coordinator = coordinator;
} }
@Override @Override
protected void doExecute( protected void doExecute(Task task, Request request, ActionListener<Response> listener) {
Task task, listener.onResponse(new Response(coordinator.getClusterFormationState()));
ClusterFormationInfoAction.Request request,
ActionListener<ClusterFormationInfoAction.Response> listener
) {
listener.onResponse(new ClusterFormationInfoAction.Response(coordinator.getClusterFormationState()));
} }
} }

View file

@ -10,10 +10,10 @@
package org.elasticsearch.action.admin.cluster.coordination; package org.elasticsearch.action.admin.cluster.coordination;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.HandledTransportAction; import org.elasticsearch.action.support.HandledTransportAction;
import org.elasticsearch.cluster.coordination.CoordinationDiagnosticsService; import org.elasticsearch.cluster.coordination.CoordinationDiagnosticsService;
@ -42,7 +42,7 @@ public class CoordinationDiagnosticsAction extends ActionType<CoordinationDiagno
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
final boolean explain; // Non-private for testing final boolean explain; // Non-private for testing
public Request(boolean explain) { public Request(boolean explain) {
@ -104,7 +104,7 @@ public class CoordinationDiagnosticsAction extends ActionType<CoordinationDiagno
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
CoordinationDiagnosticsAction.Response response = (CoordinationDiagnosticsAction.Response) o; Response response = (Response) o;
return result.equals(response.result); return result.equals(response.result);
} }
@ -130,14 +130,14 @@ public class CoordinationDiagnosticsAction extends ActionType<CoordinationDiagno
CoordinationDiagnosticsAction.NAME, CoordinationDiagnosticsAction.NAME,
transportService, transportService,
actionFilters, actionFilters,
CoordinationDiagnosticsAction.Request::new, Request::new,
transportService.getThreadPool().executor(ThreadPool.Names.CLUSTER_COORDINATION) transportService.getThreadPool().executor(ThreadPool.Names.CLUSTER_COORDINATION)
); );
this.coordinationDiagnosticsService = coordinationDiagnosticsService; this.coordinationDiagnosticsService = coordinationDiagnosticsService;
} }
@Override @Override
protected void doExecute(Task task, CoordinationDiagnosticsAction.Request request, ActionListener<Response> listener) { protected void doExecute(Task task, Request request, ActionListener<Response> listener) {
listener.onResponse(new Response(coordinationDiagnosticsService.diagnoseMasterStability(request.explain))); listener.onResponse(new Response(coordinationDiagnosticsService.diagnoseMasterStability(request.explain)));
} }
} }

View file

@ -10,10 +10,10 @@
package org.elasticsearch.action.admin.cluster.coordination; package org.elasticsearch.action.admin.cluster.coordination;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.HandledTransportAction; import org.elasticsearch.action.support.HandledTransportAction;
import org.elasticsearch.cluster.coordination.MasterHistoryService; import org.elasticsearch.cluster.coordination.MasterHistoryService;
@ -42,7 +42,7 @@ public class MasterHistoryAction extends ActionType<MasterHistoryAction.Response
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
public Request() {} public Request() {}
@ -94,6 +94,7 @@ public class MasterHistoryAction extends ActionType<MasterHistoryAction.Response
/** /**
* Returns an ordered list of DiscoveryNodes that the node responding has seen to be master nodes over the last 30 minutes, ordered * Returns an ordered list of DiscoveryNodes that the node responding has seen to be master nodes over the last 30 minutes, ordered
* oldest first. Note that these DiscoveryNodes can be null. * oldest first. Note that these DiscoveryNodes can be null.
*
* @return a list of DiscoveryNodes that the node responding has seen to be master nodes over the last 30 minutes, ordered oldest * @return a list of DiscoveryNodes that the node responding has seen to be master nodes over the last 30 minutes, ordered oldest
* first * first
*/ */
@ -113,7 +114,7 @@ public class MasterHistoryAction extends ActionType<MasterHistoryAction.Response
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
MasterHistoryAction.Response response = (MasterHistoryAction.Response) o; Response response = (Response) o;
return masterHistory.equals(response.masterHistory); return masterHistory.equals(response.masterHistory);
} }
@ -136,8 +137,8 @@ public class MasterHistoryAction extends ActionType<MasterHistoryAction.Response
} }
@Override @Override
protected void doExecute(Task task, MasterHistoryAction.Request request, ActionListener<Response> listener) { protected void doExecute(Task task, Request request, ActionListener<Response> listener) {
listener.onResponse(new MasterHistoryAction.Response(masterHistoryService.getLocalMasterHistory().getRawNodes())); listener.onResponse(new Response(masterHistoryService.getLocalMasterHistory().getRawNodes()));
} }
} }

View file

@ -9,8 +9,8 @@
package org.elasticsearch.action.admin.cluster.node.tasks.get; package org.elasticsearch.action.admin.cluster.node.tasks.get;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.TimeValue;
@ -23,7 +23,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
/** /**
* A request to get node tasks * A request to get node tasks
*/ */
public class GetTaskRequest extends ActionRequest { public class GetTaskRequest extends LegacyActionRequest {
private TaskId taskId = TaskId.EMPTY_TASK_ID; private TaskId taskId = TaskId.EMPTY_TASK_ID;
private boolean waitForCompletion = false; private boolean waitForCompletion = false;
private TimeValue timeout = null; private TimeValue timeout = null;

View file

@ -10,10 +10,10 @@
package org.elasticsearch.action.admin.cluster.remote; package org.elasticsearch.action.admin.cluster.remote;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.RemoteClusterActionType; import org.elasticsearch.action.RemoteClusterActionType;
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoMetrics; import org.elasticsearch.action.admin.cluster.node.info.NodesInfoMetrics;
import org.elasticsearch.action.admin.cluster.node.info.NodesInfoRequest; import org.elasticsearch.action.admin.cluster.node.info.NodesInfoRequest;
@ -40,13 +40,10 @@ import java.util.Objects;
public class RemoteClusterNodesAction { public class RemoteClusterNodesAction {
public static final String NAME = "cluster:internal/remote_cluster/nodes"; public static final String NAME = "cluster:internal/remote_cluster/nodes";
public static final ActionType<RemoteClusterNodesAction.Response> TYPE = new ActionType<>(NAME); public static final ActionType<Response> TYPE = new ActionType<>(NAME);
public static final RemoteClusterActionType<Response> REMOTE_TYPE = new RemoteClusterActionType<>( public static final RemoteClusterActionType<Response> REMOTE_TYPE = new RemoteClusterActionType<>(NAME, Response::new);
NAME,
RemoteClusterNodesAction.Response::new
);
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
public static final Request ALL_NODES = new Request(false); public static final Request ALL_NODES = new Request(false);
public static final Request REMOTE_CLUSTER_SERVER_NODES = new Request(true); public static final Request REMOTE_CLUSTER_SERVER_NODES = new Request(true);
private final boolean remoteClusterServer; private final boolean remoteClusterServer;

View file

@ -9,13 +9,13 @@
package org.elasticsearch.action.admin.cluster.remote; package org.elasticsearch.action.admin.cluster.remote;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import java.io.IOException; import java.io.IOException;
public final class RemoteInfoRequest extends ActionRequest { public final class RemoteInfoRequest extends LegacyActionRequest {
public RemoteInfoRequest() {} public RemoteInfoRequest() {}

View file

@ -10,8 +10,8 @@
package org.elasticsearch.action.admin.cluster.stats; package org.elasticsearch.action.admin.cluster.stats;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
@ -20,7 +20,7 @@ import java.io.IOException;
/** /**
* A request to get cluster level stats from the remote cluster. * A request to get cluster level stats from the remote cluster.
*/ */
public class RemoteClusterStatsRequest extends ActionRequest { public class RemoteClusterStatsRequest extends LegacyActionRequest {
public RemoteClusterStatsRequest(StreamInput in) throws IOException { public RemoteClusterStatsRequest(StreamInput in) throws IOException {
super(in); super(in);
} }

View file

@ -8,13 +8,13 @@
*/ */
package org.elasticsearch.action.admin.cluster.storedscripts; package org.elasticsearch.action.admin.cluster.storedscripts;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import java.io.IOException; import java.io.IOException;
public class GetScriptContextRequest extends ActionRequest { public class GetScriptContextRequest extends LegacyActionRequest {
public GetScriptContextRequest() { public GetScriptContextRequest() {
super(); super();
} }

View file

@ -9,13 +9,13 @@
package org.elasticsearch.action.admin.cluster.storedscripts; package org.elasticsearch.action.admin.cluster.storedscripts;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import java.io.IOException; import java.io.IOException;
public class GetScriptLanguageRequest extends ActionRequest { public class GetScriptLanguageRequest extends LegacyActionRequest {
public GetScriptLanguageRequest() { public GetScriptLanguageRequest() {
super(); super();
} }

View file

@ -10,9 +10,9 @@
package org.elasticsearch.action.admin.indices.mapping.get; package org.elasticsearch.action.admin.indices.mapping.get;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
@ -23,11 +23,11 @@ import java.util.Arrays;
/** /**
* Request the mappings of specific fields * Request the mappings of specific fields
* * <p>
* Note: there is a new class with the same name for the Java HLRC that uses a typeless format. * Note: there is a new class with the same name for the Java HLRC that uses a typeless format.
* Any changes done to this class should go to that client class as well. * Any changes done to this class should go to that client class as well.
*/ */
public class GetFieldMappingsRequest extends ActionRequest implements IndicesRequest.Replaceable { public class GetFieldMappingsRequest extends LegacyActionRequest implements IndicesRequest.Replaceable {
private String[] fields = Strings.EMPTY_ARRAY; private String[] fields = Strings.EMPTY_ARRAY;
@ -84,7 +84,9 @@ public class GetFieldMappingsRequest extends ActionRequest implements IndicesReq
return true; return true;
} }
/** @param fields a list of fields to retrieve the mapping for */ /**
* @param fields a list of fields to retrieve the mapping for
*/
public GetFieldMappingsRequest fields(String... fields) { public GetFieldMappingsRequest fields(String... fields) {
this.fields = fields; this.fields = fields;
return this; return this;
@ -98,7 +100,9 @@ public class GetFieldMappingsRequest extends ActionRequest implements IndicesReq
return includeDefaults; return includeDefaults;
} }
/** Indicates whether default mapping settings should be returned */ /**
* Indicates whether default mapping settings should be returned
*/
public GetFieldMappingsRequest includeDefaults(boolean includeDefaults) { public GetFieldMappingsRequest includeDefaults(boolean includeDefaults) {
this.includeDefaults = includeDefaults; this.includeDefaults = includeDefaults;
return this; return this;

View file

@ -11,9 +11,9 @@ package org.elasticsearch.action.admin.indices.resolve;
import org.elasticsearch.TransportVersion; import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
@ -29,7 +29,7 @@ import java.util.Arrays;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
public class ResolveClusterActionRequest extends ActionRequest implements IndicesRequest.Replaceable { public class ResolveClusterActionRequest extends LegacyActionRequest implements IndicesRequest.Replaceable {
public static final IndicesOptions DEFAULT_INDICES_OPTIONS = IndicesOptions.strictExpandOpen(); public static final IndicesOptions DEFAULT_INDICES_OPTIONS = IndicesOptions.strictExpandOpen();
public static final String TRANSPORT_VERSION_ERROR_MESSAGE_PREFIX = "ResolveClusterAction requires at least version"; public static final String TRANSPORT_VERSION_ERROR_MESSAGE_PREFIX = "ResolveClusterAction requires at least version";

View file

@ -10,11 +10,11 @@
package org.elasticsearch.action.admin.indices.resolve; package org.elasticsearch.action.admin.indices.resolve;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.OriginalIndices; import org.elasticsearch.action.OriginalIndices;
import org.elasticsearch.action.RemoteClusterActionType; import org.elasticsearch.action.RemoteClusterActionType;
import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.ActionFilters;
@ -75,7 +75,7 @@ public class ResolveIndexAction extends ActionType<ResolveIndexAction.Response>
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest implements IndicesRequest.Replaceable { public static class Request extends LegacyActionRequest implements IndicesRequest.Replaceable {
public static final IndicesOptions DEFAULT_INDICES_OPTIONS = IndicesOptions.strictExpandOpen(); public static final IndicesOptions DEFAULT_INDICES_OPTIONS = IndicesOptions.strictExpandOpen();

View file

@ -16,6 +16,7 @@ import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.CompositeIndicesRequest; import org.elasticsearch.action.CompositeIndicesRequest;
import org.elasticsearch.action.DocWriteRequest; import org.elasticsearch.action.DocWriteRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.delete.DeleteRequest; import org.elasticsearch.action.delete.DeleteRequest;
import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.action.support.ActiveShardCount;
@ -56,7 +57,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
* Note that we only support refresh on the bulk request not per item. * Note that we only support refresh on the bulk request not per item.
* @see org.elasticsearch.client.internal.Client#bulk(BulkRequest) * @see org.elasticsearch.client.internal.Client#bulk(BulkRequest)
*/ */
public class BulkRequest extends ActionRequest public class BulkRequest extends LegacyActionRequest
implements implements
CompositeIndicesRequest, CompositeIndicesRequest,
WriteRequest<BulkRequest>, WriteRequest<BulkRequest>,

View file

@ -10,9 +10,9 @@
package org.elasticsearch.action.fieldcaps; package org.elasticsearch.action.fieldcaps;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.OriginalIndices; import org.elasticsearch.action.OriginalIndices;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
@ -30,7 +30,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
class FieldCapabilitiesNodeRequest extends ActionRequest implements IndicesRequest { class FieldCapabilitiesNodeRequest extends LegacyActionRequest implements IndicesRequest {
private final List<ShardId> shardIds; private final List<ShardId> shardIds;
private final String[] fields; private final String[] fields;

View file

@ -10,9 +10,9 @@
package org.elasticsearch.action.fieldcaps; package org.elasticsearch.action.fieldcaps;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.ValidateActions; import org.elasticsearch.action.ValidateActions;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
@ -34,7 +34,7 @@ import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.Set; import java.util.Set;
public final class FieldCapabilitiesRequest extends ActionRequest implements IndicesRequest.Replaceable, ToXContentObject { public final class FieldCapabilitiesRequest extends LegacyActionRequest implements IndicesRequest.Replaceable, ToXContentObject {
public static final String NAME = "field_caps_request"; public static final String NAME = "field_caps_request";
public static final IndicesOptions DEFAULT_INDICES_OPTIONS = IndicesOptions.strictExpandOpenAndForbidClosed(); public static final IndicesOptions DEFAULT_INDICES_OPTIONS = IndicesOptions.strictExpandOpenAndForbidClosed();

View file

@ -11,10 +11,10 @@ package org.elasticsearch.action.get;
import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.ElasticsearchParseException;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.CompositeIndicesRequest; import org.elasticsearch.action.CompositeIndicesRequest;
import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.RealtimeRequest; import org.elasticsearch.action.RealtimeRequest;
import org.elasticsearch.action.ValidateActions; import org.elasticsearch.action.ValidateActions;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
@ -45,7 +45,7 @@ import java.util.Locale;
// It's not possible to suppress teh warning at #realtime(boolean) at a method-level. // It's not possible to suppress teh warning at #realtime(boolean) at a method-level.
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public class MultiGetRequest extends ActionRequest public class MultiGetRequest extends LegacyActionRequest
implements implements
Iterable<MultiGetRequest.Item>, Iterable<MultiGetRequest.Item>,
CompositeIndicesRequest, CompositeIndicesRequest,

View file

@ -12,10 +12,10 @@ package org.elasticsearch.action.get;
import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.BytesRef;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.HandledTransportAction; import org.elasticsearch.action.support.HandledTransportAction;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
@ -85,7 +85,7 @@ public class TransportGetFromTranslogAction extends HandledTransportAction<
}); });
} }
public static class Request extends ActionRequest implements IndicesRequest { public static class Request extends LegacyActionRequest implements IndicesRequest {
private final GetRequest getRequest; private final GetRequest getRequest;
private final ShardId shardId; private final ShardId shardId;

View file

@ -11,9 +11,9 @@ package org.elasticsearch.action.get;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.HandledTransportAction; import org.elasticsearch.action.support.HandledTransportAction;
import org.elasticsearch.action.support.TransportActions; import org.elasticsearch.action.support.TransportActions;
@ -106,7 +106,7 @@ public class TransportShardMultiGetFomTranslogAction extends HandledTransportAct
}); });
} }
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
private final MultiGetShardRequest multiGetShardRequest; private final MultiGetShardRequest multiGetShardRequest;
private final ShardId shardId; private final ShardId shardId;

View file

@ -9,8 +9,8 @@
package org.elasticsearch.action.ingest; package org.elasticsearch.action.ingest;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.cluster.metadata.ProjectId; import org.elasticsearch.cluster.metadata.ProjectId;
import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.bytes.ReleasableBytesReference; import org.elasticsearch.common.bytes.ReleasableBytesReference;
@ -39,7 +39,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
public class SimulatePipelineRequest extends ActionRequest implements ToXContentObject { public class SimulatePipelineRequest extends LegacyActionRequest implements ToXContentObject {
private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(SimulatePipelineRequest.class); private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(SimulatePipelineRequest.class);
private String id; private String id;
private boolean verbose; private boolean verbose;

View file

@ -9,8 +9,8 @@
package org.elasticsearch.action.search; package org.elasticsearch.action.search;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.xcontent.ToXContentObject;
@ -24,7 +24,7 @@ import java.util.List;
import static org.elasticsearch.action.ValidateActions.addValidationError; import static org.elasticsearch.action.ValidateActions.addValidationError;
public class ClearScrollRequest extends ActionRequest implements ToXContentObject { public class ClearScrollRequest extends LegacyActionRequest implements ToXContentObject {
private List<String> scrollIds; private List<String> scrollIds;

View file

@ -9,8 +9,8 @@
package org.elasticsearch.action.search; package org.elasticsearch.action.search;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.ValidateActions; import org.elasticsearch.action.ValidateActions;
import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.bytes.BytesReference;
@ -24,7 +24,7 @@ import org.elasticsearch.xcontent.XContentParser;
import java.io.IOException; import java.io.IOException;
import java.util.Base64; import java.util.Base64;
public class ClosePointInTimeRequest extends ActionRequest implements ToXContentObject { public class ClosePointInTimeRequest extends LegacyActionRequest implements ToXContentObject {
private static final ParseField ID = new ParseField("id"); private static final ParseField ID = new ParseField("id");
private final BytesReference id; private final BytesReference id;

View file

@ -9,9 +9,9 @@
package org.elasticsearch.action.search; package org.elasticsearch.action.search;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.CompositeIndicesRequest; import org.elasticsearch.action.CompositeIndicesRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.common.CheckedBiConsumer; import org.elasticsearch.common.CheckedBiConsumer;
import org.elasticsearch.common.TriFunction; import org.elasticsearch.common.TriFunction;
@ -46,7 +46,7 @@ import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeSt
/** /**
* A multi search API request. * A multi search API request.
*/ */
public class MultiSearchRequest extends ActionRequest implements CompositeIndicesRequest { public class MultiSearchRequest extends LegacyActionRequest implements CompositeIndicesRequest {
public static final int MAX_CONCURRENT_SEARCH_REQUESTS_DEFAULT = 0; public static final int MAX_CONCURRENT_SEARCH_REQUESTS_DEFAULT = 0;
private int maxConcurrentSearchRequests = 0; private int maxConcurrentSearchRequests = 0;

View file

@ -10,9 +10,9 @@
package org.elasticsearch.action.search; package org.elasticsearch.action.search;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
@ -29,7 +29,7 @@ import java.util.Objects;
import static org.elasticsearch.action.ValidateActions.addValidationError; import static org.elasticsearch.action.ValidateActions.addValidationError;
public final class OpenPointInTimeRequest extends ActionRequest implements IndicesRequest.Replaceable { public final class OpenPointInTimeRequest extends LegacyActionRequest implements IndicesRequest.Replaceable {
private String[] indices; private String[] indices;
private IndicesOptions indicesOptions = DEFAULT_INDICES_OPTIONS; private IndicesOptions indicesOptions = DEFAULT_INDICES_OPTIONS;

View file

@ -11,10 +11,11 @@ package org.elasticsearch.action.search;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.Version; import org.elasticsearch.Version;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.client.internal.Client;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
@ -45,14 +46,14 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
/** /**
* A request to execute search against one or more indices (or all). * A request to execute search against one or more indices (or all).
* <p> * <p>
* Note, the search {@link #source(org.elasticsearch.search.builder.SearchSourceBuilder)} * Note, the search {@link #source(SearchSourceBuilder)}
* is required. The search source is the different search options, including aggregations and such. * is required. The search source is the different search options, including aggregations and such.
* </p> * </p>
* *
* @see org.elasticsearch.client.internal.Client#search(SearchRequest) * @see Client#search(SearchRequest)
* @see SearchResponse * @see SearchResponse
*/ */
public class SearchRequest extends ActionRequest implements IndicesRequest.Replaceable, Rewriteable<SearchRequest> { public class SearchRequest extends LegacyActionRequest implements IndicesRequest.Replaceable, Rewriteable<SearchRequest> {
public static final ToXContent.Params FORMAT_PARAMS = new ToXContent.MapParams(Collections.singletonMap("pretty", "false")); public static final ToXContent.Params FORMAT_PARAMS = new ToXContent.MapParams(Collections.singletonMap("pretty", "false"));
@ -629,7 +630,7 @@ public class SearchRequest extends ActionRequest implements IndicesRequest.Repla
* the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for * the search request expands to exceeds the threshold. This filter roundtrip can limit the number of shards significantly if for
* instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard * instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard
* bounds and the query are disjoint. * bounds and the query are disjoint.
* * <p>
* When unspecified, the pre-filter phase is executed if any of these conditions is met: * When unspecified, the pre-filter phase is executed if any of these conditions is met:
* <ul> * <ul>
* <li>The request targets more than 128 shards</li> * <li>The request targets more than 128 shards</li>
@ -650,7 +651,7 @@ public class SearchRequest extends ActionRequest implements IndicesRequest.Repla
* This filter roundtrip can limit the number of shards significantly if for * This filter roundtrip can limit the number of shards significantly if for
* instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard * instance a shard can not match any documents based on its rewrite method ie. if date filters are mandatory to match but the shard
* bounds and the query are disjoint. * bounds and the query are disjoint.
* * <p>
* When unspecified, the pre-filter phase is executed if any of these conditions is met: * When unspecified, the pre-filter phase is executed if any of these conditions is met:
* <ul> * <ul>
* <li>The request targets more than 128 shards</li> * <li>The request targets more than 128 shards</li>

View file

@ -9,8 +9,8 @@
package org.elasticsearch.action.search; package org.elasticsearch.action.search;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.TimeValue;
@ -26,7 +26,7 @@ import java.util.Objects;
import static org.elasticsearch.action.ValidateActions.addValidationError; import static org.elasticsearch.action.ValidateActions.addValidationError;
public class SearchScrollRequest extends ActionRequest implements ToXContentObject { public class SearchScrollRequest extends LegacyActionRequest implements ToXContentObject {
private String scrollId; private String scrollId;
private TimeValue scroll; private TimeValue scroll;

View file

@ -9,9 +9,9 @@
package org.elasticsearch.action.search; package org.elasticsearch.action.search;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
@ -28,7 +28,7 @@ import java.util.Objects;
/** /**
* A request to find the list of target shards that might match the query for the given target indices. * A request to find the list of target shards that might match the query for the given target indices.
*/ */
public final class SearchShardsRequest extends ActionRequest implements IndicesRequest.Replaceable { public final class SearchShardsRequest extends LegacyActionRequest implements IndicesRequest.Replaceable {
private String[] indices; private String[] indices;
private final IndicesOptions indicesOptions; private final IndicesOptions indicesOptions;
@Nullable @Nullable

View file

@ -9,9 +9,9 @@
package org.elasticsearch.action.support.broadcast; package org.elasticsearch.action.support.broadcast;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
@ -20,7 +20,7 @@ import org.elasticsearch.core.TimeValue;
import java.io.IOException; import java.io.IOException;
public class BroadcastRequest<Request extends BroadcastRequest<Request>> extends ActionRequest implements IndicesRequest.Replaceable { public class BroadcastRequest<Request extends BroadcastRequest<Request>> extends LegacyActionRequest implements IndicesRequest.Replaceable {
public static final IndicesOptions DEFAULT_INDICES_OPTIONS = IndicesOptions.strictExpandOpenAndForbidClosed(); public static final IndicesOptions DEFAULT_INDICES_OPTIONS = IndicesOptions.strictExpandOpenAndForbidClosed();

View file

@ -10,9 +10,9 @@
package org.elasticsearch.action.support.broadcast.unpromotable; package org.elasticsearch.action.support.broadcast.unpromotable;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.cluster.routing.IndexShardRoutingTable; import org.elasticsearch.cluster.routing.IndexShardRoutingTable;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
@ -29,7 +29,7 @@ import static org.elasticsearch.action.support.IndicesOptions.strictSingleIndexN
/** /**
* A request that is broadcast to the unpromotable assigned replicas of a primary. * A request that is broadcast to the unpromotable assigned replicas of a primary.
*/ */
public class BroadcastUnpromotableRequest extends ActionRequest implements IndicesRequest { public class BroadcastUnpromotableRequest extends LegacyActionRequest implements IndicesRequest {
/** /**
* Holds the index shard routing table that will be used by {@link TransportBroadcastUnpromotableAction} to broadcast the requests to * Holds the index shard routing table that will be used by {@link TransportBroadcastUnpromotableAction} to broadcast the requests to

View file

@ -10,9 +10,11 @@
package org.elasticsearch.action.support.local; package org.elasticsearch.action.support.local;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.TransportAction; import org.elasticsearch.action.support.TransportAction;
import org.elasticsearch.action.support.master.MasterNodeReadRequest;
import org.elasticsearch.action.support.master.MasterNodeRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.TimeValue;
@ -24,7 +26,7 @@ import java.util.Objects;
/** /**
* A base request for actions that are executed locally on the node that receives the request. * A base request for actions that are executed locally on the node that receives the request.
*/ */
public abstract class LocalClusterStateRequest extends ActionRequest { public abstract class LocalClusterStateRequest extends LegacyActionRequest {
/** /**
* The timeout for waiting until the cluster is unblocked. * The timeout for waiting until the cluster is unblocked.
@ -38,7 +40,7 @@ public abstract class LocalClusterStateRequest extends ActionRequest {
/** /**
* This constructor exists solely for BwC purposes. It should exclusively be used by requests that used to extend * This constructor exists solely for BwC purposes. It should exclusively be used by requests that used to extend
* {@link org.elasticsearch.action.support.master.MasterNodeReadRequest} and still need to be able to serialize incoming request. * {@link MasterNodeReadRequest} and still need to be able to serialize incoming request.
*/ */
@UpdateForV10(owner = UpdateForV10.Owner.DISTRIBUTED_COORDINATION) @UpdateForV10(owner = UpdateForV10.Owner.DISTRIBUTED_COORDINATION)
protected LocalClusterStateRequest(StreamInput in) throws IOException { protected LocalClusterStateRequest(StreamInput in) throws IOException {
@ -47,7 +49,7 @@ public abstract class LocalClusterStateRequest extends ActionRequest {
/** /**
* This constructor exists solely for BwC purposes. It should exclusively be used by requests that used to extend * This constructor exists solely for BwC purposes. It should exclusively be used by requests that used to extend
* {@link org.elasticsearch.action.support.master.MasterNodeRequest} and still need to be able to serialize incoming request. * {@link MasterNodeRequest} and still need to be able to serialize incoming request.
*/ */
@UpdateForV10(owner = UpdateForV10.Owner.DISTRIBUTED_COORDINATION) @UpdateForV10(owner = UpdateForV10.Owner.DISTRIBUTED_COORDINATION)
protected LocalClusterStateRequest(StreamInput in, boolean readLocal) throws IOException { protected LocalClusterStateRequest(StreamInput in, boolean readLocal) throws IOException {

View file

@ -10,10 +10,11 @@
package org.elasticsearch.action.support.master; package org.elasticsearch.action.support.master;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.TimeValue;
import org.elasticsearch.rest.RestUtils;
import java.io.IOException; import java.io.IOException;
import java.util.Objects; import java.util.Objects;
@ -21,7 +22,7 @@ import java.util.Objects;
/** /**
* A based request for master based operation. * A based request for master based operation.
*/ */
public abstract class MasterNodeRequest<Request extends MasterNodeRequest<Request>> extends ActionRequest { public abstract class MasterNodeRequest<Request extends MasterNodeRequest<Request>> extends LegacyActionRequest {
/** /**
* The default timeout for master-node requests. It's super-trappy to have such a default, because it makes it all too easy to forget * The default timeout for master-node requests. It's super-trappy to have such a default, because it makes it all too easy to forget
@ -29,7 +30,7 @@ public abstract class MasterNodeRequest<Request extends MasterNodeRequest<Reques
* that is struggling to process cluster state updates fast enough, and it's a disaster if we cannot extend the master-node timeout in * that is struggling to process cluster state updates fast enough, and it's a disaster if we cannot extend the master-node timeout in
* those cases. We shouldn't use this any more and should work towards removing it. * those cases. We shouldn't use this any more and should work towards removing it.
* <p> * <p>
* For requests which originate in the REST layer, use {@link org.elasticsearch.rest.RestUtils#getMasterNodeTimeout} to determine the * For requests which originate in the REST layer, use {@link RestUtils#getMasterNodeTimeout} to determine the
* timeout. * timeout.
* <p> * <p>
* For internally-generated requests, choose an appropriate timeout. Often this will be {@link #INFINITE_MASTER_NODE_TIMEOUT}, since * For internally-generated requests, choose an appropriate timeout. Often this will be {@link #INFINITE_MASTER_NODE_TIMEOUT}, since
@ -60,7 +61,7 @@ public abstract class MasterNodeRequest<Request extends MasterNodeRequest<Reques
* <ul> * <ul>
* <li> * <li>
* For requests which originate in the REST layer, use * For requests which originate in the REST layer, use
* {@link org.elasticsearch.rest.RestUtils#getMasterNodeTimeout} to determine the timeout. * {@link RestUtils#getMasterNodeTimeout} to determine the timeout.
* </li> * </li>
* <li> * <li>
* For internally-generated requests, choose an appropriate timeout. Often this will be an infinite * For internally-generated requests, choose an appropriate timeout. Often this will be an infinite
@ -109,7 +110,7 @@ public abstract class MasterNodeRequest<Request extends MasterNodeRequest<Reques
* Specifies how long to wait when the master has not been discovered yet, or is disconnected, or is busy processing other tasks. The * Specifies how long to wait when the master has not been discovered yet, or is disconnected, or is busy processing other tasks. The
* value {@link #INFINITE_MASTER_NODE_TIMEOUT} means to wait forever. * value {@link #INFINITE_MASTER_NODE_TIMEOUT} means to wait forever.
* <p> * <p>
* For requests which originate in the REST layer, use {@link org.elasticsearch.rest.RestUtils#getMasterNodeTimeout} to determine the * For requests which originate in the REST layer, use {@link RestUtils#getMasterNodeTimeout} to determine the
* timeout. * timeout.
* <p> * <p>
* For internally-generated requests, choose an appropriate timeout. Often this will be {@link #INFINITE_MASTER_NODE_TIMEOUT} since * For internally-generated requests, choose an appropriate timeout. Often this will be {@link #INFINITE_MASTER_NODE_TIMEOUT} since

View file

@ -9,8 +9,8 @@
package org.elasticsearch.action.support.nodes; package org.elasticsearch.action.support.nodes;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.TransportAction; import org.elasticsearch.action.support.TransportAction;
import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNode;
@ -23,7 +23,7 @@ import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;
import java.util.Objects; import java.util.Objects;
public abstract class BaseNodesRequest extends ActionRequest { public abstract class BaseNodesRequest extends LegacyActionRequest {
/** /**
* Sequence of node specifications that describe the nodes that this request should target. See {@link DiscoveryNodes#resolveNodes} for * Sequence of node specifications that describe the nodes that this request should target. See {@link DiscoveryNodes#resolveNodes} for

View file

@ -9,9 +9,9 @@
package org.elasticsearch.action.support.replication; package org.elasticsearch.action.support.replication;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.admin.indices.refresh.TransportShardRefreshAction; import org.elasticsearch.action.admin.indices.refresh.TransportShardRefreshAction;
import org.elasticsearch.action.index.IndexRequest; import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.action.support.ActiveShardCount;
@ -33,7 +33,9 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
* Requests that are run on a particular replica, first on the primary and then on the replicas like {@link IndexRequest} or * Requests that are run on a particular replica, first on the primary and then on the replicas like {@link IndexRequest} or
* {@link TransportShardRefreshAction}. * {@link TransportShardRefreshAction}.
*/ */
public abstract class ReplicationRequest<Request extends ReplicationRequest<Request>> extends ActionRequest implements IndicesRequest { public abstract class ReplicationRequest<Request extends ReplicationRequest<Request>> extends LegacyActionRequest
implements
IndicesRequest {
public static final TimeValue DEFAULT_TIMEOUT = TimeValue.timeValueMinutes(1); public static final TimeValue DEFAULT_TIMEOUT = TimeValue.timeValueMinutes(1);

View file

@ -9,9 +9,9 @@
package org.elasticsearch.action.support.single.instance; package org.elasticsearch.action.support.single.instance;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.ValidateActions; import org.elasticsearch.action.ValidateActions;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
@ -24,7 +24,7 @@ import java.io.IOException;
// TODO: This request and its associated transport action can be folded into UpdateRequest which is its only concrete production code // TODO: This request and its associated transport action can be folded into UpdateRequest which is its only concrete production code
// implementation // implementation
public abstract class InstanceShardOperationRequest<Request extends InstanceShardOperationRequest<Request>> extends ActionRequest public abstract class InstanceShardOperationRequest<Request extends InstanceShardOperationRequest<Request>> extends LegacyActionRequest
implements implements
IndicesRequest { IndicesRequest {

View file

@ -9,9 +9,9 @@
package org.elasticsearch.action.support.single.shard; package org.elasticsearch.action.support.single.shard;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.ValidateActions; import org.elasticsearch.action.ValidateActions;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
@ -23,7 +23,7 @@ import java.io.IOException;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
public abstract class SingleShardRequest<Request extends SingleShardRequest<Request>> extends ActionRequest public abstract class SingleShardRequest<Request extends SingleShardRequest<Request>> extends LegacyActionRequest
implements implements
IndicesRequest.RemoteClusterShardRequest { IndicesRequest.RemoteClusterShardRequest {
@ -31,7 +31,7 @@ public abstract class SingleShardRequest<Request extends SingleShardRequest<Requ
/** /**
* The concrete index name * The concrete index name
* * <p>
* Whether index property is optional depends on the concrete implementation. If index property is required the * Whether index property is optional depends on the concrete implementation. If index property is required the
* concrete implementation should use {@link #validateNonNullIndex()} to check if the index property has been set * concrete implementation should use {@link #validateNonNullIndex()} to check if the index property has been set
*/ */

View file

@ -9,8 +9,8 @@
package org.elasticsearch.action.support.tasks; package org.elasticsearch.action.support.tasks;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
@ -27,7 +27,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
/** /**
* A base class for task requests * A base class for task requests
*/ */
public class BaseTasksRequest<Request extends BaseTasksRequest<Request>> extends ActionRequest { public class BaseTasksRequest<Request extends BaseTasksRequest<Request>> extends LegacyActionRequest {
public static final String[] ALL_ACTIONS = Strings.EMPTY_ARRAY; public static final String[] ALL_ACTIONS = Strings.EMPTY_ARRAY;
@ -103,7 +103,7 @@ public class BaseTasksRequest<Request extends BaseTasksRequest<Request>> extends
/** /**
* Returns the id of the task that should be processed. * Returns the id of the task that should be processed.
* * <p>
* By default tasks with any ids are returned. * By default tasks with any ids are returned.
*/ */
public TaskId getTargetTaskId() { public TaskId getTargetTaskId() {

View file

@ -9,10 +9,10 @@
package org.elasticsearch.action.synonyms; package org.elasticsearch.action.synonyms;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.io.stream.Writeable;
@ -42,7 +42,7 @@ public abstract class AbstractSynonymsPagedResultAction<T extends ActionResponse
/** /**
* Base request class that includes support for pagination parameters * Base request class that includes support for pagination parameters
*/ */
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
private static final int MAX_SYNONYMS_RESULTS = 10_000; private static final int MAX_SYNONYMS_RESULTS = 10_000;
private final int from; private final int from;
private final int size; private final int size;

View file

@ -10,9 +10,9 @@
package org.elasticsearch.action.synonyms; package org.elasticsearch.action.synonyms;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.ValidateActions; import org.elasticsearch.action.ValidateActions;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
@ -30,7 +30,7 @@ public class DeleteSynonymRuleAction extends ActionType<SynonymUpdateResponse> {
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
private final String synonymsSetId; private final String synonymsSetId;
private final String synonymRuleId; private final String synonymRuleId;
private final boolean refresh; private final boolean refresh;

View file

@ -10,9 +10,9 @@
package org.elasticsearch.action.synonyms; package org.elasticsearch.action.synonyms;
import org.apache.logging.log4j.util.Strings; import org.apache.logging.log4j.util.Strings;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
@ -29,7 +29,7 @@ public class DeleteSynonymsAction extends ActionType<AcknowledgedResponse> {
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
private final String synonymsSetId; private final String synonymsSetId;
public Request(StreamInput in) throws IOException { public Request(StreamInput in) throws IOException {

View file

@ -9,10 +9,10 @@
package org.elasticsearch.action.synonyms; package org.elasticsearch.action.synonyms;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.ValidateActions; import org.elasticsearch.action.ValidateActions;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
@ -33,7 +33,7 @@ public class GetSynonymRuleAction extends ActionType<GetSynonymRuleAction.Respon
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
private final String synonymsSetId; private final String synonymsSetId;
private final String synonymRuleId; private final String synonymRuleId;

View file

@ -10,9 +10,9 @@
package org.elasticsearch.action.synonyms; package org.elasticsearch.action.synonyms;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.ValidateActions; import org.elasticsearch.action.ValidateActions;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.bytes.BytesReference;
@ -39,7 +39,7 @@ public class PutSynonymRuleAction extends ActionType<SynonymUpdateResponse> {
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
private final String synonymsSetId; private final String synonymsSetId;
private final SynonymRule synonymRule; private final SynonymRule synonymRule;
private final boolean refresh; private final boolean refresh;

View file

@ -10,9 +10,9 @@
package org.elasticsearch.action.synonyms; package org.elasticsearch.action.synonyms;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.ValidateActions; import org.elasticsearch.action.ValidateActions;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.bytes.BytesReference;
@ -41,7 +41,7 @@ public class PutSynonymsAction extends ActionType<SynonymUpdateResponse> {
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
private final String synonymsSetId; private final String synonymsSetId;
private final SynonymRule[] synonymRules; private final SynonymRule[] synonymRules;
private final boolean refresh; private final boolean refresh;

View file

@ -10,9 +10,9 @@
package org.elasticsearch.action.termvectors; package org.elasticsearch.action.termvectors;
import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.ElasticsearchParseException;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.CompositeIndicesRequest; import org.elasticsearch.action.CompositeIndicesRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.RealtimeRequest; import org.elasticsearch.action.RealtimeRequest;
import org.elasticsearch.action.ValidateActions; import org.elasticsearch.action.ValidateActions;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
@ -30,7 +30,7 @@ import java.util.Set;
// It's not possible to suppress teh warning at #realtime(boolean) at a method-level. // It's not possible to suppress teh warning at #realtime(boolean) at a method-level.
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public class MultiTermVectorsRequest extends ActionRequest public class MultiTermVectorsRequest extends LegacyActionRequest
implements implements
Iterable<TermVectorsRequest>, Iterable<TermVectorsRequest>,
CompositeIndicesRequest, CompositeIndicesRequest,

View file

@ -10,10 +10,10 @@
package org.elasticsearch.health; package org.elasticsearch.health;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.TransportAction; import org.elasticsearch.action.support.TransportAction;
import org.elasticsearch.client.internal.ParentTaskAssigningClient; import org.elasticsearch.client.internal.ParentTaskAssigningClient;
@ -150,7 +150,7 @@ public class GetHealthAction extends ActionType<GetHealthAction.Response> {
} }
} }
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
private final String indicatorName; private final String indicatorName;
private final boolean verbose; private final boolean verbose;
private final int size; private final int size;

View file

@ -9,7 +9,7 @@
package org.elasticsearch.health.node.action; package org.elasticsearch.health.node.action;
import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.tasks.CancellableTask; import org.elasticsearch.tasks.CancellableTask;
import org.elasticsearch.tasks.Task; import org.elasticsearch.tasks.Task;
@ -21,7 +21,7 @@ import java.util.Map;
/** /**
* This is a base class for all the requests that will be sent to the health node. * This is a base class for all the requests that will be sent to the health node.
*/ */
public abstract class HealthNodeRequest extends ActionRequest { public abstract class HealthNodeRequest extends LegacyActionRequest {
public HealthNodeRequest() {} public HealthNodeRequest() {}

View file

@ -9,8 +9,8 @@
package org.elasticsearch.index.reindex; package org.elasticsearch.index.reindex;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchRequest;
import org.elasticsearch.action.support.ActiveShardCount; import org.elasticsearch.action.support.ActiveShardCount;
import org.elasticsearch.action.support.replication.ReplicationRequest; import org.elasticsearch.action.support.replication.ReplicationRequest;
@ -30,7 +30,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
import static org.elasticsearch.core.TimeValue.timeValueMillis; import static org.elasticsearch.core.TimeValue.timeValueMillis;
import static org.elasticsearch.core.TimeValue.timeValueMinutes; import static org.elasticsearch.core.TimeValue.timeValueMinutes;
public abstract class AbstractBulkByScrollRequest<Self extends AbstractBulkByScrollRequest<Self>> extends ActionRequest { public abstract class AbstractBulkByScrollRequest<Self extends AbstractBulkByScrollRequest<Self>> extends LegacyActionRequest {
public static final int MAX_DOCS_ALL_MATCHES = -1; public static final int MAX_DOCS_ALL_MATCHES = -1;
public static final TimeValue DEFAULT_SCROLL_TIMEOUT = timeValueMinutes(5); public static final TimeValue DEFAULT_SCROLL_TIMEOUT = timeValueMinutes(5);

View file

@ -11,8 +11,8 @@ package org.elasticsearch.index.shard;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.resync.ResyncReplicationRequest; import org.elasticsearch.action.resync.ResyncReplicationRequest;
import org.elasticsearch.action.resync.ResyncReplicationResponse; import org.elasticsearch.action.resync.ResyncReplicationResponse;
import org.elasticsearch.action.resync.TransportResyncReplicationAction; import org.elasticsearch.action.resync.TransportResyncReplicationAction;
@ -374,7 +374,7 @@ public class PrimaryReplicaSyncer {
} }
} }
public static class ResyncRequest extends ActionRequest { public static class ResyncRequest extends LegacyActionRequest {
private final ShardId shardId; private final ShardId shardId;
private final String allocationId; private final String allocationId;
@ -463,8 +463,8 @@ public class PrimaryReplicaSyncer {
} }
@Override @Override
public ResyncTask.Status getStatus() { public Status getStatus() {
return new ResyncTask.Status(phase, totalOperations, resyncedOperations, skippedOperations); return new Status(phase, totalOperations, resyncedOperations, skippedOperations);
} }
public static class Status implements Task.Status { public static class Status implements Task.Status {

View file

@ -9,10 +9,10 @@
package org.elasticsearch.indices.recovery; package org.elasticsearch.indices.recovery;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
@ -27,7 +27,7 @@ public class StatelessPrimaryRelocationAction {
"internal:index/shard/recovery/stateless_primary_relocation" "internal:index/shard/recovery/stateless_primary_relocation"
); );
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
private final long recoveryId; private final long recoveryId;
private final ShardId shardId; private final ShardId shardId;

View file

@ -9,10 +9,10 @@
package org.elasticsearch.indices.recovery; package org.elasticsearch.indices.recovery;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.index.shard.ShardId; import org.elasticsearch.index.shard.ShardId;
@ -26,7 +26,7 @@ public class StatelessUnpromotableRelocationAction {
"internal:index/shard/recovery/stateless_unpromotable_relocation" "internal:index/shard/recovery/stateless_unpromotable_relocation"
); );
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
private final long recoveryId; private final long recoveryId;
private final ShardId shardId; private final ShardId shardId;
private final String targetAllocationId; private final String targetAllocationId;

View file

@ -10,10 +10,10 @@
package org.elasticsearch.repositories; package org.elasticsearch.repositories;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.ActionFilters; import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.HandledTransportAction; import org.elasticsearch.action.support.HandledTransportAction;
import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNode;
@ -67,7 +67,7 @@ public class VerifyNodeRepositoryAction {
} }
} }
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
protected final String repository; protected final String repository;
protected final String verificationToken; protected final String verificationToken;

View file

@ -81,7 +81,7 @@ public class ActionModuleTests extends ESTestCase {
} }
public void testPluginCanRegisterAction() { public void testPluginCanRegisterAction() {
class FakeRequest extends ActionRequest { class FakeRequest extends LegacyActionRequest {
@Override @Override
public ActionRequestValidationException validate() { public ActionRequestValidationException validate() {
return null; return null;

View file

@ -13,6 +13,7 @@ import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.tasks.Task; import org.elasticsearch.tasks.Task;
import org.elasticsearch.test.ESTestCase; import org.elasticsearch.test.ESTestCase;
@ -25,7 +26,7 @@ import static org.hamcrest.Matchers.is;
public class MappedActionFiltersTests extends ESTestCase { public class MappedActionFiltersTests extends ESTestCase {
static class DummyRequest extends ActionRequest { static class DummyRequest extends LegacyActionRequest {
@Override @Override
public ActionRequestValidationException validate() { public ActionRequestValidationException validate() {
return null; return null;

View file

@ -10,9 +10,9 @@
package org.elasticsearch.action.support; package org.elasticsearch.action.support;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest; import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest;
import org.elasticsearch.cluster.ClusterName; import org.elasticsearch.cluster.ClusterName;
import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterState;
@ -124,7 +124,7 @@ public class ReservedStateAwareHandledTransportActionTests extends ESTestCase {
} }
} }
static class DummyRequest extends ActionRequest { static class DummyRequest extends LegacyActionRequest {
@Override @Override
public ActionRequestValidationException validate() { public ActionRequestValidationException validate() {
return null; return null;

View file

@ -16,6 +16,7 @@ import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionRunnable; import org.elasticsearch.action.ActionRunnable;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.util.concurrent.AbstractRunnable; import org.elasticsearch.common.util.concurrent.AbstractRunnable;
import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.common.util.concurrent.EsExecutors;
@ -167,7 +168,7 @@ public class TransportActionFilterChainRefCountingTests extends ESSingleNodeTest
} }
} }
private static class Request extends ActionRequest { private static class Request extends LegacyActionRequest {
private final SubscribableListener<Void> closeListeners = new SubscribableListener<>(); private final SubscribableListener<Void> closeListeners = new SubscribableListener<>();
private final RefCounted refs = LeakTracker.wrap(AbstractRefCounted.of(() -> closeListeners.onResponse(null))); private final RefCounted refs = LeakTracker.wrap(AbstractRefCounted.of(() -> closeListeners.onResponse(null)));

View file

@ -15,6 +15,7 @@ import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.LatchedActionListener; import org.elasticsearch.action.LatchedActionListener;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.common.util.concurrent.EsExecutors;
@ -288,7 +289,7 @@ public class TransportActionFilterChainTests extends ESTestCase {
); );
} }
public static class TestRequest extends ActionRequest { public static class TestRequest extends LegacyActionRequest {
@Override @Override
public ActionRequestValidationException validate() { public ActionRequestValidationException validate() {
return null; return null;

View file

@ -10,9 +10,9 @@
package org.elasticsearch.action.support; package org.elasticsearch.action.support;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.util.concurrent.EsExecutors; import org.elasticsearch.common.util.concurrent.EsExecutors;
@ -147,7 +147,7 @@ public class TransportActionTests extends ESTestCase {
return transportAction; return transportAction;
} }
private static class TestRequest extends ActionRequest { private static class TestRequest extends LegacyActionRequest {
@Override @Override
public ActionRequestValidationException validate() { public ActionRequestValidationException validate() {
return null; return null;

View file

@ -7,9 +7,9 @@
package org.elasticsearch.xpack.ccr.action.repositories; package org.elasticsearch.xpack.ccr.action.repositories;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
@ -21,7 +21,7 @@ import java.io.IOException;
import static org.elasticsearch.xpack.ccr.Ccr.TRANSPORT_VERSION_ACTION_WITH_SHARD_ID; import static org.elasticsearch.xpack.ccr.Ccr.TRANSPORT_VERSION_ACTION_WITH_SHARD_ID;
public class ClearCcrRestoreSessionRequest extends ActionRequest implements RemoteClusterAwareRequest, IndicesRequest { public class ClearCcrRestoreSessionRequest extends LegacyActionRequest implements RemoteClusterAwareRequest, IndicesRequest {
private DiscoveryNode node; private DiscoveryNode node;
private final String sessionUUID; private final String sessionUUID;

View file

@ -7,15 +7,15 @@
package org.elasticsearch.xpack.ccr.action.repositories; package org.elasticsearch.xpack.ccr.action.repositories;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.TransportAction; import org.elasticsearch.action.support.TransportAction;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException; import java.io.IOException;
import java.util.Objects; import java.util.Objects;
public class DeleteInternalCcrRepositoryRequest extends ActionRequest { public class DeleteInternalCcrRepositoryRequest extends LegacyActionRequest {
private final String name; private final String name;

View file

@ -7,9 +7,9 @@
package org.elasticsearch.xpack.ccr.action.repositories; package org.elasticsearch.xpack.ccr.action.repositories;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
@ -21,7 +21,7 @@ import java.io.IOException;
import static org.elasticsearch.xpack.ccr.Ccr.TRANSPORT_VERSION_ACTION_WITH_SHARD_ID; import static org.elasticsearch.xpack.ccr.Ccr.TRANSPORT_VERSION_ACTION_WITH_SHARD_ID;
public class GetCcrRestoreFileChunkRequest extends ActionRequest implements RemoteClusterAwareRequest, IndicesRequest { public class GetCcrRestoreFileChunkRequest extends LegacyActionRequest implements RemoteClusterAwareRequest, IndicesRequest {
private final DiscoveryNode node; private final DiscoveryNode node;
private final String sessionUUID; private final String sessionUUID;

View file

@ -7,15 +7,15 @@
package org.elasticsearch.xpack.ccr.action.repositories; package org.elasticsearch.xpack.ccr.action.repositories;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.TransportAction; import org.elasticsearch.action.support.TransportAction;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException; import java.io.IOException;
import java.util.Objects; import java.util.Objects;
public class PutInternalCcrRepositoryRequest extends ActionRequest { public class PutInternalCcrRepositoryRequest extends LegacyActionRequest {
private final String name; private final String name;
private final String type; private final String type;

View file

@ -7,13 +7,13 @@
package org.elasticsearch.license; package org.elasticsearch.license;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import java.io.IOException; import java.io.IOException;
public class GetFeatureUsageRequest extends ActionRequest { public class GetFeatureUsageRequest extends LegacyActionRequest {
public GetFeatureUsageRequest() {} public GetFeatureUsageRequest() {}

View file

@ -8,8 +8,8 @@ package org.elasticsearch.protocol.xpack;
import org.elasticsearch.TransportVersion; import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.license.License; import org.elasticsearch.license.License;
@ -21,7 +21,7 @@ import java.util.Locale;
/** /**
* Fetch information about X-Pack from the cluster. * Fetch information about X-Pack from the cluster.
*/ */
public class XPackInfoRequest extends ActionRequest { public class XPackInfoRequest extends LegacyActionRequest {
public enum Category { public enum Category {
BUILD, BUILD,

View file

@ -7,9 +7,9 @@
package org.elasticsearch.protocol.xpack.graph; package org.elasticsearch.protocol.xpack.graph;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.IndicesRequest; import org.elasticsearch.action.IndicesRequest;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.ValidateActions; import org.elasticsearch.action.ValidateActions;
import org.elasticsearch.action.support.IndicesOptions; import org.elasticsearch.action.support.IndicesOptions;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
@ -33,7 +33,7 @@ import java.util.List;
* Holds the criteria required to guide the exploration of connected terms which * Holds the criteria required to guide the exploration of connected terms which
* can be returned as a graph. * can be returned as a graph.
*/ */
public class GraphExploreRequest extends ActionRequest implements IndicesRequest.Replaceable, ToXContentObject { public class GraphExploreRequest extends LegacyActionRequest implements IndicesRequest.Replaceable, ToXContentObject {
public static final String NO_HOPS_ERROR_MESSAGE = "Graph explore request must have at least one hop"; public static final String NO_HOPS_ERROR_MESSAGE = "Graph explore request must have at least one hop";
public static final String NO_VERTICES_ERROR_MESSAGE = "Graph explore hop must have at least one VertexRequest"; public static final String NO_VERTICES_ERROR_MESSAGE = "Graph explore hop must have at least one VertexRequest";
@ -158,8 +158,7 @@ public class GraphExploreRequest extends ActionRequest implements IndicesRequest
* available but can still overrun due to the nature of their "best efforts" * available but can still overrun due to the nature of their "best efforts"
* timeout support. When a timeout occurs partial results are returned. * timeout support. When a timeout occurs partial results are returned.
* *
* @param timeout * @param timeout a {@link TimeValue} object which determines the maximum length
* a {@link TimeValue} object which determines the maximum length
* of time to spend exploring * of time to spend exploring
*/ */
public GraphExploreRequest timeout(TimeValue timeout) { public GraphExploreRequest timeout(TimeValue timeout) {
@ -212,8 +211,7 @@ public class GraphExploreRequest extends ActionRequest implements IndicesRequest
* background frequencies of terms found in the documents * background frequencies of terms found in the documents
* </p> * </p>
* *
* @param maxNumberOfDocsPerHop * @param maxNumberOfDocsPerHop shard-level sample size in documents
* shard-level sample size in documents
*/ */
public void sampleSize(int maxNumberOfDocsPerHop) { public void sampleSize(int maxNumberOfDocsPerHop) {
sampleSize = maxNumberOfDocsPerHop; sampleSize = maxNumberOfDocsPerHop;
@ -253,8 +251,7 @@ public class GraphExploreRequest extends ActionRequest implements IndicesRequest
* significance (see the {@link SignificantTerms} aggregation) rather than * significance (see the {@link SignificantTerms} aggregation) rather than
* popularity (using the {@link TermsAggregator}). * popularity (using the {@link TermsAggregator}).
* *
* @param value * @param value true if the significant_terms algorithm should be used.
* true if the significant_terms algorithm should be used.
*/ */
public void useSignificance(boolean value) { public void useSignificance(boolean value) {
this.useSignificance = value; this.useSignificance = value;
@ -268,8 +265,7 @@ public class GraphExploreRequest extends ActionRequest implements IndicesRequest
* Return detailed information about vertex frequencies as part of JSON * Return detailed information about vertex frequencies as part of JSON
* results - defaults to false * results - defaults to false
* *
* @param value * @param value true if detailed information is required in JSON responses
* true if detailed information is required in JSON responses
*/ */
public void returnDetailedInfo(boolean value) { public void returnDetailedInfo(boolean value) {
this.returnDetailedInfo = value; this.returnDetailedInfo = value;
@ -284,8 +280,7 @@ public class GraphExploreRequest extends ActionRequest implements IndicesRequest
* querying elasticsearch to identify terms which can then be connnected to * querying elasticsearch to identify terms which can then be connnected to
* other terms in a subsequent hop. * other terms in a subsequent hop.
* *
* @param guidingQuery * @param guidingQuery optional choice of query which influences which documents are
* optional choice of query which influences which documents are
* considered in this stage * considered in this stage
* @return a {@link Hop} object that holds settings for a stage in the graph * @return a {@link Hop} object that holds settings for a stage in the graph
* exploration * exploration

View file

@ -6,8 +6,8 @@
*/ */
package org.elasticsearch.protocol.xpack.watcher; package org.elasticsearch.protocol.xpack.watcher;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.ValidateActions; import org.elasticsearch.action.ValidateActions;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
@ -18,7 +18,7 @@ import java.io.IOException;
/** /**
* A delete watch request to delete an watch by name (id) * A delete watch request to delete an watch by name (id)
*/ */
public class DeleteWatchRequest extends ActionRequest { public class DeleteWatchRequest extends LegacyActionRequest {
private String id; private String id;
private long version = Versions.MATCH_ANY; private long version = Versions.MATCH_ANY;

View file

@ -6,15 +6,15 @@
*/ */
package org.elasticsearch.protocol.xpack.watcher; package org.elasticsearch.protocol.xpack.watcher;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.lucene.uid.Versions; import org.elasticsearch.common.lucene.uid.Versions;
import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentHelper;
import org.elasticsearch.index.seqno.SequenceNumbers; import org.elasticsearch.index.engine.VersionConflictEngineException;
import org.elasticsearch.xcontent.XContentType; import org.elasticsearch.xcontent.XContentType;
import java.io.IOException; import java.io.IOException;
@ -28,7 +28,7 @@ import static org.elasticsearch.index.seqno.SequenceNumbers.UNASSIGNED_SEQ_NO;
* This request class contains the data needed to create a watch along with the name of the watch. * This request class contains the data needed to create a watch along with the name of the watch.
* The name of the watch will become the ID of the indexed document. * The name of the watch will become the ID of the indexed document.
*/ */
public final class PutWatchRequest extends ActionRequest { public final class PutWatchRequest extends LegacyActionRequest {
private static final Pattern NO_WS_PATTERN = Pattern.compile("\\S+"); private static final Pattern NO_WS_PATTERN = Pattern.compile("\\S+");
@ -38,7 +38,7 @@ public final class PutWatchRequest extends ActionRequest {
private boolean active = true; private boolean active = true;
private long version = Versions.MATCH_ANY; private long version = Versions.MATCH_ANY;
private long ifSeqNo = SequenceNumbers.UNASSIGNED_SEQ_NO; private long ifSeqNo = UNASSIGNED_SEQ_NO;
private long ifPrimaryTerm = UNASSIGNED_PRIMARY_TERM; private long ifPrimaryTerm = UNASSIGNED_PRIMARY_TERM;
public PutWatchRequest() {} public PutWatchRequest() {}
@ -135,9 +135,9 @@ public final class PutWatchRequest extends ActionRequest {
/** /**
* only performs this put request if the watch's last modification was assigned the given * only performs this put request if the watch's last modification was assigned the given
* sequence number. Must be used in combination with {@link #setIfPrimaryTerm(long)} * sequence number. Must be used in combination with {@link #setIfPrimaryTerm(long)}
* * <p>
* If the watch's last modification was assigned a different sequence number a * If the watch's last modification was assigned a different sequence number a
* {@link org.elasticsearch.index.engine.VersionConflictEngineException} will be thrown. * {@link VersionConflictEngineException} will be thrown.
*/ */
public PutWatchRequest setIfSeqNo(long seqNo) { public PutWatchRequest setIfSeqNo(long seqNo) {
if (seqNo < 0 && seqNo != UNASSIGNED_SEQ_NO) { if (seqNo < 0 && seqNo != UNASSIGNED_SEQ_NO) {
@ -150,9 +150,9 @@ public final class PutWatchRequest extends ActionRequest {
/** /**
* only performs this put request if the watch's last modification was assigned the given * only performs this put request if the watch's last modification was assigned the given
* primary term. Must be used in combination with {@link #setIfSeqNo(long)} * primary term. Must be used in combination with {@link #setIfSeqNo(long)}
* * <p>
* If the watch last modification was assigned a different term a * If the watch last modification was assigned a different term a
* {@link org.elasticsearch.index.engine.VersionConflictEngineException} will be thrown. * {@link VersionConflictEngineException} will be thrown.
*/ */
public PutWatchRequest setIfPrimaryTerm(long term) { public PutWatchRequest setIfPrimaryTerm(long term) {
if (term < 0) { if (term < 0) {
@ -165,7 +165,7 @@ public final class PutWatchRequest extends ActionRequest {
/** /**
* If set, only perform this put watch request if the watch's last modification was assigned this sequence number. * If set, only perform this put watch request if the watch's last modification was assigned this sequence number.
* If the watch last last modification was assigned a different sequence number a * If the watch last last modification was assigned a different sequence number a
* {@link org.elasticsearch.index.engine.VersionConflictEngineException} will be thrown. * {@link VersionConflictEngineException} will be thrown.
*/ */
public long getIfSeqNo() { public long getIfSeqNo() {
return ifSeqNo; return ifSeqNo;
@ -173,9 +173,9 @@ public final class PutWatchRequest extends ActionRequest {
/** /**
* If set, only perform this put watch request if the watch's last modification was assigned this primary term. * If set, only perform this put watch request if the watch's last modification was assigned this primary term.
* * <p>
* If the watch's last modification was assigned a different term a * If the watch's last modification was assigned a different term a
* {@link org.elasticsearch.index.engine.VersionConflictEngineException} will be thrown. * {@link VersionConflictEngineException} will be thrown.
*/ */
public long getIfPrimaryTerm() { public long getIfPrimaryTerm() {
return ifPrimaryTerm; return ifPrimaryTerm;

View file

@ -6,8 +6,8 @@
*/ */
package org.elasticsearch.xpack.core.action; package org.elasticsearch.xpack.core.action;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.tasks.CancellableTask; import org.elasticsearch.tasks.CancellableTask;
@ -19,7 +19,7 @@ import java.io.IOException;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
public abstract class AbstractGetResourcesRequest extends ActionRequest { public abstract class AbstractGetResourcesRequest extends LegacyActionRequest {
private String resourceId; private String resourceId;
private PageParams pageParams = PageParams.defaultParams(); private PageParams pageParams = PageParams.defaultParams();

View file

@ -6,8 +6,8 @@
*/ */
package org.elasticsearch.xpack.core.async; package org.elasticsearch.xpack.core.async;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
@ -17,7 +17,7 @@ import java.util.Objects;
/** /**
* Request for TransportEsqlAsyncStopAction action. * Request for TransportEsqlAsyncStopAction action.
*/ */
public class AsyncStopRequest extends ActionRequest { public class AsyncStopRequest extends LegacyActionRequest {
private final String id; private final String id;
/** /**

View file

@ -7,15 +7,15 @@
package org.elasticsearch.xpack.core.async; package org.elasticsearch.xpack.core.async;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import java.io.IOException; import java.io.IOException;
import java.util.Objects; import java.util.Objects;
public class DeleteAsyncResultRequest extends ActionRequest { public class DeleteAsyncResultRequest extends LegacyActionRequest {
private final String id; private final String id;
public DeleteAsyncResultRequest(String id) { public DeleteAsyncResultRequest(String id) {

View file

@ -6,8 +6,8 @@
*/ */
package org.elasticsearch.xpack.core.async; package org.elasticsearch.xpack.core.async;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.TimeValue;
@ -15,7 +15,7 @@ import org.elasticsearch.core.TimeValue;
import java.io.IOException; import java.io.IOException;
import java.util.Objects; import java.util.Objects;
public class GetAsyncResultRequest extends ActionRequest { public class GetAsyncResultRequest extends LegacyActionRequest {
private final String id; private final String id;
private TimeValue waitForCompletionTimeout = TimeValue.MINUS_ONE; private TimeValue waitForCompletionTimeout = TimeValue.MINUS_ONE;
private TimeValue keepAlive = TimeValue.MINUS_ONE; private TimeValue keepAlive = TimeValue.MINUS_ONE;

View file

@ -7,8 +7,8 @@
package org.elasticsearch.xpack.core.async; package org.elasticsearch.xpack.core.async;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.TimeValue;
@ -19,12 +19,13 @@ import java.util.Objects;
/** /**
* A request class to get a status update of the async search request * A request class to get a status update of the async search request
*/ */
public class GetAsyncStatusRequest extends ActionRequest { public class GetAsyncStatusRequest extends LegacyActionRequest {
private final String id; private final String id;
private TimeValue keepAlive = TimeValue.MINUS_ONE; private TimeValue keepAlive = TimeValue.MINUS_ONE;
/** /**
* Creates a new request * Creates a new request
*
* @param id The id of the search progress request. * @param id The id of the search progress request.
*/ */
public GetAsyncStatusRequest(String id) { public GetAsyncStatusRequest(String id) {

View file

@ -7,13 +7,13 @@
package org.elasticsearch.xpack.core.esql.action; package org.elasticsearch.xpack.core.esql.action;
import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.index.query.QueryBuilder; import org.elasticsearch.index.query.QueryBuilder;
import java.io.IOException; import java.io.IOException;
public abstract class EsqlQueryRequest extends ActionRequest { public abstract class EsqlQueryRequest extends LegacyActionRequest {
protected EsqlQueryRequest() {} protected EsqlQueryRequest() {}

View file

@ -8,7 +8,7 @@
package org.elasticsearch.xpack.core.inference.action; package org.elasticsearch.xpack.core.inference.action;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.inference.TaskType; import org.elasticsearch.inference.TaskType;
@ -21,7 +21,7 @@ import java.util.Objects;
* Base class for inference action requests. Tracks request routing state to prevent potential routing loops * Base class for inference action requests. Tracks request routing state to prevent potential routing loops
* and supports both streaming and non-streaming inference operations. * and supports both streaming and non-streaming inference operations.
*/ */
public abstract class BaseInferenceActionRequest extends ActionRequest { public abstract class BaseInferenceActionRequest extends LegacyActionRequest {
private boolean hasBeenRerouted; private boolean hasBeenRerouted;

View file

@ -8,9 +8,9 @@
package org.elasticsearch.xpack.core.inference.action; package org.elasticsearch.xpack.core.inference.action;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
@ -38,7 +38,7 @@ public class InferenceActionProxy extends ActionType<InferenceAction.Response> {
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
private final TaskType taskType; private final TaskType taskType;
private final String inferenceEntityId; private final String inferenceEntityId;

View file

@ -7,9 +7,9 @@
package org.elasticsearch.xpack.core.ml.action; package org.elasticsearch.xpack.core.ml.action;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
@ -40,7 +40,7 @@ public class AuditMlNotificationAction extends ActionType<AcknowledgedResponse>
SYSTEM SYSTEM
} }
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
private final AuditType auditType; private final AuditType auditType;
private final String id; private final String id;
private final String message; private final String message;

View file

@ -7,10 +7,10 @@
package org.elasticsearch.xpack.core.ml.action; package org.elasticsearch.xpack.core.ml.action;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
@ -43,7 +43,7 @@ public class CancelJobModelSnapshotUpgradeAction extends ActionType<CancelJobMod
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest implements ToXContentObject { public static class Request extends LegacyActionRequest implements ToXContentObject {
public static final String ALL = "_all"; public static final String ALL = "_all";

View file

@ -8,9 +8,9 @@
package org.elasticsearch.xpack.core.ml.action; package org.elasticsearch.xpack.core.ml.action;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.core.Nullable; import org.elasticsearch.core.Nullable;
@ -33,7 +33,7 @@ public class CoordinatedInferenceAction extends ActionType<InferModelAction.Resp
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
public enum RequestModelType { public enum RequestModelType {
INFERENCE_SERVICE_MODEL, INFERENCE_SERVICE_MODEL,
@ -41,7 +41,7 @@ public class CoordinatedInferenceAction extends ActionType<InferModelAction.Resp
BOOSTED_TREE_MODEL, BOOSTED_TREE_MODEL,
NLP_MODEL, // Either an inference service model or ml pytorch model but not a boosted tree model NLP_MODEL, // Either an inference service model or ml pytorch model but not a boosted tree model
UNKNOWN UNKNOWN
}; }
public static Request forTextInput( public static Request forTextInput(
String modelId, String modelId,

View file

@ -6,10 +6,10 @@
*/ */
package org.elasticsearch.xpack.core.ml.action; package org.elasticsearch.xpack.core.ml.action;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.TimeValue;
@ -33,7 +33,7 @@ public class DeleteExpiredDataAction extends ActionType<DeleteExpiredDataAction.
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
public static final ParseField REQUESTS_PER_SECOND = new ParseField("requests_per_second"); public static final ParseField REQUESTS_PER_SECOND = new ParseField("requests_per_second");
public static final ParseField TIMEOUT = new ParseField("timeout"); public static final ParseField TIMEOUT = new ParseField("timeout");
@ -103,6 +103,7 @@ public class DeleteExpiredDataAction extends ActionType<DeleteExpiredDataAction.
/** /**
* Not serialized, the expanded job Ids should only be used * Not serialized, the expanded job Ids should only be used
* on the executing node. * on the executing node.
*
* @return The expanded Ids in the case where {@code jobId} is not `_all` * @return The expanded Ids in the case where {@code jobId} is not `_all`
* otherwise null. * otherwise null.
*/ */

View file

@ -6,9 +6,9 @@
*/ */
package org.elasticsearch.xpack.core.ml.action; package org.elasticsearch.xpack.core.ml.action;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.action.support.master.AcknowledgedResponse;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
@ -27,7 +27,7 @@ public class DeleteModelSnapshotAction extends ActionType<AcknowledgedResponse>
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
private String jobId; private String jobId;
private String snapshotId; private String snapshotId;

View file

@ -6,10 +6,10 @@
*/ */
package org.elasticsearch.xpack.core.ml.action; package org.elasticsearch.xpack.core.ml.action;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.unit.ByteSizeValue;
@ -37,13 +37,13 @@ public class EstimateModelMemoryAction extends ActionType<EstimateModelMemoryAct
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
public static final ParseField ANALYSIS_CONFIG = Job.ANALYSIS_CONFIG; public static final ParseField ANALYSIS_CONFIG = Job.ANALYSIS_CONFIG;
public static final ParseField OVERALL_CARDINALITY = new ParseField("overall_cardinality"); public static final ParseField OVERALL_CARDINALITY = new ParseField("overall_cardinality");
public static final ParseField MAX_BUCKET_CARDINALITY = new ParseField("max_bucket_cardinality"); public static final ParseField MAX_BUCKET_CARDINALITY = new ParseField("max_bucket_cardinality");
public static final ObjectParser<Request, Void> PARSER = new ObjectParser<>(NAME, EstimateModelMemoryAction.Request::new); public static final ObjectParser<Request, Void> PARSER = new ObjectParser<>(NAME, Request::new);
static { static {
PARSER.declareObject(Request::setAnalysisConfig, (p, c) -> AnalysisConfig.STRICT_PARSER.apply(p, c).build(), ANALYSIS_CONFIG); PARSER.declareObject(Request::setAnalysisConfig, (p, c) -> AnalysisConfig.STRICT_PARSER.apply(p, c).build(), ANALYSIS_CONFIG);

View file

@ -6,10 +6,10 @@
*/ */
package org.elasticsearch.xpack.core.ml.action; package org.elasticsearch.xpack.core.ml.action;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
@ -49,7 +49,7 @@ public class EvaluateDataFrameAction extends ActionType<EvaluateDataFrameAction.
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest implements ToXContentObject { public static class Request extends LegacyActionRequest implements ToXContentObject {
private static final ParseField INDEX = new ParseField("index"); private static final ParseField INDEX = new ParseField("index");
private static final ParseField QUERY = new ParseField("query"); private static final ParseField QUERY = new ParseField("query");

View file

@ -6,9 +6,9 @@
*/ */
package org.elasticsearch.xpack.core.ml.action; package org.elasticsearch.xpack.core.ml.action;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.xcontent.ObjectParser; import org.elasticsearch.xcontent.ObjectParser;
@ -36,7 +36,7 @@ public class GetBucketsAction extends ActionType<GetBucketsAction.Response> {
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest implements ToXContentObject { public static class Request extends LegacyActionRequest implements ToXContentObject {
public static final ParseField EXPAND = new ParseField("expand"); public static final ParseField EXPAND = new ParseField("expand");
public static final ParseField EXCLUDE_INTERIM = new ParseField("exclude_interim"); public static final ParseField EXCLUDE_INTERIM = new ParseField("exclude_interim");

View file

@ -6,9 +6,9 @@
*/ */
package org.elasticsearch.xpack.core.ml.action; package org.elasticsearch.xpack.core.ml.action;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.action.ValidateActions; import org.elasticsearch.action.ValidateActions;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
@ -37,7 +37,7 @@ public class GetCalendarEventsAction extends ActionType<GetCalendarEventsAction.
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest implements ToXContentObject { public static class Request extends LegacyActionRequest implements ToXContentObject {
public static final ParseField START = new ParseField("start"); public static final ParseField START = new ParseField("start");
public static final ParseField END = new ParseField("end"); public static final ParseField END = new ParseField("end");

View file

@ -6,9 +6,9 @@
*/ */
package org.elasticsearch.xpack.core.ml.action; package org.elasticsearch.xpack.core.ml.action;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.xcontent.ObjectParser; import org.elasticsearch.xcontent.ObjectParser;
@ -34,7 +34,7 @@ public class GetCalendarsAction extends ActionType<GetCalendarsAction.Response>
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest implements ToXContentObject { public static class Request extends LegacyActionRequest implements ToXContentObject {
public static final String ALL = "_all"; public static final String ALL = "_all";

View file

@ -6,9 +6,9 @@
*/ */
package org.elasticsearch.xpack.core.ml.action; package org.elasticsearch.xpack.core.ml.action;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.tasks.CancellableTask; import org.elasticsearch.tasks.CancellableTask;
@ -42,7 +42,7 @@ public class GetCategoriesAction extends ActionType<GetCategoriesAction.Response
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest implements ToXContentObject { public static class Request extends LegacyActionRequest implements ToXContentObject {
public static final ParseField CATEGORY_ID = CategoryDefinition.CATEGORY_ID; public static final ParseField CATEGORY_ID = CategoryDefinition.CATEGORY_ID;
public static final ParseField FROM = new ParseField("from"); public static final ParseField FROM = new ParseField("from");

View file

@ -6,9 +6,9 @@
*/ */
package org.elasticsearch.xpack.core.ml.action; package org.elasticsearch.xpack.core.ml.action;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.cluster.ClusterState; import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNode;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
@ -57,7 +57,7 @@ public class GetDatafeedsStatsAction extends ActionType<GetDatafeedsStatsAction.
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
public static final String ALLOW_NO_MATCH = "allow_no_match"; public static final String ALLOW_NO_MATCH = "allow_no_match";
@ -330,9 +330,7 @@ public class GetDatafeedsStatsAction extends ActionType<GetDatafeedsStatsAction.
private GetDatafeedRunningStateAction.Response datafeedRuntimeState; private GetDatafeedRunningStateAction.Response datafeedRuntimeState;
public Builder setDatafeedIds(Collection<String> datafeedIds) { public Builder setDatafeedIds(Collection<String> datafeedIds) {
this.statsBuilders = datafeedIds.stream() this.statsBuilders = datafeedIds.stream().map(DatafeedStats::builder).collect(Collectors.toList());
.map(GetDatafeedsStatsAction.Response.DatafeedStats::builder)
.collect(Collectors.toList());
return this; return this;
} }

View file

@ -6,9 +6,9 @@
*/ */
package org.elasticsearch.xpack.core.ml.action; package org.elasticsearch.xpack.core.ml.action;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.xcontent.ObjectParser; import org.elasticsearch.xcontent.ObjectParser;
@ -35,7 +35,7 @@ public class GetInfluencersAction extends ActionType<GetInfluencersAction.Respon
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest implements ToXContentObject { public static class Request extends LegacyActionRequest implements ToXContentObject {
public static final ParseField START = new ParseField("start"); public static final ParseField START = new ParseField("start");
public static final ParseField END = new ParseField("end"); public static final ParseField END = new ParseField("end");

View file

@ -6,9 +6,9 @@
*/ */
package org.elasticsearch.xpack.core.ml.action; package org.elasticsearch.xpack.core.ml.action;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.core.Nullable; import org.elasticsearch.core.Nullable;
@ -42,7 +42,7 @@ public class GetModelSnapshotsAction extends ActionType<GetModelSnapshotsAction.
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest implements ToXContentObject { public static class Request extends LegacyActionRequest implements ToXContentObject {
public static final ParseField SNAPSHOT_ID = new ParseField("snapshot_id"); public static final ParseField SNAPSHOT_ID = new ParseField("snapshot_id");
public static final ParseField SORT = new ParseField("sort"); public static final ParseField SORT = new ParseField("sort");

View file

@ -7,9 +7,9 @@
package org.elasticsearch.xpack.core.ml.action; package org.elasticsearch.xpack.core.ml.action;
import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.ElasticsearchParseException;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.time.DateMathParser; import org.elasticsearch.common.time.DateMathParser;
@ -54,7 +54,7 @@ public class GetOverallBucketsAction extends ActionType<GetOverallBucketsAction.
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest implements ToXContentObject { public static class Request extends LegacyActionRequest implements ToXContentObject {
public static final ParseField TOP_N = new ParseField("top_n"); public static final ParseField TOP_N = new ParseField("top_n");
public static final ParseField BUCKET_SPAN = new ParseField("bucket_span"); public static final ParseField BUCKET_SPAN = new ParseField("bucket_span");

View file

@ -6,9 +6,9 @@
*/ */
package org.elasticsearch.xpack.core.ml.action; package org.elasticsearch.xpack.core.ml.action;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.xcontent.ObjectParser; import org.elasticsearch.xcontent.ObjectParser;
@ -35,7 +35,7 @@ public class GetRecordsAction extends ActionType<GetRecordsAction.Response> {
super(NAME); super(NAME);
} }
public static class Request extends ActionRequest implements ToXContentObject { public static class Request extends LegacyActionRequest implements ToXContentObject {
public static final ParseField START = new ParseField("start"); public static final ParseField START = new ParseField("start");
public static final ParseField END = new ParseField("end"); public static final ParseField END = new ParseField("end");

View file

@ -7,10 +7,10 @@
package org.elasticsearch.xpack.core.ml.action; package org.elasticsearch.xpack.core.ml.action;
import org.elasticsearch.TransportVersions; import org.elasticsearch.TransportVersions;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException; import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.ActionType; import org.elasticsearch.action.ActionType;
import org.elasticsearch.action.LegacyActionRequest;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.core.TimeValue; import org.elasticsearch.core.TimeValue;
@ -48,7 +48,7 @@ public class InferModelAction extends ActionType<InferModelAction.Response> {
super(name); super(name);
} }
public static class Request extends ActionRequest { public static class Request extends LegacyActionRequest {
public static final ParseField ID = new ParseField("id"); public static final ParseField ID = new ParseField("id");
public static final ParseField DEPLOYMENT_ID = new ParseField("deployment_id"); public static final ParseField DEPLOYMENT_ID = new ParseField("deployment_id");
@ -57,6 +57,7 @@ public class InferModelAction extends ActionType<InferModelAction.Response> {
public static final ParseField INFERENCE_CONFIG = new ParseField("inference_config"); public static final ParseField INFERENCE_CONFIG = new ParseField("inference_config");
static final ObjectParser<Builder, Void> PARSER = new ObjectParser<>(NAME, Builder::new); static final ObjectParser<Builder, Void> PARSER = new ObjectParser<>(NAME, Builder::new);
static { static {
PARSER.declareString(Builder::setId, ID); PARSER.declareString(Builder::setId, ID);
PARSER.declareObjectArray(Builder::setDocs, (p, c) -> p.mapOrdered(), DOCS); PARSER.declareObjectArray(Builder::setDocs, (p, c) -> p.mapOrdered(), DOCS);
@ -92,13 +93,6 @@ public class InferModelAction extends ActionType<InferModelAction.Response> {
private TrainedModelPrefixStrings.PrefixType prefixType = TrainedModelPrefixStrings.PrefixType.NONE; private TrainedModelPrefixStrings.PrefixType prefixType = TrainedModelPrefixStrings.PrefixType.NONE;
private boolean chunked = false; private boolean chunked = false;
/**
* Build a request from a list of documents as maps.
* The inference timeout (how long the request waits in
* the inference queue for) is set to a high value {@code #DEFAULT_TIMEOUT_FOR_INGEST}
* to prefer slow ingest over dropping documents.
*/
/** /**
* Build a request from a list of documents as maps. * Build a request from a list of documents as maps.
* *
@ -119,7 +113,7 @@ public class InferModelAction extends ActionType<InferModelAction.Response> {
TimeValue inferenceTimeout TimeValue inferenceTimeout
) { ) {
return new Request( return new Request(
ExceptionsHelper.requireNonNull(id, InferModelAction.Request.ID), ExceptionsHelper.requireNonNull(id, Request.ID),
update, update,
ExceptionsHelper.requireNonNull(Collections.unmodifiableList(docs), DOCS), ExceptionsHelper.requireNonNull(Collections.unmodifiableList(docs), DOCS),
null, null,
@ -294,7 +288,7 @@ public class InferModelAction extends ActionType<InferModelAction.Response> {
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
InferModelAction.Request that = (InferModelAction.Request) o; Request that = (Request) o;
return Objects.equals(id, that.id) return Objects.equals(id, that.id)
&& Objects.equals(update, that.update) && Objects.equals(update, that.update)
&& Objects.equals(previouslyLicensed, that.previouslyLicensed) && Objects.equals(previouslyLicensed, that.previouslyLicensed)
@ -412,7 +406,7 @@ public class InferModelAction extends ActionType<InferModelAction.Response> {
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false; if (o == null || getClass() != o.getClass()) return false;
InferModelAction.Response that = (InferModelAction.Response) o; Response that = (Response) o;
return isLicensed == that.isLicensed && Objects.equals(inferenceResults, that.inferenceResults) && Objects.equals(id, that.id); return isLicensed == that.isLicensed && Objects.equals(inferenceResults, that.inferenceResults) && Objects.equals(id, that.id);
} }

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