From d14c470b896ac77500f29bd0a7a2a258c1c625f7 Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Mon, 14 Nov 2016 15:32:01 -0800 Subject: [PATCH] Remove generics from ActionRequest closes #21368 --- .../elasticsearch/plugin/noop/NoopPlugin.java | 2 +- .../elasticsearch/action/ActionModule.java | 2 +- .../elasticsearch/action/ActionRequest.java | 2 +- .../node/liveness/LivenessRequest.java | 2 +- .../node/tasks/get/GetTaskRequest.java | 2 +- .../mapping/get/GetFieldMappingsRequest.java | 2 +- .../action/bulk/BulkRequest.java | 2 +- .../action/get/MultiGetRequest.java | 2 +- .../action/ingest/IngestActionFilter.java | 2 +- .../ingest/IngestProxyActionFilter.java | 2 +- .../ingest/SimulatePipelineRequest.java | 2 +- .../action/main/MainRequest.java | 2 +- .../action/search/ClearScrollRequest.java | 2 +- .../action/search/MultiSearchRequest.java | 2 +- .../action/search/SearchRequest.java | 2 +- .../action/search/SearchScrollRequest.java | 2 +- .../action/support/ActionFilter.java | 6 ++--- .../action/support/ActionFilterChain.java | 2 +- .../support/HandledTransportAction.java | 2 +- .../action/support/TransportAction.java | 6 ++--- .../support/broadcast/BroadcastRequest.java | 2 +- .../support/master/MasterNodeRequest.java | 2 +- .../support/nodes/BaseNodesRequest.java | 2 +- .../replication/ReplicationRequest.java | 2 +- .../InstanceShardOperationRequest.java | 2 +- .../single/shard/SingleShardRequest.java | 2 +- .../support/tasks/BaseTasksRequest.java | 2 +- .../termvectors/MultiTermVectorsRequest.java | 2 +- .../client/ElasticsearchClient.java | 6 ++--- .../elasticsearch/client/FilterClient.java | 2 +- .../client/ParentTaskAssigningClient.java | 2 +- .../elasticsearch/client/node/NodeClient.java | 8 +++---- .../client/support/AbstractClient.java | 22 +++++++++---------- .../client/transport/TransportClient.java | 2 +- .../elasticsearch/plugins/ActionPlugin.java | 4 ++-- .../action/ActionModuleTests.java | 6 ++--- .../cluster/node/tasks/TestTaskPlugin.java | 2 +- .../TransportActionFilterChainTests.java | 16 +++++++------- .../ParentTaskAssigningClientTests.java | 2 +- .../cluster/ClusterInfoServiceIT.java | 2 +- .../mustache/MultiSearchTemplateRequest.java | 2 +- .../script/mustache/MustachePlugin.java | 2 +- .../mustache/SearchTemplateRequest.java | 2 +- .../percolator/MultiPercolateRequest.java | 2 +- .../percolator/PercolateRequest.java | 2 +- .../percolator/PercolatorPlugin.java | 2 +- .../reindex/AbstractBulkByScrollRequest.java | 2 +- .../index/reindex/ReindexPlugin.java | 2 +- ...BulkIndexByScrollActionScriptTestCase.java | 2 +- .../reindex/AsyncBulkByScrollActionTests.java | 4 ++-- .../ReindexFromRemoteWithAuthTests.java | 2 +- .../elasticsearch/test/client/NoOpClient.java | 2 +- .../hamcrest/ElasticsearchAssertions.java | 2 +- 53 files changed, 83 insertions(+), 83 deletions(-) diff --git a/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/NoopPlugin.java b/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/NoopPlugin.java index 343d3cf613a..ac45f20dc25 100644 --- a/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/NoopPlugin.java +++ b/client/client-benchmark-noop-api-plugin/src/main/java/org/elasticsearch/plugin/noop/NoopPlugin.java @@ -35,7 +35,7 @@ import java.util.List; public class NoopPlugin extends Plugin implements ActionPlugin { @Override - public List, ? extends ActionResponse>> getActions() { + public List> getActions() { return Arrays.asList( new ActionHandler<>(NoopBulkAction.INSTANCE, TransportNoopBulkAction.class), new ActionHandler<>(NoopSearchAction.INSTANCE, TransportNoopSearchAction.class) diff --git a/core/src/main/java/org/elasticsearch/action/ActionModule.java b/core/src/main/java/org/elasticsearch/action/ActionModule.java index a3797c3cb88..0097db4b7c4 100644 --- a/core/src/main/java/org/elasticsearch/action/ActionModule.java +++ b/core/src/main/java/org/elasticsearch/action/ActionModule.java @@ -356,7 +356,7 @@ public class ActionModule extends AbstractModule { register(handler.getAction().name(), handler); } - public , Response extends ActionResponse> void register( + public void register( GenericAction action, Class> transportAction, Class... supportTransportActions) { register(new ActionHandler<>(action, transportAction, supportTransportActions)); diff --git a/core/src/main/java/org/elasticsearch/action/ActionRequest.java b/core/src/main/java/org/elasticsearch/action/ActionRequest.java index e8dd639c4df..769b2e7b573 100644 --- a/core/src/main/java/org/elasticsearch/action/ActionRequest.java +++ b/core/src/main/java/org/elasticsearch/action/ActionRequest.java @@ -25,7 +25,7 @@ import org.elasticsearch.transport.TransportRequest; import java.io.IOException; -public abstract class ActionRequest> extends TransportRequest { +public abstract class ActionRequest extends TransportRequest { public ActionRequest() { super(); diff --git a/core/src/main/java/org/elasticsearch/action/admin/cluster/node/liveness/LivenessRequest.java b/core/src/main/java/org/elasticsearch/action/admin/cluster/node/liveness/LivenessRequest.java index 033dd5957d9..d6441bb8e77 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/cluster/node/liveness/LivenessRequest.java +++ b/core/src/main/java/org/elasticsearch/action/admin/cluster/node/liveness/LivenessRequest.java @@ -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 { +public final class LivenessRequest extends ActionRequest { @Override public ActionRequestValidationException validate() { return null; diff --git a/core/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/get/GetTaskRequest.java b/core/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/get/GetTaskRequest.java index efbc9679e71..07d40b5ffca 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/get/GetTaskRequest.java +++ b/core/src/main/java/org/elasticsearch/action/admin/cluster/node/tasks/get/GetTaskRequest.java @@ -33,7 +33,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError; /** * A request to get node tasks */ -public class GetTaskRequest extends ActionRequest { +public class GetTaskRequest extends ActionRequest { private TaskId taskId = TaskId.EMPTY_TASK_ID; private boolean waitForCompletion = false; private TimeValue timeout = null; diff --git a/core/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsRequest.java b/core/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsRequest.java index 967ea31c84a..819d2de999c 100644 --- a/core/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsRequest.java +++ b/core/src/main/java/org/elasticsearch/action/admin/indices/mapping/get/GetFieldMappingsRequest.java @@ -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 implements IndicesRequest.Replaceable { +public class GetFieldMappingsRequest extends ActionRequest implements IndicesRequest.Replaceable { protected boolean local = false; diff --git a/core/src/main/java/org/elasticsearch/action/bulk/BulkRequest.java b/core/src/main/java/org/elasticsearch/action/bulk/BulkRequest.java index ee4f96d484a..48d163cdb26 100644 --- a/core/src/main/java/org/elasticsearch/action/bulk/BulkRequest.java +++ b/core/src/main/java/org/elasticsearch/action/bulk/BulkRequest.java @@ -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 implements CompositeIndicesRequest, WriteRequest { +public class BulkRequest extends ActionRequest implements CompositeIndicesRequest, WriteRequest { private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(Loggers.getLogger(BulkRequest.class)); diff --git a/core/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java b/core/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java index 1308d56acaf..ee4ce570df2 100644 --- a/core/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java +++ b/core/src/main/java/org/elasticsearch/action/get/MultiGetRequest.java @@ -48,7 +48,7 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; -public class MultiGetRequest extends ActionRequest implements Iterable, CompositeIndicesRequest, RealtimeRequest { +public class MultiGetRequest extends ActionRequest implements Iterable, CompositeIndicesRequest, RealtimeRequest { /** * A single get item. diff --git a/core/src/main/java/org/elasticsearch/action/ingest/IngestActionFilter.java b/core/src/main/java/org/elasticsearch/action/ingest/IngestActionFilter.java index 508ad90a9ea..5f7f32e1760 100644 --- a/core/src/main/java/org/elasticsearch/action/ingest/IngestActionFilter.java +++ b/core/src/main/java/org/elasticsearch/action/ingest/IngestActionFilter.java @@ -59,7 +59,7 @@ public final class IngestActionFilter extends AbstractComponent implements Actio } @Override - public , Response extends ActionResponse> void apply(Task task, String action, Request request, ActionListener listener, ActionFilterChain chain) { + public void apply(Task task, String action, Request request, ActionListener listener, ActionFilterChain chain) { switch (action) { case IndexAction.NAME: IndexRequest indexRequest = (IndexRequest) request; diff --git a/core/src/main/java/org/elasticsearch/action/ingest/IngestProxyActionFilter.java b/core/src/main/java/org/elasticsearch/action/ingest/IngestProxyActionFilter.java index 5d2aea389dc..a3928c17fc7 100644 --- a/core/src/main/java/org/elasticsearch/action/ingest/IngestProxyActionFilter.java +++ b/core/src/main/java/org/elasticsearch/action/ingest/IngestProxyActionFilter.java @@ -54,7 +54,7 @@ public final class IngestProxyActionFilter implements ActionFilter { } @Override - public , Response extends ActionResponse> void apply(Task task, String action, Request request, ActionListener listener, ActionFilterChain chain) { + public void apply(Task task, String action, Request request, ActionListener listener, ActionFilterChain chain) { Action ingestAction; switch (action) { case IndexAction.NAME: diff --git a/core/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineRequest.java b/core/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineRequest.java index a63f7a30dbe..c9761034418 100644 --- a/core/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineRequest.java +++ b/core/src/main/java/org/elasticsearch/action/ingest/SimulatePipelineRequest.java @@ -37,7 +37,7 @@ import java.util.Map; import static org.elasticsearch.ingest.IngestDocument.MetaData; -public class SimulatePipelineRequest extends ActionRequest { +public class SimulatePipelineRequest extends ActionRequest { private String id; private boolean verbose; diff --git a/core/src/main/java/org/elasticsearch/action/main/MainRequest.java b/core/src/main/java/org/elasticsearch/action/main/MainRequest.java index 1484bc2a3e9..1736e56a8dc 100644 --- a/core/src/main/java/org/elasticsearch/action/main/MainRequest.java +++ b/core/src/main/java/org/elasticsearch/action/main/MainRequest.java @@ -22,7 +22,7 @@ package org.elasticsearch.action.main; import org.elasticsearch.action.ActionRequest; import org.elasticsearch.action.ActionRequestValidationException; -public class MainRequest extends ActionRequest { +public class MainRequest extends ActionRequest { @Override public ActionRequestValidationException validate() { diff --git a/core/src/main/java/org/elasticsearch/action/search/ClearScrollRequest.java b/core/src/main/java/org/elasticsearch/action/search/ClearScrollRequest.java index f2f26d655d3..23c5c3747fb 100644 --- a/core/src/main/java/org/elasticsearch/action/search/ClearScrollRequest.java +++ b/core/src/main/java/org/elasticsearch/action/search/ClearScrollRequest.java @@ -31,7 +31,7 @@ import java.util.List; import static org.elasticsearch.action.ValidateActions.addValidationError; -public class ClearScrollRequest extends ActionRequest { +public class ClearScrollRequest extends ActionRequest { private List scrollIds; diff --git a/core/src/main/java/org/elasticsearch/action/search/MultiSearchRequest.java b/core/src/main/java/org/elasticsearch/action/search/MultiSearchRequest.java index 08a1ec5b3de..b4f0f932eed 100644 --- a/core/src/main/java/org/elasticsearch/action/search/MultiSearchRequest.java +++ b/core/src/main/java/org/elasticsearch/action/search/MultiSearchRequest.java @@ -36,7 +36,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError; /** * A multi search API request. */ -public class MultiSearchRequest extends ActionRequest implements CompositeIndicesRequest { +public class MultiSearchRequest extends ActionRequest implements CompositeIndicesRequest { private int maxConcurrentSearchRequests = 0; private List requests = new ArrayList<>(); diff --git a/core/src/main/java/org/elasticsearch/action/search/SearchRequest.java b/core/src/main/java/org/elasticsearch/action/search/SearchRequest.java index de27805b139..ae960dae984 100644 --- a/core/src/main/java/org/elasticsearch/action/search/SearchRequest.java +++ b/core/src/main/java/org/elasticsearch/action/search/SearchRequest.java @@ -49,7 +49,7 @@ import java.util.Objects; * @see org.elasticsearch.client.Client#search(SearchRequest) * @see SearchResponse */ -public final class SearchRequest extends ActionRequest implements IndicesRequest.Replaceable { +public final class SearchRequest extends ActionRequest implements IndicesRequest.Replaceable { private SearchType searchType = SearchType.DEFAULT; diff --git a/core/src/main/java/org/elasticsearch/action/search/SearchScrollRequest.java b/core/src/main/java/org/elasticsearch/action/search/SearchScrollRequest.java index 8a171e24a1e..317efe40314 100644 --- a/core/src/main/java/org/elasticsearch/action/search/SearchScrollRequest.java +++ b/core/src/main/java/org/elasticsearch/action/search/SearchScrollRequest.java @@ -33,7 +33,7 @@ import java.util.Objects; import static org.elasticsearch.action.ValidateActions.addValidationError; -public class SearchScrollRequest extends ActionRequest { +public class SearchScrollRequest extends ActionRequest { private String scrollId; private Scroll scroll; diff --git a/core/src/main/java/org/elasticsearch/action/support/ActionFilter.java b/core/src/main/java/org/elasticsearch/action/support/ActionFilter.java index f536d9e0ceb..4a2c88f75dc 100644 --- a/core/src/main/java/org/elasticsearch/action/support/ActionFilter.java +++ b/core/src/main/java/org/elasticsearch/action/support/ActionFilter.java @@ -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} */ - , Response extends ActionResponse> void apply(Task task, String action, Request request, + void apply(Task task, String action, Request request, ActionListener listener, ActionFilterChain chain); /** @@ -62,7 +62,7 @@ public interface ActionFilter { } @Override - public final , Response extends ActionResponse> void apply(Task task, String action, Request request, + public final void apply(Task task, String action, Request request, ActionListener listener, ActionFilterChain 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 void apply(String action, Response response, ActionListener listener, diff --git a/core/src/main/java/org/elasticsearch/action/support/ActionFilterChain.java b/core/src/main/java/org/elasticsearch/action/support/ActionFilterChain.java index 54f55e187a9..29991451f2e 100644 --- a/core/src/main/java/org/elasticsearch/action/support/ActionFilterChain.java +++ b/core/src/main/java/org/elasticsearch/action/support/ActionFilterChain.java @@ -27,7 +27,7 @@ import org.elasticsearch.tasks.Task; /** * A filter chain allowing to continue and process the transport action request */ -public interface ActionFilterChain, Response extends ActionResponse> { +public interface ActionFilterChain { /** * Continue processing the request. Should only be called if a response has not been sent through diff --git a/core/src/main/java/org/elasticsearch/action/support/HandledTransportAction.java b/core/src/main/java/org/elasticsearch/action/support/HandledTransportAction.java index 0a53b63b662..68b699cb110 100644 --- a/core/src/main/java/org/elasticsearch/action/support/HandledTransportAction.java +++ b/core/src/main/java/org/elasticsearch/action/support/HandledTransportAction.java @@ -35,7 +35,7 @@ import java.util.function.Supplier; /** * A TransportAction that self registers a handler into the transport service */ -public abstract class HandledTransportAction, Response extends ActionResponse> +public abstract class HandledTransportAction extends TransportAction { protected HandledTransportAction(Settings settings, String actionName, ThreadPool threadPool, TransportService transportService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, diff --git a/core/src/main/java/org/elasticsearch/action/support/TransportAction.java b/core/src/main/java/org/elasticsearch/action/support/TransportAction.java index b348d2ec317..dbd08aa376f 100644 --- a/core/src/main/java/org/elasticsearch/action/support/TransportAction.java +++ b/core/src/main/java/org/elasticsearch/action/support/TransportAction.java @@ -38,7 +38,7 @@ import java.util.concurrent.atomic.AtomicInteger; import static org.elasticsearch.action.support.PlainActionFuture.newFuture; -public abstract class TransportAction, Response extends ActionResponse> extends AbstractComponent { +public abstract class TransportAction extends AbstractComponent { protected final ThreadPool threadPool; protected final String actionName; @@ -148,7 +148,7 @@ public abstract class TransportAction, Re protected abstract void doExecute(Request request, ActionListener listener); - private static class RequestFilterChain, Response extends ActionResponse> + private static class RequestFilterChain implements ActionFilterChain { private final TransportAction action; @@ -184,7 +184,7 @@ public abstract class TransportAction, Re } } - private static class ResponseFilterChain, Response extends ActionResponse> + private static class ResponseFilterChain implements ActionFilterChain { private final ActionFilter[] filters; diff --git a/core/src/main/java/org/elasticsearch/action/support/broadcast/BroadcastRequest.java b/core/src/main/java/org/elasticsearch/action/support/broadcast/BroadcastRequest.java index b6ab85c0b18..a04d2edc8dc 100644 --- a/core/src/main/java/org/elasticsearch/action/support/broadcast/BroadcastRequest.java +++ b/core/src/main/java/org/elasticsearch/action/support/broadcast/BroadcastRequest.java @@ -28,7 +28,7 @@ import org.elasticsearch.common.io.stream.StreamOutput; import java.io.IOException; -public class BroadcastRequest> extends ActionRequest implements IndicesRequest.Replaceable { +public class BroadcastRequest> extends ActionRequest implements IndicesRequest.Replaceable { protected String[] indices; private IndicesOptions indicesOptions = IndicesOptions.strictExpandOpenAndForbidClosed(); diff --git a/core/src/main/java/org/elasticsearch/action/support/master/MasterNodeRequest.java b/core/src/main/java/org/elasticsearch/action/support/master/MasterNodeRequest.java index efbcadf445f..6f2ce6c4ef9 100644 --- a/core/src/main/java/org/elasticsearch/action/support/master/MasterNodeRequest.java +++ b/core/src/main/java/org/elasticsearch/action/support/master/MasterNodeRequest.java @@ -29,7 +29,7 @@ import java.io.IOException; /** * A based request for master based operation. */ -public abstract class MasterNodeRequest> extends ActionRequest { +public abstract class MasterNodeRequest> extends ActionRequest { public static final TimeValue DEFAULT_MASTER_NODE_TIMEOUT = TimeValue.timeValueSeconds(30); diff --git a/core/src/main/java/org/elasticsearch/action/support/nodes/BaseNodesRequest.java b/core/src/main/java/org/elasticsearch/action/support/nodes/BaseNodesRequest.java index 4523e8d339a..2f8490cc872 100644 --- a/core/src/main/java/org/elasticsearch/action/support/nodes/BaseNodesRequest.java +++ b/core/src/main/java/org/elasticsearch/action/support/nodes/BaseNodesRequest.java @@ -29,7 +29,7 @@ import org.elasticsearch.common.unit.TimeValue; import java.io.IOException; -public abstract class BaseNodesRequest> extends ActionRequest { +public abstract class BaseNodesRequest> extends ActionRequest { /** * the list of nodesIds that will be used to resolve this request and {@link #concreteNodes} diff --git a/core/src/main/java/org/elasticsearch/action/support/replication/ReplicationRequest.java b/core/src/main/java/org/elasticsearch/action/support/replication/ReplicationRequest.java index 596d2581a79..9586bab3937 100644 --- a/core/src/main/java/org/elasticsearch/action/support/replication/ReplicationRequest.java +++ b/core/src/main/java/org/elasticsearch/action/support/replication/ReplicationRequest.java @@ -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> extends ActionRequest +public abstract class ReplicationRequest> extends ActionRequest implements IndicesRequest { public static final TimeValue DEFAULT_TIMEOUT = new TimeValue(1, TimeUnit.MINUTES); diff --git a/core/src/main/java/org/elasticsearch/action/support/single/instance/InstanceShardOperationRequest.java b/core/src/main/java/org/elasticsearch/action/support/single/instance/InstanceShardOperationRequest.java index a6bb0f8e0a1..791617231b5 100644 --- a/core/src/main/java/org/elasticsearch/action/support/single/instance/InstanceShardOperationRequest.java +++ b/core/src/main/java/org/elasticsearch/action/support/single/instance/InstanceShardOperationRequest.java @@ -32,7 +32,7 @@ import org.elasticsearch.index.shard.ShardId; import java.io.IOException; import java.util.concurrent.TimeUnit; -public abstract class InstanceShardOperationRequest> extends ActionRequest +public abstract class InstanceShardOperationRequest> extends ActionRequest implements IndicesRequest { public static final TimeValue DEFAULT_TIMEOUT = new TimeValue(1, TimeUnit.MINUTES); diff --git a/core/src/main/java/org/elasticsearch/action/support/single/shard/SingleShardRequest.java b/core/src/main/java/org/elasticsearch/action/support/single/shard/SingleShardRequest.java index 4265fa98337..18f054bb82e 100644 --- a/core/src/main/java/org/elasticsearch/action/support/single/shard/SingleShardRequest.java +++ b/core/src/main/java/org/elasticsearch/action/support/single/shard/SingleShardRequest.java @@ -31,7 +31,7 @@ import org.elasticsearch.index.shard.ShardId; import java.io.IOException; -public abstract class SingleShardRequest> extends ActionRequest implements IndicesRequest { +public abstract class SingleShardRequest> extends ActionRequest implements IndicesRequest { public static final IndicesOptions INDICES_OPTIONS = IndicesOptions.strictSingleIndexNoExpandForbidClosed(); diff --git a/core/src/main/java/org/elasticsearch/action/support/tasks/BaseTasksRequest.java b/core/src/main/java/org/elasticsearch/action/support/tasks/BaseTasksRequest.java index 18eea411b63..e912eebb4fb 100644 --- a/core/src/main/java/org/elasticsearch/action/support/tasks/BaseTasksRequest.java +++ b/core/src/main/java/org/elasticsearch/action/support/tasks/BaseTasksRequest.java @@ -36,7 +36,7 @@ import static org.elasticsearch.action.ValidateActions.addValidationError; /** * A base class for task requests */ -public class BaseTasksRequest> extends ActionRequest { +public class BaseTasksRequest> extends ActionRequest { public static final String[] ALL_ACTIONS = Strings.EMPTY_ARRAY; diff --git a/core/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsRequest.java b/core/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsRequest.java index 3cd73226e73..da9dae6759d 100644 --- a/core/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsRequest.java +++ b/core/src/main/java/org/elasticsearch/action/termvectors/MultiTermVectorsRequest.java @@ -41,7 +41,7 @@ import java.util.Iterator; import java.util.List; import java.util.Set; -public class MultiTermVectorsRequest extends ActionRequest implements Iterable, CompositeIndicesRequest, RealtimeRequest { +public class MultiTermVectorsRequest extends ActionRequest implements Iterable, CompositeIndicesRequest, RealtimeRequest { String preference; List requests = new ArrayList<>(); diff --git a/core/src/main/java/org/elasticsearch/client/ElasticsearchClient.java b/core/src/main/java/org/elasticsearch/client/ElasticsearchClient.java index d9ddc56d48a..84438ff6d1a 100644 --- a/core/src/main/java/org/elasticsearch/client/ElasticsearchClient.java +++ b/core/src/main/java/org/elasticsearch/client/ElasticsearchClient.java @@ -40,7 +40,7 @@ public interface ElasticsearchClient { * @param The request builder type. * @return A future allowing to get back the response. */ - , Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder> ActionFuture execute( + > ActionFuture execute( final Action action, final Request request); /** @@ -53,7 +53,7 @@ public interface ElasticsearchClient { * @param The response type. * @param The request builder type. */ - , Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder> void execute( + > void execute( final Action action, final Request request, ActionListener listener); /** @@ -65,7 +65,7 @@ public interface ElasticsearchClient { * @param The request builder. * @return The request builder, that can, at a later stage, execute the request. */ - , Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder> RequestBuilder prepareExecute( + > RequestBuilder prepareExecute( final Action action); /** diff --git a/core/src/main/java/org/elasticsearch/client/FilterClient.java b/core/src/main/java/org/elasticsearch/client/FilterClient.java index d0f52282c76..23d3c2c3d0c 100644 --- a/core/src/main/java/org/elasticsearch/client/FilterClient.java +++ b/core/src/main/java/org/elasticsearch/client/FilterClient.java @@ -62,7 +62,7 @@ public abstract class FilterClient extends AbstractClient { } @Override - protected , Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder> void doExecute( + protected > void doExecute( Action action, Request request, ActionListener listener) { in().execute(action, request, listener); } diff --git a/core/src/main/java/org/elasticsearch/client/ParentTaskAssigningClient.java b/core/src/main/java/org/elasticsearch/client/ParentTaskAssigningClient.java index 44ba2b76e43..62843c41b70 100644 --- a/core/src/main/java/org/elasticsearch/client/ParentTaskAssigningClient.java +++ b/core/src/main/java/org/elasticsearch/client/ParentTaskAssigningClient.java @@ -58,7 +58,7 @@ public class ParentTaskAssigningClient extends FilterClient { } @Override - protected < Request extends ActionRequest, + protected < Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder > void doExecute(Action action, Request request, ActionListener listener) { diff --git a/core/src/main/java/org/elasticsearch/client/node/NodeClient.java b/core/src/main/java/org/elasticsearch/client/node/NodeClient.java index 5fc2319284d..6c3aa071ba3 100644 --- a/core/src/main/java/org/elasticsearch/client/node/NodeClient.java +++ b/core/src/main/java/org/elasticsearch/client/node/NodeClient.java @@ -56,7 +56,7 @@ public class NodeClient extends AbstractClient { } @Override - public < Request extends ActionRequest, + public < Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder > void doExecute(Action action, Request request, ActionListener 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, + public < Request extends ActionRequest, Response extends ActionResponse > Task executeLocally(GenericAction action, Request request, ActionListener 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, + public < Request extends ActionRequest, Response extends ActionResponse > Task executeLocally(GenericAction action, Request request, TaskListener 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, + private < Request extends ActionRequest, Response extends ActionResponse > TransportAction transportAction(GenericAction action) { if (actions == null) { diff --git a/core/src/main/java/org/elasticsearch/client/support/AbstractClient.java b/core/src/main/java/org/elasticsearch/client/support/AbstractClient.java index 006040b8e16..075fbf1fad6 100644 --- a/core/src/main/java/org/elasticsearch/client/support/AbstractClient.java +++ b/core/src/main/java/org/elasticsearch/client/support/AbstractClient.java @@ -377,13 +377,13 @@ public abstract class AbstractClient extends AbstractComponent implements Client } @Override - public final , Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder> RequestBuilder prepareExecute( + public final > RequestBuilder prepareExecute( final Action action) { return action.newRequestBuilder(this); } @Override - public final , Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder> ActionFuture execute( + public final > ActionFuture execute( Action action, Request request) { PlainActionFuture 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 , Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder> void execute( + public final > void execute( Action action, Request request, ActionListener listener) { listener = threadedWrapper.wrap(listener); doExecute(action, request, listener); } - protected abstract , Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder> void doExecute(final Action action, final Request request, ActionListener listener); + protected abstract > void doExecute(final Action action, final Request request, ActionListener listener); @Override public ActionFuture index(final IndexRequest request) { @@ -696,19 +696,19 @@ public abstract class AbstractClient extends AbstractComponent implements Client } @Override - public , Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder> ActionFuture execute( + public > ActionFuture execute( Action action, Request request) { return client.execute(action, request); } @Override - public , Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder> void execute( + public > void execute( Action action, Request request, ActionListener listener) { client.execute(action, request, listener); } @Override - public , Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder> RequestBuilder prepareExecute( + public > RequestBuilder prepareExecute( Action action) { return client.prepareExecute(action); } @@ -1212,19 +1212,19 @@ public abstract class AbstractClient extends AbstractComponent implements Client } @Override - public , Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder> ActionFuture execute( + public > ActionFuture execute( Action action, Request request) { return client.execute(action, request); } @Override - public , Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder> void execute( + public > void execute( Action action, Request request, ActionListener listener) { client.execute(action, request, listener); } @Override - public , Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder> RequestBuilder prepareExecute( + public > RequestBuilder prepareExecute( Action action) { return client.prepareExecute(action); } @@ -1745,7 +1745,7 @@ public abstract class AbstractClient extends AbstractComponent implements Client public Client filterWithHeader(Map headers) { return new FilterClient(this) { @Override - protected , Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder> void doExecute(Action action, Request request, ActionListener listener) { + protected > void doExecute(Action action, Request request, ActionListener listener) { ThreadContext threadContext = threadPool().getThreadContext(); try (ThreadContext.StoredContext ctx = threadContext.stashAndMergeHeaders(headers)) { super.doExecute(action, request, listener); diff --git a/core/src/main/java/org/elasticsearch/client/transport/TransportClient.java b/core/src/main/java/org/elasticsearch/client/transport/TransportClient.java index 7ef7f400a53..673693c7c38 100644 --- a/core/src/main/java/org/elasticsearch/client/transport/TransportClient.java +++ b/core/src/main/java/org/elasticsearch/client/transport/TransportClient.java @@ -329,7 +329,7 @@ public abstract class TransportClient extends AbstractClient { } @Override - protected , Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder> void doExecute(Action action, Request request, ActionListener listener) { + protected > void doExecute(Action action, Request request, ActionListener listener) { proxy.execute(action, request, listener); } } diff --git a/core/src/main/java/org/elasticsearch/plugins/ActionPlugin.java b/core/src/main/java/org/elasticsearch/plugins/ActionPlugin.java index 3d769d27a87..2198297129e 100644 --- a/core/src/main/java/org/elasticsearch/plugins/ActionPlugin.java +++ b/core/src/main/java/org/elasticsearch/plugins/ActionPlugin.java @@ -49,7 +49,7 @@ public interface ActionPlugin { /** * Actions added by this plugin. */ - default List, ? extends ActionResponse>> getActions() { + default List> getActions() { return Collections.emptyList(); } /** @@ -72,7 +72,7 @@ public interface ActionPlugin { return Collections.emptyList(); } - final class ActionHandler, Response extends ActionResponse> { + final class ActionHandler { private final GenericAction action; private final Class> transportAction; private final Class[] supportTransportActions; diff --git a/core/src/test/java/org/elasticsearch/action/ActionModuleTests.java b/core/src/test/java/org/elasticsearch/action/ActionModuleTests.java index 2c17cea5ef5..a0437f05c4c 100644 --- a/core/src/test/java/org/elasticsearch/action/ActionModuleTests.java +++ b/core/src/test/java/org/elasticsearch/action/ActionModuleTests.java @@ -52,7 +52,7 @@ public class ActionModuleTests extends ESTestCase { public void testPluginCantOverwriteBuiltinAction() { ActionPlugin dupsMainAction = new ActionPlugin() { @Override - public List, ? extends ActionResponse>> getActions() { + public List> 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 { + 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, ? extends ActionResponse>> getActions() { + public List> getActions() { return singletonList(new ActionHandler<>(action, FakeTransportAction.class)); } }; diff --git a/core/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TestTaskPlugin.java b/core/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TestTaskPlugin.java index 340d7199234..28aff0d3bda 100644 --- a/core/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TestTaskPlugin.java +++ b/core/src/test/java/org/elasticsearch/action/admin/cluster/node/tasks/TestTaskPlugin.java @@ -70,7 +70,7 @@ import static org.elasticsearch.test.ESTestCase.awaitBusy; public class TestTaskPlugin extends Plugin implements ActionPlugin { @Override - public List, ? extends ActionResponse>> getActions() { + public List> getActions() { return Arrays.asList(new ActionHandler<>(TestTaskAction.INSTANCE, TransportTestTaskAction.class), new ActionHandler<>(UnblockTestTasksAction.INSTANCE, TransportUnblockTestTasksAction.class)); } diff --git a/core/src/test/java/org/elasticsearch/action/support/TransportActionFilterChainTests.java b/core/src/test/java/org/elasticsearch/action/support/TransportActionFilterChainTests.java index bbf1d2f1942..228c68a1760 100644 --- a/core/src/test/java/org/elasticsearch/action/support/TransportActionFilterChainTests.java +++ b/core/src/test/java/org/elasticsearch/action/support/TransportActionFilterChainTests.java @@ -222,7 +222,7 @@ public class TransportActionFilterChainTests extends ESTestCase { RequestTestFilter testFilter = new RequestTestFilter(randomInt(), new RequestCallback() { @Override - public , Response extends ActionResponse> void execute(Task task, String action, Request request, + public void execute(Task task, String action, Request request, ActionListener listener, ActionFilterChain 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 , Response extends ActionResponse> void apply(Task task, String action, Request request, + public void apply(Task task, String action, Request request, ActionListener listener, ActionFilterChain chain) { this.runs.incrementAndGet(); this.lastActionName = action; @@ -382,7 +382,7 @@ public class TransportActionFilterChainTests extends ESTestCase { } @Override - public , Response extends ActionResponse> void apply(Task task, String action, Request request, + public void apply(Task task, String action, Request request, ActionListener listener, ActionFilterChain 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 , Response extends ActionResponse> void execute(Task task, String action, Request request, + public void execute(Task task, String action, Request request, ActionListener listener, ActionFilterChain 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 , Response extends ActionResponse> void execute(Task task, String action, Request request, + public void execute(Task task, String action, Request request, ActionListener listener, ActionFilterChain actionFilterChain) { ((ActionListener) listener).onResponse(new TestResponse()); } }, LISTENER_FAILURE { @Override - public , Response extends ActionResponse> void execute(Task task, String action, Request request, + public void execute(Task task, String action, Request request, ActionListener listener, ActionFilterChain actionFilterChain) { listener.onFailure(new ElasticsearchTimeoutException("")); } @@ -448,7 +448,7 @@ public class TransportActionFilterChainTests extends ESTestCase { } private interface RequestCallback { - , Response extends ActionResponse> void execute(Task task, String action, Request request, + void execute(Task task, String action, Request request, ActionListener listener, ActionFilterChain actionFilterChain); } @@ -457,7 +457,7 @@ public class TransportActionFilterChainTests extends ESTestCase { ActionFilterChain chain); } - public static class TestRequest extends ActionRequest { + public static class TestRequest extends ActionRequest { @Override public ActionRequestValidationException validate() { return null; diff --git a/core/src/test/java/org/elasticsearch/client/ParentTaskAssigningClientTests.java b/core/src/test/java/org/elasticsearch/client/ParentTaskAssigningClientTests.java index 360137b8904..35406ef1153 100644 --- a/core/src/test/java/org/elasticsearch/client/ParentTaskAssigningClientTests.java +++ b/core/src/test/java/org/elasticsearch/client/ParentTaskAssigningClientTests.java @@ -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, + protected < Request extends ActionRequest, Response extends ActionResponse, RequestBuilder extends ActionRequestBuilder > void doExecute( Action action, Request request, diff --git a/core/src/test/java/org/elasticsearch/cluster/ClusterInfoServiceIT.java b/core/src/test/java/org/elasticsearch/cluster/ClusterInfoServiceIT.java index 3cafff08a07..111a3b1fe10 100644 --- a/core/src/test/java/org/elasticsearch/cluster/ClusterInfoServiceIT.java +++ b/core/src/test/java/org/elasticsearch/cluster/ClusterInfoServiceIT.java @@ -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 + "]"); } diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateRequest.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateRequest.java index b1db44defa0..93549d1d791 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateRequest.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MultiSearchTemplateRequest.java @@ -33,7 +33,7 @@ import java.util.List; import static org.elasticsearch.action.ValidateActions.addValidationError; -public class MultiSearchTemplateRequest extends ActionRequest implements CompositeIndicesRequest { +public class MultiSearchTemplateRequest extends ActionRequest implements CompositeIndicesRequest { private List requests = new ArrayList<>(); diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MustachePlugin.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MustachePlugin.java index 170070564f9..a5a0ded3bee 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MustachePlugin.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/MustachePlugin.java @@ -42,7 +42,7 @@ public class MustachePlugin extends Plugin implements ScriptPlugin, ActionPlugin } @Override - public List, ? extends ActionResponse>> getActions() { + public List> getActions() { return Arrays.asList(new ActionHandler<>(SearchTemplateAction.INSTANCE, TransportSearchTemplateAction.class), new ActionHandler<>(MultiSearchTemplateAction.INSTANCE, TransportMultiSearchTemplateAction.class)); } diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateRequest.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateRequest.java index d7ac37f8313..b405d0950e7 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateRequest.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateRequest.java @@ -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 implements IndicesRequest { +public class SearchTemplateRequest extends ActionRequest implements IndicesRequest { private SearchRequest request; private boolean simulate = false; diff --git a/modules/percolator/src/main/java/org/elasticsearch/percolator/MultiPercolateRequest.java b/modules/percolator/src/main/java/org/elasticsearch/percolator/MultiPercolateRequest.java index d8bb91f2fb0..3ecf3c273ea 100644 --- a/modules/percolator/src/main/java/org/elasticsearch/percolator/MultiPercolateRequest.java +++ b/modules/percolator/src/main/java/org/elasticsearch/percolator/MultiPercolateRequest.java @@ -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 implements CompositeIndicesRequest { +public class MultiPercolateRequest extends ActionRequest implements CompositeIndicesRequest { private String[] indices; private String documentType; diff --git a/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolateRequest.java b/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolateRequest.java index 98aaa891640..bc449ea932d 100644 --- a/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolateRequest.java +++ b/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolateRequest.java @@ -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 implements IndicesRequest.Replaceable { +public class PercolateRequest extends ActionRequest implements IndicesRequest.Replaceable { protected String[] indices; private IndicesOptions indicesOptions = IndicesOptions.strictExpandOpenAndForbidClosed(); diff --git a/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolatorPlugin.java b/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolatorPlugin.java index 8b602e3c478..d314de3b05f 100644 --- a/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolatorPlugin.java +++ b/modules/percolator/src/main/java/org/elasticsearch/percolator/PercolatorPlugin.java @@ -47,7 +47,7 @@ public class PercolatorPlugin extends Plugin implements MapperPlugin, ActionPlug } @Override - public List, ? extends ActionResponse>> getActions() { + public List> getActions() { return Arrays.asList(new ActionHandler<>(PercolateAction.INSTANCE, TransportPercolateAction.class), new ActionHandler<>(MultiPercolateAction.INSTANCE, TransportMultiPercolateAction.class)); } diff --git a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/AbstractBulkByScrollRequest.java b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/AbstractBulkByScrollRequest.java index d3463cdb61f..bfdd95cddfe 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/AbstractBulkByScrollRequest.java +++ b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/AbstractBulkByScrollRequest.java @@ -39,7 +39,7 @@ import static org.elasticsearch.common.unit.TimeValue.timeValueMillis; import static org.elasticsearch.common.unit.TimeValue.timeValueMinutes; public abstract class AbstractBulkByScrollRequest> - extends ActionRequest { + 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; diff --git a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/ReindexPlugin.java b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/ReindexPlugin.java index fe7bcb1f85b..707da4fe5da 100644 --- a/modules/reindex/src/main/java/org/elasticsearch/index/reindex/ReindexPlugin.java +++ b/modules/reindex/src/main/java/org/elasticsearch/index/reindex/ReindexPlugin.java @@ -37,7 +37,7 @@ public class ReindexPlugin extends Plugin implements ActionPlugin { public static final String NAME = "reindex"; @Override - public List, ? extends ActionResponse>> getActions() { + public List> getActions() { return Arrays.asList(new ActionHandler<>(ReindexAction.INSTANCE, TransportReindexAction.class), new ActionHandler<>(UpdateByQueryAction.INSTANCE, TransportUpdateByQueryAction.class), new ActionHandler<>(DeleteByQueryAction.INSTANCE, TransportDeleteByQueryAction.class), diff --git a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/AbstractAsyncBulkIndexByScrollActionScriptTestCase.java b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/AbstractAsyncBulkIndexByScrollActionScriptTestCase.java index f8351b262fc..36c392622bc 100644 --- a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/AbstractAsyncBulkIndexByScrollActionScriptTestCase.java +++ b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/AbstractAsyncBulkIndexByScrollActionScriptTestCase.java @@ -55,7 +55,7 @@ public abstract class AbstractAsyncBulkIndexByScrollActionScriptTestCase< } @SuppressWarnings("unchecked") - protected > T applyScript(Consumer> scriptBody) { + protected T applyScript(Consumer> 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); diff --git a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/AsyncBulkByScrollActionTests.java b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/AsyncBulkByScrollActionTests.java index 3640e2253e4..f78ab7514f3 100644 --- a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/AsyncBulkByScrollActionTests.java +++ b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/AsyncBulkByScrollActionTests.java @@ -726,7 +726,7 @@ public class AsyncBulkByScrollActionTests extends ESTestCase { @Override @SuppressWarnings("unchecked") - protected , Response extends ActionResponse, + protected > void doExecute( Action action, Request request, ActionListener listener) { lastHeaders.set(threadPool.getThreadContext().getHeaders()); @@ -823,7 +823,7 @@ public class AsyncBulkByScrollActionTests extends ESTestCase { } } - private static class RequestAndListener, Response> { + private static class RequestAndListener { private final Request request; private final ActionListener listener; diff --git a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexFromRemoteWithAuthTests.java b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexFromRemoteWithAuthTests.java index b4ac273b43b..27955f71f92 100644 --- a/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexFromRemoteWithAuthTests.java +++ b/modules/reindex/src/test/java/org/elasticsearch/index/reindex/ReindexFromRemoteWithAuthTests.java @@ -165,7 +165,7 @@ public class ReindexFromRemoteWithAuthTests extends ESSingleNodeTestCase { } @Override - public , Response extends ActionResponse> void apply(Task task, String action, + public void apply(Task task, String action, Request request, ActionListener listener, ActionFilterChain chain) { if (false == action.equals(SearchAction.NAME)) { chain.proceed(task, action, request, listener); diff --git a/test/framework/src/main/java/org/elasticsearch/test/client/NoOpClient.java b/test/framework/src/main/java/org/elasticsearch/test/client/NoOpClient.java index 1d91b0980e4..5e1e1acd9ab 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/client/NoOpClient.java +++ b/test/framework/src/main/java/org/elasticsearch/test/client/NoOpClient.java @@ -39,7 +39,7 @@ public class NoOpClient extends AbstractClient { } @Override - protected , + protected > void doExecute(Action action, Request request, ActionListener listener) { diff --git a/test/framework/src/main/java/org/elasticsearch/test/hamcrest/ElasticsearchAssertions.java b/test/framework/src/main/java/org/elasticsearch/test/hamcrest/ElasticsearchAssertions.java index 0a426d85265..8cff517316b 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/hamcrest/ElasticsearchAssertions.java +++ b/test/framework/src/main/java/org/elasticsearch/test/hamcrest/ElasticsearchAssertions.java @@ -653,7 +653,7 @@ public class ElasticsearchAssertions { // streamable that comes in. } if (streamable instanceof ActionRequest) { - ((ActionRequest) streamable).validate(); + ((ActionRequest) streamable).validate(); } BytesReference orig; try {