commit
2cdf3eeae0
|
@ -35,7 +35,7 @@ import java.util.List;
|
|||
|
||||
public class NoopPlugin extends Plugin implements ActionPlugin {
|
||||
@Override
|
||||
public List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
|
||||
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
|
||||
return Arrays.asList(
|
||||
new ActionHandler<>(NoopBulkAction.INSTANCE, TransportNoopBulkAction.class),
|
||||
new ActionHandler<>(NoopSearchAction.INSTANCE, TransportNoopSearchAction.class)
|
||||
|
|
|
@ -356,7 +356,7 @@ public class ActionModule extends AbstractModule {
|
|||
register(handler.getAction().name(), handler);
|
||||
}
|
||||
|
||||
public <Request extends ActionRequest<Request>, Response extends ActionResponse> void register(
|
||||
public <Request extends ActionRequest, Response extends ActionResponse> void register(
|
||||
GenericAction<Request, Response> action, Class<? extends TransportAction<Request, Response>> transportAction,
|
||||
Class<?>... supportTransportActions) {
|
||||
register(new ActionHandler<>(action, transportAction, supportTransportActions));
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.elasticsearch.transport.TransportRequest;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
public abstract class ActionRequest<Request extends ActionRequest<Request>> extends TransportRequest {
|
||||
public abstract class ActionRequest extends TransportRequest {
|
||||
|
||||
public ActionRequest() {
|
||||
super();
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.elasticsearch.action.ActionRequestValidationException;
|
|||
* Transport level private response for the transport handler registered under
|
||||
* {@value org.elasticsearch.action.admin.cluster.node.liveness.TransportLivenessAction#NAME}
|
||||
*/
|
||||
public final class LivenessRequest extends ActionRequest<LivenessRequest> {
|
||||
public final class LivenessRequest extends ActionRequest {
|
||||
@Override
|
||||
public ActionRequestValidationException validate() {
|
||||
return null;
|
||||
|
|
|
@ -33,7 +33,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
|
|||
/**
|
||||
* A request to get node tasks
|
||||
*/
|
||||
public class GetTaskRequest extends ActionRequest<GetTaskRequest> {
|
||||
public class GetTaskRequest extends ActionRequest {
|
||||
private TaskId taskId = TaskId.EMPTY_TASK_ID;
|
||||
private boolean waitForCompletion = false;
|
||||
private TimeValue timeout = null;
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
|
|||
import java.io.IOException;
|
||||
|
||||
/** Request the mappings of specific fields */
|
||||
public class GetFieldMappingsRequest extends ActionRequest<GetFieldMappingsRequest> implements IndicesRequest.Replaceable {
|
||||
public class GetFieldMappingsRequest extends ActionRequest implements IndicesRequest.Replaceable {
|
||||
|
||||
protected boolean local = false;
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
|
|||
* Note that we only support refresh on the bulk request not per item.
|
||||
* @see org.elasticsearch.client.Client#bulk(BulkRequest)
|
||||
*/
|
||||
public class BulkRequest extends ActionRequest<BulkRequest> implements CompositeIndicesRequest, WriteRequest<BulkRequest> {
|
||||
public class BulkRequest extends ActionRequest implements CompositeIndicesRequest, WriteRequest<BulkRequest> {
|
||||
private static final DeprecationLogger DEPRECATION_LOGGER =
|
||||
new DeprecationLogger(Loggers.getLogger(BulkRequest.class));
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ import java.util.Collections;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class MultiGetRequest extends ActionRequest<MultiGetRequest> implements Iterable<MultiGetRequest.Item>, CompositeIndicesRequest, RealtimeRequest {
|
||||
public class MultiGetRequest extends ActionRequest implements Iterable<MultiGetRequest.Item>, CompositeIndicesRequest, RealtimeRequest {
|
||||
|
||||
/**
|
||||
* A single get item.
|
||||
|
|
|
@ -59,7 +59,7 @@ public final class IngestActionFilter extends AbstractComponent implements Actio
|
|||
}
|
||||
|
||||
@Override
|
||||
public <Request extends ActionRequest<Request>, Response extends ActionResponse> void apply(Task task, String action, Request request, ActionListener<Response> listener, ActionFilterChain<Request, Response> chain) {
|
||||
public <Request extends ActionRequest, Response extends ActionResponse> void apply(Task task, String action, Request request, ActionListener<Response> listener, ActionFilterChain<Request, Response> chain) {
|
||||
switch (action) {
|
||||
case IndexAction.NAME:
|
||||
IndexRequest indexRequest = (IndexRequest) request;
|
||||
|
|
|
@ -54,7 +54,7 @@ public final class IngestProxyActionFilter implements ActionFilter {
|
|||
}
|
||||
|
||||
@Override
|
||||
public <Request extends ActionRequest<Request>, Response extends ActionResponse> void apply(Task task, String action, Request request, ActionListener<Response> listener, ActionFilterChain<Request, Response> chain) {
|
||||
public <Request extends ActionRequest, Response extends ActionResponse> void apply(Task task, String action, Request request, ActionListener<Response> listener, ActionFilterChain<Request, Response> chain) {
|
||||
Action ingestAction;
|
||||
switch (action) {
|
||||
case IndexAction.NAME:
|
||||
|
|
|
@ -37,7 +37,7 @@ import java.util.Map;
|
|||
|
||||
import static org.elasticsearch.ingest.IngestDocument.MetaData;
|
||||
|
||||
public class SimulatePipelineRequest extends ActionRequest<SimulatePipelineRequest> {
|
||||
public class SimulatePipelineRequest extends ActionRequest {
|
||||
|
||||
private String id;
|
||||
private boolean verbose;
|
||||
|
|
|
@ -22,7 +22,7 @@ package org.elasticsearch.action.main;
|
|||
import org.elasticsearch.action.ActionRequest;
|
||||
import org.elasticsearch.action.ActionRequestValidationException;
|
||||
|
||||
public class MainRequest extends ActionRequest<MainRequest> {
|
||||
public class MainRequest extends ActionRequest {
|
||||
|
||||
@Override
|
||||
public ActionRequestValidationException validate() {
|
||||
|
|
|
@ -31,7 +31,7 @@ import java.util.List;
|
|||
|
||||
import static org.elasticsearch.action.ValidateActions.addValidationError;
|
||||
|
||||
public class ClearScrollRequest extends ActionRequest<ClearScrollRequest> {
|
||||
public class ClearScrollRequest extends ActionRequest {
|
||||
|
||||
private List<String> scrollIds;
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
|
|||
/**
|
||||
* A multi search API request.
|
||||
*/
|
||||
public class MultiSearchRequest extends ActionRequest<MultiSearchRequest> implements CompositeIndicesRequest {
|
||||
public class MultiSearchRequest extends ActionRequest implements CompositeIndicesRequest {
|
||||
|
||||
private int maxConcurrentSearchRequests = 0;
|
||||
private List<SearchRequest> requests = new ArrayList<>();
|
||||
|
|
|
@ -49,7 +49,7 @@ import java.util.Objects;
|
|||
* @see org.elasticsearch.client.Client#search(SearchRequest)
|
||||
* @see SearchResponse
|
||||
*/
|
||||
public final class SearchRequest extends ActionRequest<SearchRequest> implements IndicesRequest.Replaceable {
|
||||
public final class SearchRequest extends ActionRequest implements IndicesRequest.Replaceable {
|
||||
|
||||
private SearchType searchType = SearchType.DEFAULT;
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.Objects;
|
|||
|
||||
import static org.elasticsearch.action.ValidateActions.addValidationError;
|
||||
|
||||
public class SearchScrollRequest extends ActionRequest<SearchScrollRequest> {
|
||||
public class SearchScrollRequest extends ActionRequest {
|
||||
|
||||
private String scrollId;
|
||||
private Scroll scroll;
|
||||
|
|
|
@ -40,7 +40,7 @@ public interface ActionFilter {
|
|||
* Enables filtering the execution of an action on the request side, either by sending a response through the
|
||||
* {@link ActionListener} or by continuing the execution through the given {@link ActionFilterChain chain}
|
||||
*/
|
||||
<Request extends ActionRequest<Request>, Response extends ActionResponse> void apply(Task task, String action, Request request,
|
||||
<Request extends ActionRequest, Response extends ActionResponse> void apply(Task task, String action, Request request,
|
||||
ActionListener<Response> listener, ActionFilterChain<Request, Response> chain);
|
||||
|
||||
/**
|
||||
|
@ -62,7 +62,7 @@ public interface ActionFilter {
|
|||
}
|
||||
|
||||
@Override
|
||||
public final <Request extends ActionRequest<Request>, Response extends ActionResponse> void apply(Task task, String action, Request request,
|
||||
public final <Request extends ActionRequest, Response extends ActionResponse> void apply(Task task, String action, Request request,
|
||||
ActionListener<Response> listener, ActionFilterChain<Request, Response> chain) {
|
||||
if (apply(action, request, listener)) {
|
||||
chain.proceed(task, action, request, listener);
|
||||
|
@ -73,7 +73,7 @@ public interface ActionFilter {
|
|||
* Applies this filter and returns {@code true} if the execution chain should proceed, or {@code false}
|
||||
* if it should be aborted since the filter already handled the request and called the given listener.
|
||||
*/
|
||||
protected abstract boolean apply(String action, ActionRequest<?> request, ActionListener<?> listener);
|
||||
protected abstract boolean apply(String action, ActionRequest request, ActionListener<?> listener);
|
||||
|
||||
@Override
|
||||
public final <Response extends ActionResponse> void apply(String action, Response response, ActionListener<Response> listener,
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.elasticsearch.tasks.Task;
|
|||
/**
|
||||
* A filter chain allowing to continue and process the transport action request
|
||||
*/
|
||||
public interface ActionFilterChain<Request extends ActionRequest<Request>, Response extends ActionResponse> {
|
||||
public interface ActionFilterChain<Request extends ActionRequest, Response extends ActionResponse> {
|
||||
|
||||
/**
|
||||
* Continue processing the request. Should only be called if a response has not been sent through
|
||||
|
|
|
@ -35,7 +35,7 @@ import java.util.function.Supplier;
|
|||
/**
|
||||
* A TransportAction that self registers a handler into the transport service
|
||||
*/
|
||||
public abstract class HandledTransportAction<Request extends ActionRequest<Request>, Response extends ActionResponse>
|
||||
public abstract class HandledTransportAction<Request extends ActionRequest, Response extends ActionResponse>
|
||||
extends TransportAction<Request, Response> {
|
||||
protected HandledTransportAction(Settings settings, String actionName, ThreadPool threadPool, TransportService transportService,
|
||||
ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver,
|
||||
|
|
|
@ -38,7 +38,7 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||
|
||||
import static org.elasticsearch.action.support.PlainActionFuture.newFuture;
|
||||
|
||||
public abstract class TransportAction<Request extends ActionRequest<Request>, Response extends ActionResponse> extends AbstractComponent {
|
||||
public abstract class TransportAction<Request extends ActionRequest, Response extends ActionResponse> extends AbstractComponent {
|
||||
|
||||
protected final ThreadPool threadPool;
|
||||
protected final String actionName;
|
||||
|
@ -148,7 +148,7 @@ public abstract class TransportAction<Request extends ActionRequest<Request>, Re
|
|||
|
||||
protected abstract void doExecute(Request request, ActionListener<Response> listener);
|
||||
|
||||
private static class RequestFilterChain<Request extends ActionRequest<Request>, Response extends ActionResponse>
|
||||
private static class RequestFilterChain<Request extends ActionRequest, Response extends ActionResponse>
|
||||
implements ActionFilterChain<Request, Response> {
|
||||
|
||||
private final TransportAction<Request, Response> action;
|
||||
|
@ -184,7 +184,7 @@ public abstract class TransportAction<Request extends ActionRequest<Request>, Re
|
|||
}
|
||||
}
|
||||
|
||||
private static class ResponseFilterChain<Request extends ActionRequest<Request>, Response extends ActionResponse>
|
||||
private static class ResponseFilterChain<Request extends ActionRequest, Response extends ActionResponse>
|
||||
implements ActionFilterChain<Request, Response> {
|
||||
|
||||
private final ActionFilter[] filters;
|
||||
|
|
|
@ -28,7 +28,7 @@ import org.elasticsearch.common.io.stream.StreamOutput;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
public class BroadcastRequest<Request extends BroadcastRequest<Request>> extends ActionRequest<Request> implements IndicesRequest.Replaceable {
|
||||
public class BroadcastRequest<Request extends BroadcastRequest<Request>> extends ActionRequest implements IndicesRequest.Replaceable {
|
||||
|
||||
protected String[] indices;
|
||||
private IndicesOptions indicesOptions = IndicesOptions.strictExpandOpenAndForbidClosed();
|
||||
|
|
|
@ -29,7 +29,7 @@ import java.io.IOException;
|
|||
/**
|
||||
* A based request for master based operation.
|
||||
*/
|
||||
public abstract class MasterNodeRequest<Request extends MasterNodeRequest<Request>> extends ActionRequest<Request> {
|
||||
public abstract class MasterNodeRequest<Request extends MasterNodeRequest<Request>> extends ActionRequest {
|
||||
|
||||
public static final TimeValue DEFAULT_MASTER_NODE_TIMEOUT = TimeValue.timeValueSeconds(30);
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import org.elasticsearch.common.unit.TimeValue;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
public abstract class BaseNodesRequest<Request extends BaseNodesRequest<Request>> extends ActionRequest<Request> {
|
||||
public abstract class BaseNodesRequest<Request extends BaseNodesRequest<Request>> extends ActionRequest {
|
||||
|
||||
/**
|
||||
* the list of nodesIds that will be used to resolve this request and {@link #concreteNodes}
|
||||
|
|
|
@ -43,7 +43,7 @@ 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
|
||||
* {@link TransportShardRefreshAction}.
|
||||
*/
|
||||
public abstract class ReplicationRequest<Request extends ReplicationRequest<Request>> extends ActionRequest<Request>
|
||||
public abstract class ReplicationRequest<Request extends ReplicationRequest<Request>> extends ActionRequest
|
||||
implements IndicesRequest {
|
||||
|
||||
public static final TimeValue DEFAULT_TIMEOUT = new TimeValue(1, TimeUnit.MINUTES);
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.elasticsearch.index.shard.ShardId;
|
|||
import java.io.IOException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public abstract class InstanceShardOperationRequest<Request extends InstanceShardOperationRequest<Request>> extends ActionRequest<Request>
|
||||
public abstract class InstanceShardOperationRequest<Request extends InstanceShardOperationRequest<Request>> extends ActionRequest
|
||||
implements IndicesRequest {
|
||||
|
||||
public static final TimeValue DEFAULT_TIMEOUT = new TimeValue(1, TimeUnit.MINUTES);
|
||||
|
|
|
@ -31,7 +31,7 @@ import org.elasticsearch.index.shard.ShardId;
|
|||
|
||||
import java.io.IOException;
|
||||
|
||||
public abstract class SingleShardRequest<Request extends SingleShardRequest<Request>> extends ActionRequest<Request> implements IndicesRequest {
|
||||
public abstract class SingleShardRequest<Request extends SingleShardRequest<Request>> extends ActionRequest implements IndicesRequest {
|
||||
|
||||
public static final IndicesOptions INDICES_OPTIONS = IndicesOptions.strictSingleIndexNoExpandForbidClosed();
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
|
|||
/**
|
||||
* A base class for task requests
|
||||
*/
|
||||
public class BaseTasksRequest<Request extends BaseTasksRequest<Request>> extends ActionRequest<Request> {
|
||||
public class BaseTasksRequest<Request extends BaseTasksRequest<Request>> extends ActionRequest {
|
||||
|
||||
public static final String[] ALL_ACTIONS = Strings.EMPTY_ARRAY;
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class MultiTermVectorsRequest extends ActionRequest<MultiTermVectorsRequest> implements Iterable<TermVectorsRequest>, CompositeIndicesRequest, RealtimeRequest {
|
||||
public class MultiTermVectorsRequest extends ActionRequest implements Iterable<TermVectorsRequest>, CompositeIndicesRequest, RealtimeRequest {
|
||||
|
||||
String preference;
|
||||
List<TermVectorsRequest> requests = new ArrayList<>();
|
||||
|
|
|
@ -40,7 +40,7 @@ public interface ElasticsearchClient {
|
|||
* @param <RequestBuilder> The request builder type.
|
||||
* @return A future allowing to get back the response.
|
||||
*/
|
||||
<Request extends ActionRequest<Request>, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> ActionFuture<Response> execute(
|
||||
<Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> ActionFuture<Response> execute(
|
||||
final Action<Request, Response, RequestBuilder> action, final Request request);
|
||||
|
||||
/**
|
||||
|
@ -53,7 +53,7 @@ public interface ElasticsearchClient {
|
|||
* @param <Response> The response type.
|
||||
* @param <RequestBuilder> The request builder type.
|
||||
*/
|
||||
<Request extends ActionRequest<Request>, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> void execute(
|
||||
<Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> void execute(
|
||||
final Action<Request, Response, RequestBuilder> action, final Request request, ActionListener<Response> listener);
|
||||
|
||||
/**
|
||||
|
@ -65,7 +65,7 @@ public interface ElasticsearchClient {
|
|||
* @param <RequestBuilder> The request builder.
|
||||
* @return The request builder, that can, at a later stage, execute the request.
|
||||
*/
|
||||
<Request extends ActionRequest<Request>, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> RequestBuilder prepareExecute(
|
||||
<Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> RequestBuilder prepareExecute(
|
||||
final Action<Request, Response, RequestBuilder> action);
|
||||
|
||||
/**
|
||||
|
|
|
@ -62,7 +62,7 @@ public abstract class FilterClient extends AbstractClient {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected <Request extends ActionRequest<Request>, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(
|
||||
protected <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(
|
||||
Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
|
||||
in().execute(action, request, listener);
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ public class ParentTaskAssigningClient extends FilterClient {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected < Request extends ActionRequest<Request>,
|
||||
protected < Request extends ActionRequest,
|
||||
Response extends ActionResponse,
|
||||
RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>
|
||||
> void doExecute(Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
|
||||
|
|
|
@ -56,7 +56,7 @@ public class NodeClient extends AbstractClient {
|
|||
}
|
||||
|
||||
@Override
|
||||
public < Request extends ActionRequest<Request>,
|
||||
public < Request extends ActionRequest,
|
||||
Response extends ActionResponse,
|
||||
RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>
|
||||
> void doExecute(Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
|
||||
|
@ -69,7 +69,7 @@ public class NodeClient extends AbstractClient {
|
|||
* method if you don't need access to the task when listening for the response. This is the method used to implement the {@link Client}
|
||||
* interface.
|
||||
*/
|
||||
public < Request extends ActionRequest<Request>,
|
||||
public < Request extends ActionRequest,
|
||||
Response extends ActionResponse
|
||||
> Task executeLocally(GenericAction<Request, Response> action, Request request, ActionListener<Response> listener) {
|
||||
return transportAction(action).execute(request, listener);
|
||||
|
@ -79,7 +79,7 @@ public class NodeClient extends AbstractClient {
|
|||
* Execute an {@link Action} locally, returning that {@link Task} used to track it, and linking an {@link TaskListener}. Prefer this
|
||||
* method if you need access to the task when listening for the response.
|
||||
*/
|
||||
public < Request extends ActionRequest<Request>,
|
||||
public < Request extends ActionRequest,
|
||||
Response extends ActionResponse
|
||||
> Task executeLocally(GenericAction<Request, Response> action, Request request, TaskListener<Response> listener) {
|
||||
return transportAction(action).execute(request, listener);
|
||||
|
@ -89,7 +89,7 @@ public class NodeClient extends AbstractClient {
|
|||
* Get the {@link TransportAction} for an {@link Action}, throwing exceptions if the action isn't available.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private < Request extends ActionRequest<Request>,
|
||||
private < Request extends ActionRequest,
|
||||
Response extends ActionResponse
|
||||
> TransportAction<Request, Response> transportAction(GenericAction<Request, Response> action) {
|
||||
if (actions == null) {
|
||||
|
|
|
@ -377,13 +377,13 @@ public abstract class AbstractClient extends AbstractComponent implements Client
|
|||
}
|
||||
|
||||
@Override
|
||||
public final <Request extends ActionRequest<Request>, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> RequestBuilder prepareExecute(
|
||||
public final <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> RequestBuilder prepareExecute(
|
||||
final Action<Request, Response, RequestBuilder> action) {
|
||||
return action.newRequestBuilder(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final <Request extends ActionRequest<Request>, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> ActionFuture<Response> execute(
|
||||
public final <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> ActionFuture<Response> execute(
|
||||
Action<Request, Response, RequestBuilder> action, Request request) {
|
||||
PlainActionFuture<Response> actionFuture = PlainActionFuture.newFuture();
|
||||
execute(action, request, actionFuture);
|
||||
|
@ -394,13 +394,13 @@ public abstract class AbstractClient extends AbstractComponent implements Client
|
|||
* This is the single execution point of *all* clients.
|
||||
*/
|
||||
@Override
|
||||
public final <Request extends ActionRequest<Request>, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> void execute(
|
||||
public final <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> void execute(
|
||||
Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
|
||||
listener = threadedWrapper.wrap(listener);
|
||||
doExecute(action, request, listener);
|
||||
}
|
||||
|
||||
protected abstract <Request extends ActionRequest<Request>, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(final Action<Request, Response, RequestBuilder> action, final Request request, ActionListener<Response> listener);
|
||||
protected abstract <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(final Action<Request, Response, RequestBuilder> action, final Request request, ActionListener<Response> listener);
|
||||
|
||||
@Override
|
||||
public ActionFuture<IndexResponse> index(final IndexRequest request) {
|
||||
|
@ -696,19 +696,19 @@ public abstract class AbstractClient extends AbstractComponent implements Client
|
|||
}
|
||||
|
||||
@Override
|
||||
public <Request extends ActionRequest<Request>, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> ActionFuture<Response> execute(
|
||||
public <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> ActionFuture<Response> execute(
|
||||
Action<Request, Response, RequestBuilder> action, Request request) {
|
||||
return client.execute(action, request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Request extends ActionRequest<Request>, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> void execute(
|
||||
public <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> void execute(
|
||||
Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
|
||||
client.execute(action, request, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Request extends ActionRequest<Request>, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> RequestBuilder prepareExecute(
|
||||
public <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> RequestBuilder prepareExecute(
|
||||
Action<Request, Response, RequestBuilder> action) {
|
||||
return client.prepareExecute(action);
|
||||
}
|
||||
|
@ -1212,19 +1212,19 @@ public abstract class AbstractClient extends AbstractComponent implements Client
|
|||
}
|
||||
|
||||
@Override
|
||||
public <Request extends ActionRequest<Request>, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> ActionFuture<Response> execute(
|
||||
public <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> ActionFuture<Response> execute(
|
||||
Action<Request, Response, RequestBuilder> action, Request request) {
|
||||
return client.execute(action, request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Request extends ActionRequest<Request>, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> void execute(
|
||||
public <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> void execute(
|
||||
Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
|
||||
client.execute(action, request, listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <Request extends ActionRequest<Request>, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> RequestBuilder prepareExecute(
|
||||
public <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> RequestBuilder prepareExecute(
|
||||
Action<Request, Response, RequestBuilder> action) {
|
||||
return client.prepareExecute(action);
|
||||
}
|
||||
|
@ -1745,7 +1745,7 @@ public abstract class AbstractClient extends AbstractComponent implements Client
|
|||
public Client filterWithHeader(Map<String, String> headers) {
|
||||
return new FilterClient(this) {
|
||||
@Override
|
||||
protected <Request extends ActionRequest<Request>, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
|
||||
protected <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
|
||||
ThreadContext threadContext = threadPool().getThreadContext();
|
||||
try (ThreadContext.StoredContext ctx = threadContext.stashAndMergeHeaders(headers)) {
|
||||
super.doExecute(action, request, listener);
|
||||
|
|
|
@ -329,7 +329,7 @@ public abstract class TransportClient extends AbstractClient {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected <Request extends ActionRequest<Request>, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
|
||||
protected <Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
|
||||
proxy.execute(action, request, listener);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ public interface ActionPlugin {
|
|||
/**
|
||||
* Actions added by this plugin.
|
||||
*/
|
||||
default List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
|
||||
default List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
/**
|
||||
|
@ -72,7 +72,7 @@ public interface ActionPlugin {
|
|||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
final class ActionHandler<Request extends ActionRequest<Request>, Response extends ActionResponse> {
|
||||
final class ActionHandler<Request extends ActionRequest, Response extends ActionResponse> {
|
||||
private final GenericAction<Request, Response> action;
|
||||
private final Class<? extends TransportAction<Request, Response>> transportAction;
|
||||
private final Class<?>[] supportTransportActions;
|
||||
|
|
|
@ -52,7 +52,7 @@ public class ActionModuleTests extends ESTestCase {
|
|||
public void testPluginCantOverwriteBuiltinAction() {
|
||||
ActionPlugin dupsMainAction = new ActionPlugin() {
|
||||
@Override
|
||||
public List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
|
||||
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
|
||||
return singletonList(new ActionHandler<>(MainAction.INSTANCE, TransportMainAction.class));
|
||||
}
|
||||
};
|
||||
|
@ -61,7 +61,7 @@ public class ActionModuleTests extends ESTestCase {
|
|||
}
|
||||
|
||||
public void testPluginCanRegisterAction() {
|
||||
class FakeRequest extends ActionRequest<FakeRequest> {
|
||||
class FakeRequest extends ActionRequest {
|
||||
@Override
|
||||
public ActionRequestValidationException validate() {
|
||||
return null;
|
||||
|
@ -90,7 +90,7 @@ public class ActionModuleTests extends ESTestCase {
|
|||
FakeAction action = new FakeAction();
|
||||
ActionPlugin registersFakeAction = new ActionPlugin() {
|
||||
@Override
|
||||
public List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
|
||||
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
|
||||
return singletonList(new ActionHandler<>(action, FakeTransportAction.class));
|
||||
}
|
||||
};
|
||||
|
|
|
@ -70,7 +70,7 @@ import static org.elasticsearch.test.ESTestCase.awaitBusy;
|
|||
public class TestTaskPlugin extends Plugin implements ActionPlugin {
|
||||
|
||||
@Override
|
||||
public List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
|
||||
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
|
||||
return Arrays.asList(new ActionHandler<>(TestTaskAction.INSTANCE, TransportTestTaskAction.class),
|
||||
new ActionHandler<>(UnblockTestTasksAction.INSTANCE, TransportUnblockTestTasksAction.class));
|
||||
}
|
||||
|
|
|
@ -222,7 +222,7 @@ public class TransportActionFilterChainTests extends ESTestCase {
|
|||
|
||||
RequestTestFilter testFilter = new RequestTestFilter(randomInt(), new RequestCallback() {
|
||||
@Override
|
||||
public <Request extends ActionRequest<Request>, Response extends ActionResponse> void execute(Task task, String action, Request request,
|
||||
public <Request extends ActionRequest, Response extends ActionResponse> void execute(Task task, String action, Request request,
|
||||
ActionListener<Response> listener, ActionFilterChain<Request, Response> actionFilterChain) {
|
||||
for (int i = 0; i <= additionalContinueCount; i++) {
|
||||
actionFilterChain.proceed(task, action, request, listener);
|
||||
|
@ -349,7 +349,7 @@ public class TransportActionFilterChainTests extends ESTestCase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public <Request extends ActionRequest<Request>, Response extends ActionResponse> void apply(Task task, String action, Request request,
|
||||
public <Request extends ActionRequest, Response extends ActionResponse> void apply(Task task, String action, Request request,
|
||||
ActionListener<Response> listener, ActionFilterChain<Request, Response> chain) {
|
||||
this.runs.incrementAndGet();
|
||||
this.lastActionName = action;
|
||||
|
@ -382,7 +382,7 @@ public class TransportActionFilterChainTests extends ESTestCase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public <Request extends ActionRequest<Request>, Response extends ActionResponse> void apply(Task task, String action, Request request,
|
||||
public <Request extends ActionRequest, Response extends ActionResponse> void apply(Task task, String action, Request request,
|
||||
ActionListener<Response> listener, ActionFilterChain<Request, Response> chain) {
|
||||
chain.proceed(task, action, request, listener);
|
||||
}
|
||||
|
@ -400,7 +400,7 @@ public class TransportActionFilterChainTests extends ESTestCase {
|
|||
private static enum RequestOperation implements RequestCallback {
|
||||
CONTINUE_PROCESSING {
|
||||
@Override
|
||||
public <Request extends ActionRequest<Request>, Response extends ActionResponse> void execute(Task task, String action, Request request,
|
||||
public <Request extends ActionRequest, Response extends ActionResponse> void execute(Task task, String action, Request request,
|
||||
ActionListener<Response> listener, ActionFilterChain<Request, Response> actionFilterChain) {
|
||||
actionFilterChain.proceed(task, action, request, listener);
|
||||
}
|
||||
|
@ -408,14 +408,14 @@ public class TransportActionFilterChainTests extends ESTestCase {
|
|||
LISTENER_RESPONSE {
|
||||
@Override
|
||||
@SuppressWarnings("unchecked") // Safe because its all we test with
|
||||
public <Request extends ActionRequest<Request>, Response extends ActionResponse> void execute(Task task, String action, Request request,
|
||||
public <Request extends ActionRequest, Response extends ActionResponse> void execute(Task task, String action, Request request,
|
||||
ActionListener<Response> listener, ActionFilterChain<Request, Response> actionFilterChain) {
|
||||
((ActionListener<TestResponse>) listener).onResponse(new TestResponse());
|
||||
}
|
||||
},
|
||||
LISTENER_FAILURE {
|
||||
@Override
|
||||
public <Request extends ActionRequest<Request>, Response extends ActionResponse> void execute(Task task, String action, Request request,
|
||||
public <Request extends ActionRequest, Response extends ActionResponse> void execute(Task task, String action, Request request,
|
||||
ActionListener<Response> listener, ActionFilterChain<Request, Response> actionFilterChain) {
|
||||
listener.onFailure(new ElasticsearchTimeoutException(""));
|
||||
}
|
||||
|
@ -448,7 +448,7 @@ public class TransportActionFilterChainTests extends ESTestCase {
|
|||
}
|
||||
|
||||
private interface RequestCallback {
|
||||
<Request extends ActionRequest<Request>, Response extends ActionResponse> void execute(Task task, String action, Request request,
|
||||
<Request extends ActionRequest, Response extends ActionResponse> void execute(Task task, String action, Request request,
|
||||
ActionListener<Response> listener, ActionFilterChain<Request, Response> actionFilterChain);
|
||||
}
|
||||
|
||||
|
@ -457,7 +457,7 @@ public class TransportActionFilterChainTests extends ESTestCase {
|
|||
ActionFilterChain<?, Response> chain);
|
||||
}
|
||||
|
||||
public static class TestRequest extends ActionRequest<TestRequest> {
|
||||
public static class TestRequest extends ActionRequest {
|
||||
@Override
|
||||
public ActionRequestValidationException validate() {
|
||||
return null;
|
||||
|
|
|
@ -38,7 +38,7 @@ public class ParentTaskAssigningClientTests extends ESTestCase {
|
|||
// This mock will do nothing but verify that parentTaskId is set on all requests sent to it.
|
||||
NoOpClient mock = new NoOpClient(getTestName()) {
|
||||
@Override
|
||||
protected < Request extends ActionRequest<Request>,
|
||||
protected < Request extends ActionRequest,
|
||||
Response extends ActionResponse,
|
||||
RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>
|
||||
> void doExecute( Action<Request, Response, RequestBuilder> action, Request request,
|
||||
|
|
|
@ -93,7 +93,7 @@ public class ClusterInfoServiceIT extends ESIntegTestCase {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean apply(String action, ActionRequest<?> request, ActionListener<?> listener) {
|
||||
protected boolean apply(String action, ActionRequest request, ActionListener<?> listener) {
|
||||
if (blockedActions.contains(action)) {
|
||||
throw new ElasticsearchException("force exception on [" + action + "]");
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.List;
|
|||
|
||||
import static org.elasticsearch.action.ValidateActions.addValidationError;
|
||||
|
||||
public class MultiSearchTemplateRequest extends ActionRequest<MultiSearchTemplateRequest> implements CompositeIndicesRequest {
|
||||
public class MultiSearchTemplateRequest extends ActionRequest implements CompositeIndicesRequest {
|
||||
|
||||
private List<SearchTemplateRequest> requests = new ArrayList<>();
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ public class MustachePlugin extends Plugin implements ScriptPlugin, ActionPlugin
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
|
||||
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
|
||||
return Arrays.asList(new ActionHandler<>(SearchTemplateAction.INSTANCE, TransportSearchTemplateAction.class),
|
||||
new ActionHandler<>(MultiSearchTemplateAction.INSTANCE, TransportMultiSearchTemplateAction.class));
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
|
|||
/**
|
||||
* A request to execute a search based on a search template.
|
||||
*/
|
||||
public class SearchTemplateRequest extends ActionRequest<SearchTemplateRequest> implements IndicesRequest {
|
||||
public class SearchTemplateRequest extends ActionRequest implements IndicesRequest {
|
||||
|
||||
private SearchRequest request;
|
||||
private boolean simulate = false;
|
||||
|
|
|
@ -48,7 +48,7 @@ import static org.elasticsearch.common.xcontent.support.XContentMapValues.nodeSt
|
|||
* @deprecated Instead use multi search API with {@link PercolateQueryBuilder}
|
||||
*/
|
||||
@Deprecated
|
||||
public class MultiPercolateRequest extends ActionRequest<MultiPercolateRequest> implements CompositeIndicesRequest {
|
||||
public class MultiPercolateRequest extends ActionRequest implements CompositeIndicesRequest {
|
||||
|
||||
private String[] indices;
|
||||
private String documentType;
|
||||
|
|
|
@ -44,7 +44,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError;
|
|||
* @deprecated Instead use search API with {@link PercolateQueryBuilder}
|
||||
*/
|
||||
@Deprecated
|
||||
public class PercolateRequest extends ActionRequest<PercolateRequest> implements IndicesRequest.Replaceable {
|
||||
public class PercolateRequest extends ActionRequest implements IndicesRequest.Replaceable {
|
||||
|
||||
protected String[] indices;
|
||||
private IndicesOptions indicesOptions = IndicesOptions.strictExpandOpenAndForbidClosed();
|
||||
|
|
|
@ -47,7 +47,7 @@ public class PercolatorPlugin extends Plugin implements MapperPlugin, ActionPlug
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
|
||||
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
|
||||
return Arrays.asList(new ActionHandler<>(PercolateAction.INSTANCE, TransportPercolateAction.class),
|
||||
new ActionHandler<>(MultiPercolateAction.INSTANCE, TransportMultiPercolateAction.class));
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ import static org.elasticsearch.common.unit.TimeValue.timeValueMillis;
|
|||
import static org.elasticsearch.common.unit.TimeValue.timeValueMinutes;
|
||||
|
||||
public abstract class AbstractBulkByScrollRequest<Self extends AbstractBulkByScrollRequest<Self>>
|
||||
extends ActionRequest<Self> {
|
||||
extends ActionRequest {
|
||||
public static final int SIZE_ALL_MATCHES = -1;
|
||||
private static final TimeValue DEFAULT_SCROLL_TIMEOUT = timeValueMinutes(5);
|
||||
private static final int DEFAULT_SCROLL_SIZE = 1000;
|
||||
|
|
|
@ -37,7 +37,7 @@ public class ReindexPlugin extends Plugin implements ActionPlugin {
|
|||
public static final String NAME = "reindex";
|
||||
|
||||
@Override
|
||||
public List<ActionHandler<? extends ActionRequest<?>, ? extends ActionResponse>> getActions() {
|
||||
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
|
||||
return Arrays.asList(new ActionHandler<>(ReindexAction.INSTANCE, TransportReindexAction.class),
|
||||
new ActionHandler<>(UpdateByQueryAction.INSTANCE, TransportUpdateByQueryAction.class),
|
||||
new ActionHandler<>(DeleteByQueryAction.INSTANCE, TransportDeleteByQueryAction.class),
|
||||
|
|
|
@ -55,7 +55,7 @@ public abstract class AbstractAsyncBulkIndexByScrollActionScriptTestCase<
|
|||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
protected <T extends ActionRequest<?>> T applyScript(Consumer<Map<String, Object>> scriptBody) {
|
||||
protected <T extends ActionRequest> T applyScript(Consumer<Map<String, Object>> scriptBody) {
|
||||
IndexRequest index = new IndexRequest("index", "type", "1").source(singletonMap("foo", "bar"));
|
||||
ScrollableHitSource.Hit doc = new ScrollableHitSource.BasicHit("test", "type", "id", 0);
|
||||
ExecutableScript executableScript = new SimpleExecutableScript(scriptBody);
|
||||
|
|
|
@ -726,7 +726,7 @@ public class AsyncBulkByScrollActionTests extends ESTestCase {
|
|||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
protected <Request extends ActionRequest<Request>, Response extends ActionResponse,
|
||||
protected <Request extends ActionRequest, Response extends ActionResponse,
|
||||
RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>> void doExecute(
|
||||
Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
|
||||
lastHeaders.set(threadPool.getThreadContext().getHeaders());
|
||||
|
@ -823,7 +823,7 @@ public class AsyncBulkByScrollActionTests extends ESTestCase {
|
|||
}
|
||||
}
|
||||
|
||||
private static class RequestAndListener<Request extends ActionRequest<Request>, Response> {
|
||||
private static class RequestAndListener<Request extends ActionRequest, Response> {
|
||||
private final Request request;
|
||||
private final ActionListener<Response> listener;
|
||||
|
||||
|
|
|
@ -165,7 +165,7 @@ public class ReindexFromRemoteWithAuthTests extends ESSingleNodeTestCase {
|
|||
}
|
||||
|
||||
@Override
|
||||
public <Request extends ActionRequest<Request>, Response extends ActionResponse> void apply(Task task, String action,
|
||||
public <Request extends ActionRequest, Response extends ActionResponse> void apply(Task task, String action,
|
||||
Request request, ActionListener<Response> listener, ActionFilterChain<Request, Response> chain) {
|
||||
if (false == action.equals(SearchAction.NAME)) {
|
||||
chain.proceed(task, action, request, listener);
|
||||
|
|
|
@ -39,7 +39,7 @@ public class NoOpClient extends AbstractClient {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected <Request extends ActionRequest<Request>,
|
||||
protected <Request extends ActionRequest,
|
||||
Response extends ActionResponse,
|
||||
RequestBuilder extends ActionRequestBuilder<Request, Response, RequestBuilder>>
|
||||
void doExecute(Action<Request, Response, RequestBuilder> action, Request request, ActionListener<Response> listener) {
|
||||
|
|
|
@ -653,7 +653,7 @@ public class ElasticsearchAssertions {
|
|||
// streamable that comes in.
|
||||
}
|
||||
if (streamable instanceof ActionRequest) {
|
||||
((ActionRequest<?>) streamable).validate();
|
||||
((ActionRequest) streamable).validate();
|
||||
}
|
||||
BytesReference orig;
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue