Add StreamableResponseAction to aid in deprecation of Streamable (#43770)

The Action base class currently works for both Streamable and Writeable
response types. This commit intorduces StreamableResponseAction, for
which only the legacy Action implementions which provide newResponse()
will extend. This eliminates the need for overriding newResponse() with
an UnsupportedOperationException.

relates #34389
This commit is contained in:
Ryan Ernst 2019-06-28 21:40:00 -07:00 committed by GitHub
parent 7951c63b91
commit 28ab77a023
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
273 changed files with 378 additions and 908 deletions

View File

@ -18,10 +18,10 @@
*/
package org.elasticsearch.plugin.noop.action.bulk;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
import org.elasticsearch.action.bulk.BulkResponse;
public class NoopBulkAction extends Action<BulkResponse> {
public class NoopBulkAction extends StreamableResponseAction<BulkResponse> {
public static final String NAME = "mock:data/write/bulk";
public static final NoopBulkAction INSTANCE = new NoopBulkAction();

View File

@ -30,11 +30,6 @@ public class NoopSearchAction extends Action<SearchResponse> {
super(NAME);
}
@Override
public SearchResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<SearchResponse> getResponseReader() {
return SearchResponse::new;

View File

@ -18,11 +18,11 @@
*/
package org.elasticsearch.ingest.common;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.StreamableResponseAction;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.HandledTransportAction;
import org.elasticsearch.client.node.NodeClient;
@ -45,7 +45,7 @@ import java.util.Map;
import static org.elasticsearch.ingest.common.IngestCommonPlugin.GROK_PATTERNS;
import static org.elasticsearch.rest.RestRequest.Method.GET;
public class GrokProcessorGetAction extends Action<GrokProcessorGetAction.Response> {
public class GrokProcessorGetAction extends StreamableResponseAction<GrokProcessorGetAction.Response> {
static final GrokProcessorGetAction INSTANCE = new GrokProcessorGetAction();
static final String NAME = "cluster:admin/ingest/processor/grok/get";

View File

@ -31,11 +31,6 @@ public class MultiSearchTemplateAction extends Action<MultiSearchTemplateRespons
super(NAME);
}
@Override
public MultiSearchTemplateResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<MultiSearchTemplateResponse> getResponseReader() {
return MultiSearchTemplateResponse::new;

View File

@ -31,11 +31,6 @@ public class SearchTemplateAction extends Action<SearchTemplateResponse> {
super(NAME);
}
@Override
public SearchTemplateResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<SearchTemplateResponse> getResponseReader() {
return SearchTemplateResponse::new;

View File

@ -75,11 +75,6 @@ public class PainlessContextAction extends Action<PainlessContextAction.Response
super(NAME);
}
@Override
public Response newResponse() {
throw new UnsupportedOperationException();
}
@Override
public Writeable.Reader<Response> getResponseReader() {
return Response::new;

View File

@ -102,8 +102,8 @@ public class PainlessExecuteAction extends Action<PainlessExecuteAction.Response
}
@Override
public Response newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
public Writeable.Reader<Response> getResponseReader() {
return Response::new;
}
public static class Request extends SingleShardRequest<Request> implements ToXContentObject {

View File

@ -19,12 +19,12 @@
package org.elasticsearch.index.rankeval;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
/**
* Action for explaining evaluating search ranking results.
*/
public class RankEvalAction extends Action<RankEvalResponse> {
public class RankEvalAction extends StreamableResponseAction<RankEvalResponse> {
public static final RankEvalAction INSTANCE = new RankEvalAction();
public static final String NAME = "indices:data/read/rank_eval";

View File

@ -31,11 +31,6 @@ public class RethrottleAction extends Action<ListTasksResponse> {
super(NAME);
}
@Override
public ListTasksResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<ListTasksResponse> getResponseReader() {
return ListTasksResponse::new;

View File

@ -26,15 +26,27 @@ import org.elasticsearch.transport.TransportRequestOptions;
/**
* A generic action. Should strive to make it a singleton.
*/
public abstract class Action<Response extends ActionResponse> {
public class Action<Response extends ActionResponse> {
private final String name;
private final Writeable.Reader<Response> responseReader;
/**
* @param name The name of the action, must be unique across actions.
* @deprecated Pass a {@link Writeable.Reader} with {@link }
*/
@Deprecated
protected Action(String name) {
this(name, null);
}
/**
* @param name The name of the action, must be unique across actions.
* @param responseReader A reader for the response type
*/
public Action(String name, Writeable.Reader<Response> responseReader) {
this.name = name;
this.responseReader = responseReader;
}
/**
@ -44,23 +56,11 @@ public abstract class Action<Response extends ActionResponse> {
return this.name;
}
/**
* Creates a new response instance.
* @deprecated Implement {@link #getResponseReader()} instead and make this method throw an
* {@link UnsupportedOperationException}
*/
@Deprecated
public abstract Response newResponse();
/**
* Get a reader that can create a new instance of the class from a {@link org.elasticsearch.common.io.stream.StreamInput}
*/
public Writeable.Reader<Response> getResponseReader() {
return in -> {
Response response = newResponse();
response.readFrom(in);
return response;
};
return responseReader;
}
/**

View File

@ -0,0 +1,51 @@
/*
* Licensed to Elasticsearch under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.elasticsearch.action;
import org.elasticsearch.common.io.stream.Writeable;
/**
* An action for with the response type implements {@link org.elasticsearch.common.io.stream.Streamable}.
* @deprecated Use {@link Action} directly and provide a {@link Writeable.Reader}
*/
@Deprecated
public abstract class StreamableResponseAction<Response extends ActionResponse> extends Action<Response> {
protected StreamableResponseAction(String name) {
super(name);
}
/**
* Creates a new response instance.
* @deprecated Implement {@link #getResponseReader()} instead and make this method throw an
* {@link UnsupportedOperationException}
*/
@Deprecated
public abstract Response newResponse();
@Override
public final Writeable.Reader<Response> getResponseReader() {
return in -> {
Response response = newResponse();
response.readFrom(in);
return response;
};
}
}

View File

@ -19,12 +19,12 @@
package org.elasticsearch.action.admin.cluster.allocation;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
/**
* Action for explaining shard allocation for a shard in the cluster
*/
public class ClusterAllocationExplainAction extends Action<ClusterAllocationExplainResponse> {
public class ClusterAllocationExplainAction extends StreamableResponseAction<ClusterAllocationExplainResponse> {
public static final ClusterAllocationExplainAction INSTANCE = new ClusterAllocationExplainAction();
public static final String NAME = "cluster:monitor/allocation/explain";

View File

@ -29,11 +29,6 @@ public class AddVotingConfigExclusionsAction extends Action<AddVotingConfigExclu
super(NAME);
}
@Override
public AddVotingConfigExclusionsResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Reader<AddVotingConfigExclusionsResponse> getResponseReader() {
return AddVotingConfigExclusionsResponse::new;

View File

@ -29,11 +29,6 @@ public class ClearVotingConfigExclusionsAction extends Action<ClearVotingConfigE
super(NAME);
}
@Override
public ClearVotingConfigExclusionsResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Reader<ClearVotingConfigExclusionsResponse> getResponseReader() {
return ClearVotingConfigExclusionsResponse::new;

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.cluster.health;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class ClusterHealthAction extends Action<ClusterHealthResponse> {
public class ClusterHealthAction extends StreamableResponseAction<ClusterHealthResponse> {
public static final ClusterHealthAction INSTANCE = new ClusterHealthAction();
public static final String NAME = "cluster:monitor/health";

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.cluster.node.hotthreads;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class NodesHotThreadsAction extends Action<NodesHotThreadsResponse> {
public class NodesHotThreadsAction extends StreamableResponseAction<NodesHotThreadsResponse> {
public static final NodesHotThreadsAction INSTANCE = new NodesHotThreadsAction();
public static final String NAME = "cluster:monitor/nodes/hot_threads";

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.cluster.node.info;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class NodesInfoAction extends Action<NodesInfoResponse> {
public class NodesInfoAction extends StreamableResponseAction<NodesInfoResponse> {
public static final NodesInfoAction INSTANCE = new NodesInfoAction();
public static final String NAME = "cluster:monitor/nodes/info";

View File

@ -19,10 +19,10 @@
package org.elasticsearch.action.admin.cluster.node.reload;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class NodesReloadSecureSettingsAction
extends Action<NodesReloadSecureSettingsResponse> {
extends StreamableResponseAction<NodesReloadSecureSettingsResponse> {
public static final NodesReloadSecureSettingsAction INSTANCE = new NodesReloadSecureSettingsAction();
public static final String NAME = "cluster:admin/nodes/reload_secure_settings";

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.cluster.node.stats;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class NodesStatsAction extends Action<NodesStatsResponse> {
public class NodesStatsAction extends StreamableResponseAction<NodesStatsResponse> {
public static final NodesStatsAction INSTANCE = new NodesStatsAction();
public static final String NAME = "cluster:monitor/nodes/stats";

View File

@ -34,11 +34,6 @@ public class CancelTasksAction extends Action<CancelTasksResponse> {
super(NAME);
}
@Override
public CancelTasksResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<CancelTasksResponse> getResponseReader() {
return CancelTasksResponse::new;

View File

@ -19,12 +19,12 @@
package org.elasticsearch.action.admin.cluster.node.tasks.get;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
/**
* Action for retrieving a list of currently running tasks
*/
public class GetTaskAction extends Action<GetTaskResponse> {
public class GetTaskAction extends StreamableResponseAction<GetTaskResponse> {
public static final String TASKS_ORIGIN = "tasks";
public static final GetTaskAction INSTANCE = new GetTaskAction();

View File

@ -34,11 +34,6 @@ public class ListTasksAction extends Action<ListTasksResponse> {
super(NAME);
}
@Override
public ListTasksResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<ListTasksResponse> getResponseReader() {
return ListTasksResponse::new;

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.cluster.node.usage;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class NodesUsageAction extends Action<NodesUsageResponse> {
public class NodesUsageAction extends StreamableResponseAction<NodesUsageResponse> {
public static final NodesUsageAction INSTANCE = new NodesUsageAction();
public static final String NAME = "cluster:monitor/nodes/usage";

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.cluster.remote;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public final class RemoteInfoAction extends Action<RemoteInfoResponse> {
public final class RemoteInfoAction extends StreamableResponseAction<RemoteInfoResponse> {
public static final String NAME = "cluster:monitor/remote/info";
public static final RemoteInfoAction INSTANCE = new RemoteInfoAction();

View File

@ -35,11 +35,6 @@ public class DeleteRepositoryAction extends Action<AcknowledgedResponse> {
super(NAME);
}
@Override
public AcknowledgedResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<AcknowledgedResponse> getResponseReader() {
return AcknowledgedResponse::new;

View File

@ -19,12 +19,12 @@
package org.elasticsearch.action.admin.cluster.repositories.get;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
/**
* Get repositories action
*/
public class GetRepositoriesAction extends Action<GetRepositoriesResponse> {
public class GetRepositoriesAction extends StreamableResponseAction<GetRepositoriesResponse> {
public static final GetRepositoriesAction INSTANCE = new GetRepositoriesAction();
public static final String NAME = "cluster:admin/repository/get";

View File

@ -35,11 +35,6 @@ public class PutRepositoryAction extends Action<AcknowledgedResponse> {
super(NAME);
}
@Override
public AcknowledgedResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<AcknowledgedResponse> getResponseReader() {
return AcknowledgedResponse::new;

View File

@ -19,12 +19,12 @@
package org.elasticsearch.action.admin.cluster.repositories.verify;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
/**
* Unregister repository action
*/
public class VerifyRepositoryAction extends Action<VerifyRepositoryResponse> {
public class VerifyRepositoryAction extends StreamableResponseAction<VerifyRepositoryResponse> {
public static final VerifyRepositoryAction INSTANCE = new VerifyRepositoryAction();
public static final String NAME = "cluster:admin/repository/verify";

View File

@ -31,11 +31,6 @@ public class ClusterRerouteAction extends Action<ClusterRerouteResponse> {
super(NAME);
}
@Override
public ClusterRerouteResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<ClusterRerouteResponse> getResponseReader() {
return ClusterRerouteResponse::new;

View File

@ -31,11 +31,6 @@ public class ClusterUpdateSettingsAction extends Action<ClusterUpdateSettingsRes
super(NAME);
}
@Override
public ClusterUpdateSettingsResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<ClusterUpdateSettingsResponse> getResponseReader() {
return ClusterUpdateSettingsResponse::new;

View File

@ -31,11 +31,6 @@ public class ClusterSearchShardsAction extends Action<ClusterSearchShardsRespons
super(NAME);
}
@Override
public ClusterSearchShardsResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<ClusterSearchShardsResponse> getResponseReader() {
return ClusterSearchShardsResponse::new;

View File

@ -19,12 +19,12 @@
package org.elasticsearch.action.admin.cluster.snapshots.create;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
/**
* Create snapshot action
*/
public class CreateSnapshotAction extends Action<CreateSnapshotResponse> {
public class CreateSnapshotAction extends StreamableResponseAction<CreateSnapshotResponse> {
public static final CreateSnapshotAction INSTANCE = new CreateSnapshotAction();
public static final String NAME = "cluster:admin/snapshot/create";

View File

@ -35,11 +35,6 @@ public class DeleteSnapshotAction extends Action<AcknowledgedResponse> {
super(NAME);
}
@Override
public AcknowledgedResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<AcknowledgedResponse> getResponseReader() {
return AcknowledgedResponse::new;

View File

@ -19,12 +19,12 @@
package org.elasticsearch.action.admin.cluster.snapshots.get;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
/**
* Get snapshots action
*/
public class GetSnapshotsAction extends Action<GetSnapshotsResponse> {
public class GetSnapshotsAction extends StreamableResponseAction<GetSnapshotsResponse> {
public static final GetSnapshotsAction INSTANCE = new GetSnapshotsAction();
public static final String NAME = "cluster:admin/snapshot/get";

View File

@ -19,12 +19,12 @@
package org.elasticsearch.action.admin.cluster.snapshots.restore;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
/**
* Restore snapshot action
*/
public class RestoreSnapshotAction extends Action<RestoreSnapshotResponse> {
public class RestoreSnapshotAction extends StreamableResponseAction<RestoreSnapshotResponse> {
public static final RestoreSnapshotAction INSTANCE = new RestoreSnapshotAction();
public static final String NAME = "cluster:admin/snapshot/restore";

View File

@ -19,12 +19,12 @@
package org.elasticsearch.action.admin.cluster.snapshots.status;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
/**
* Snapshots status action
*/
public class SnapshotsStatusAction extends Action<SnapshotsStatusResponse> {
public class SnapshotsStatusAction extends StreamableResponseAction<SnapshotsStatusResponse> {
public static final SnapshotsStatusAction INSTANCE = new SnapshotsStatusAction();
public static final String NAME = "cluster:admin/snapshot/status";

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.cluster.state;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class ClusterStateAction extends Action<ClusterStateResponse> {
public class ClusterStateAction extends StreamableResponseAction<ClusterStateResponse> {
public static final ClusterStateAction INSTANCE = new ClusterStateAction();
public static final String NAME = "cluster:monitor/state";

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.cluster.stats;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class ClusterStatsAction extends Action<ClusterStatsResponse> {
public class ClusterStatsAction extends StreamableResponseAction<ClusterStatsResponse> {
public static final ClusterStatsAction INSTANCE = new ClusterStatsAction();
public static final String NAME = "cluster:monitor/stats";

View File

@ -32,11 +32,6 @@ public class DeleteStoredScriptAction extends Action<AcknowledgedResponse> {
super(NAME);
}
@Override
public AcknowledgedResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<AcknowledgedResponse> getResponseReader() {
return AcknowledgedResponse::new;

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.cluster.storedscripts;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class GetStoredScriptAction extends Action<GetStoredScriptResponse> {
public class GetStoredScriptAction extends StreamableResponseAction<GetStoredScriptResponse> {
public static final GetStoredScriptAction INSTANCE = new GetStoredScriptAction();
public static final String NAME = "cluster:admin/script/get";

View File

@ -33,11 +33,6 @@ public class PutStoredScriptAction extends Action<AcknowledgedResponse> {
super(NAME);
}
@Override
public AcknowledgedResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<AcknowledgedResponse> getResponseReader() {
return AcknowledgedResponse::new;

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.cluster.tasks;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class PendingClusterTasksAction extends Action<PendingClusterTasksResponse> {
public class PendingClusterTasksAction extends StreamableResponseAction<PendingClusterTasksResponse> {
public static final PendingClusterTasksAction INSTANCE = new PendingClusterTasksAction();
public static final String NAME = "cluster:monitor/task";

View File

@ -32,11 +32,6 @@ public class IndicesAliasesAction extends Action<AcknowledgedResponse> {
super(NAME);
}
@Override
public AcknowledgedResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<AcknowledgedResponse> getResponseReader() {
return AcknowledgedResponse::new;

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.indices.alias.exists;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class AliasesExistAction extends Action<AliasesExistResponse> {
public class AliasesExistAction extends StreamableResponseAction<AliasesExistResponse> {
public static final AliasesExistAction INSTANCE = new AliasesExistAction();
public static final String NAME = "indices:admin/aliases/exists";

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.indices.alias.get;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class GetAliasesAction extends Action<GetAliasesResponse> {
public class GetAliasesAction extends StreamableResponseAction<GetAliasesResponse> {
public static final GetAliasesAction INSTANCE = new GetAliasesAction();
public static final String NAME = "indices:admin/aliases/get";

View File

@ -59,11 +59,6 @@ public class AnalyzeAction extends Action<AnalyzeAction.Response> {
return Response::new;
}
@Override
public Response newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
/**
* A request to analyze a text associated with a specific index. Allow to provide
* the actual analyzer name to perform the analysis with.

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.indices.cache.clear;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class ClearIndicesCacheAction extends Action<ClearIndicesCacheResponse> {
public class ClearIndicesCacheAction extends StreamableResponseAction<ClearIndicesCacheResponse> {
public static final ClearIndicesCacheAction INSTANCE = new ClearIndicesCacheAction();
public static final String NAME = "indices:admin/cache/clear";

View File

@ -31,11 +31,6 @@ public class CloseIndexAction extends Action<CloseIndexResponse> {
super(NAME);
}
@Override
public CloseIndexResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<CloseIndexResponse> getResponseReader() {
return CloseIndexResponse::new;

View File

@ -31,11 +31,6 @@ public class CreateIndexAction extends Action<CreateIndexResponse> {
super(NAME);
}
@Override
public CreateIndexResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<CreateIndexResponse> getResponseReader() {
return CreateIndexResponse::new;

View File

@ -32,11 +32,6 @@ public class DeleteIndexAction extends Action<AcknowledgedResponse> {
super(NAME);
}
@Override
public AcknowledgedResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<AcknowledgedResponse> getResponseReader() {
return AcknowledgedResponse::new;

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.indices.exists.indices;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class IndicesExistsAction extends Action<IndicesExistsResponse> {
public class IndicesExistsAction extends StreamableResponseAction<IndicesExistsResponse> {
public static final IndicesExistsAction INSTANCE = new IndicesExistsAction();
public static final String NAME = "indices:admin/exists";

View File

@ -18,9 +18,9 @@
*/
package org.elasticsearch.action.admin.indices.exists.types;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class TypesExistsAction extends Action<TypesExistsResponse> {
public class TypesExistsAction extends StreamableResponseAction<TypesExistsResponse> {
public static final TypesExistsAction INSTANCE = new TypesExistsAction();
public static final String NAME = "indices:admin/types/exists";

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.indices.flush;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class FlushAction extends Action<FlushResponse> {
public class FlushAction extends StreamableResponseAction<FlushResponse> {
public static final FlushAction INSTANCE = new FlushAction();
public static final String NAME = "indices:admin/flush";

View File

@ -19,10 +19,10 @@
package org.elasticsearch.action.admin.indices.flush;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class SyncedFlushAction extends Action<SyncedFlushResponse> {
public class SyncedFlushAction extends StreamableResponseAction<SyncedFlushResponse> {
public static final SyncedFlushAction INSTANCE = new SyncedFlushAction();
public static final String NAME = "indices:admin/synced_flush";

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.indices.forcemerge;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class ForceMergeAction extends Action<ForceMergeResponse> {
public class ForceMergeAction extends StreamableResponseAction<ForceMergeResponse> {
public static final ForceMergeAction INSTANCE = new ForceMergeAction();
public static final String NAME = "indices:admin/forcemerge";

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.indices.get;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class GetIndexAction extends Action<GetIndexResponse> {
public class GetIndexAction extends StreamableResponseAction<GetIndexResponse> {
public static final GetIndexAction INSTANCE = new GetIndexAction();
public static final String NAME = "indices:admin/get";

View File

@ -31,11 +31,6 @@ public class GetFieldMappingsAction extends Action<GetFieldMappingsResponse> {
super(NAME);
}
@Override
public GetFieldMappingsResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<GetFieldMappingsResponse> getResponseReader() {
return GetFieldMappingsResponse::new;

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.indices.mapping.get;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class GetMappingsAction extends Action<GetMappingsResponse> {
public class GetMappingsAction extends StreamableResponseAction<GetMappingsResponse> {
public static final GetMappingsAction INSTANCE = new GetMappingsAction();
public static final String NAME = "indices:admin/mappings/get";

View File

@ -32,11 +32,6 @@ public class PutMappingAction extends Action<AcknowledgedResponse> {
super(NAME);
}
@Override
public AcknowledgedResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<AcknowledgedResponse> getResponseReader() {
return AcknowledgedResponse::new;

View File

@ -31,11 +31,6 @@ public class OpenIndexAction extends Action<OpenIndexResponse> {
super(NAME);
}
@Override
public OpenIndexResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<OpenIndexResponse> getResponseReader() {
return OpenIndexResponse::new;

View File

@ -19,12 +19,12 @@
package org.elasticsearch.action.admin.indices.recovery;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
/**
* Recovery information action
*/
public class RecoveryAction extends Action<RecoveryResponse> {
public class RecoveryAction extends StreamableResponseAction<RecoveryResponse> {
public static final RecoveryAction INSTANCE = new RecoveryAction();
public static final String NAME = "indices:monitor/recovery";

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.indices.refresh;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class RefreshAction extends Action<RefreshResponse> {
public class RefreshAction extends StreamableResponseAction<RefreshResponse> {
public static final RefreshAction INSTANCE = new RefreshAction();
public static final String NAME = "indices:admin/refresh";

View File

@ -31,11 +31,6 @@ public class RolloverAction extends Action<RolloverResponse> {
super(NAME);
}
@Override
public RolloverResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<RolloverResponse> getResponseReader() {
return RolloverResponse::new;

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.indices.segments;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class IndicesSegmentsAction extends Action<IndicesSegmentResponse> {
public class IndicesSegmentsAction extends StreamableResponseAction<IndicesSegmentResponse> {
public static final IndicesSegmentsAction INSTANCE = new IndicesSegmentsAction();
public static final String NAME = "indices:monitor/segments";

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.indices.settings.get;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class GetSettingsAction extends Action<GetSettingsResponse> {
public class GetSettingsAction extends StreamableResponseAction<GetSettingsResponse> {
public static final GetSettingsAction INSTANCE = new GetSettingsAction();
public static final String NAME = "indices:monitor/settings/get";

View File

@ -32,11 +32,6 @@ public class UpdateSettingsAction extends Action<AcknowledgedResponse> {
super(NAME);
}
@Override
public AcknowledgedResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<AcknowledgedResponse> getResponseReader() {
return AcknowledgedResponse::new;

View File

@ -19,7 +19,7 @@
package org.elasticsearch.action.admin.indices.shards;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
/**
* Action for {@link TransportIndicesShardStoresAction}
@ -28,7 +28,7 @@ import org.elasticsearch.action.Action;
* Shard store information reports which nodes hold shard copies, how recent they are
* and any exceptions on opening the shard index or from previous engine failures
*/
public class IndicesShardStoresAction extends Action<IndicesShardStoresResponse> {
public class IndicesShardStoresAction extends StreamableResponseAction<IndicesShardStoresResponse> {
public static final IndicesShardStoresAction INSTANCE = new IndicesShardStoresAction();
public static final String NAME = "indices:monitor/shard_stores";

View File

@ -33,11 +33,6 @@ public class ResizeAction extends Action<ResizeResponse> {
super(NAME);
}
@Override
public ResizeResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<ResizeResponse> getResponseReader() {
return ResizeResponse::new;

View File

@ -31,11 +31,6 @@ public class ShrinkAction extends Action<ResizeResponse> {
super(NAME);
}
@Override
public ResizeResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<ResizeResponse> getResponseReader() {
return ResizeResponse::new;

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.indices.stats;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class IndicesStatsAction extends Action<IndicesStatsResponse> {
public class IndicesStatsAction extends StreamableResponseAction<IndicesStatsResponse> {
public static final IndicesStatsAction INSTANCE = new IndicesStatsAction();
public static final String NAME = "indices:monitor/stats";

View File

@ -32,11 +32,6 @@ public class DeleteIndexTemplateAction extends Action<AcknowledgedResponse> {
super(NAME);
}
@Override
public AcknowledgedResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<AcknowledgedResponse> getResponseReader() {
return AcknowledgedResponse::new;

View File

@ -18,9 +18,9 @@
*/
package org.elasticsearch.action.admin.indices.template.get;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class GetIndexTemplatesAction extends Action<GetIndexTemplatesResponse> {
public class GetIndexTemplatesAction extends StreamableResponseAction<GetIndexTemplatesResponse> {
public static final GetIndexTemplatesAction INSTANCE = new GetIndexTemplatesAction();
public static final String NAME = "indices:admin/template/get";

View File

@ -32,11 +32,6 @@ public class PutIndexTemplateAction extends Action<AcknowledgedResponse> {
super(NAME);
}
@Override
public AcknowledgedResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<AcknowledgedResponse> getResponseReader() {
return AcknowledgedResponse::new;

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.indices.upgrade.get;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class UpgradeStatusAction extends Action<UpgradeStatusResponse> {
public class UpgradeStatusAction extends StreamableResponseAction<UpgradeStatusResponse> {
public static final UpgradeStatusAction INSTANCE = new UpgradeStatusAction();
public static final String NAME = "indices:monitor/upgrade";

View File

@ -19,12 +19,12 @@
package org.elasticsearch.action.admin.indices.upgrade.post;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
/**
* Upgrade index/indices action.
*/
public class UpgradeAction extends Action<UpgradeResponse> {
public class UpgradeAction extends StreamableResponseAction<UpgradeResponse> {
public static final UpgradeAction INSTANCE = new UpgradeAction();
public static final String NAME = "indices:admin/upgrade";

View File

@ -32,11 +32,6 @@ public class UpgradeSettingsAction extends Action<AcknowledgedResponse> {
super(NAME);
}
@Override
public AcknowledgedResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<AcknowledgedResponse> getResponseReader() {
return AcknowledgedResponse::new;

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.admin.indices.validate.query;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class ValidateQueryAction extends Action<ValidateQueryResponse> {
public class ValidateQueryAction extends StreamableResponseAction<ValidateQueryResponse> {
public static final ValidateQueryAction INSTANCE = new ValidateQueryAction();
public static final String NAME = "indices:admin/validate/query";

View File

@ -19,11 +19,11 @@
package org.elasticsearch.action.bulk;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.transport.TransportRequestOptions;
public class BulkAction extends Action<BulkResponse> {
public class BulkAction extends StreamableResponseAction<BulkResponse> {
public static final BulkAction INSTANCE = new BulkAction();
public static final String NAME = "indices:data/write/bulk";

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.delete;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class DeleteAction extends Action<DeleteResponse> {
public class DeleteAction extends StreamableResponseAction<DeleteResponse> {
public static final DeleteAction INSTANCE = new DeleteAction();
public static final String NAME = "indices:data/write/delete";

View File

@ -34,11 +34,6 @@ public class ExplainAction extends Action<ExplainResponse> {
super(NAME);
}
@Override
public ExplainResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<ExplainResponse> getResponseReader() {
return ExplainResponse::new;

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.fieldcaps;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class FieldCapabilitiesAction extends Action<FieldCapabilitiesResponse> {
public class FieldCapabilitiesAction extends StreamableResponseAction<FieldCapabilitiesResponse> {
public static final FieldCapabilitiesAction INSTANCE = new FieldCapabilitiesAction();
public static final String NAME = "indices:data/read/field_caps";

View File

@ -31,11 +31,6 @@ public class GetAction extends Action<GetResponse> {
super(NAME);
}
@Override
public GetResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<GetResponse> getResponseReader() {
return GetResponse::new;

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.get;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class MultiGetAction extends Action<MultiGetResponse> {
public class MultiGetAction extends StreamableResponseAction<MultiGetResponse> {
public static final MultiGetAction INSTANCE = new MultiGetAction();
public static final String NAME = "indices:data/read/mget";

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.index;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class IndexAction extends Action<IndexResponse> {
public class IndexAction extends StreamableResponseAction<IndexResponse> {
public static final IndexAction INSTANCE = new IndexAction();
public static final String NAME = "indices:data/write/index";

View File

@ -32,11 +32,6 @@ public class DeletePipelineAction extends Action<AcknowledgedResponse> {
super(NAME);
}
@Override
public AcknowledgedResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<AcknowledgedResponse> getResponseReader() {
return AcknowledgedResponse::new;

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.ingest;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class GetPipelineAction extends Action<GetPipelineResponse> {
public class GetPipelineAction extends StreamableResponseAction<GetPipelineResponse> {
public static final GetPipelineAction INSTANCE = new GetPipelineAction();
public static final String NAME = "cluster:admin/ingest/pipeline/get";

View File

@ -32,11 +32,6 @@ public class PutPipelineAction extends Action<AcknowledgedResponse> {
super(NAME);
}
@Override
public AcknowledgedResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<AcknowledgedResponse> getResponseReader() {
return AcknowledgedResponse::new;

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.ingest;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class SimulatePipelineAction extends Action<SimulatePipelineResponse> {
public class SimulatePipelineAction extends StreamableResponseAction<SimulatePipelineResponse> {
public static final SimulatePipelineAction INSTANCE = new SimulatePipelineAction();
public static final String NAME = "cluster:admin/ingest/pipeline/simulate";

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.main;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class MainAction extends Action<MainResponse> {
public class MainAction extends StreamableResponseAction<MainResponse> {
public static final String NAME = "cluster:monitor/main";
public static final MainAction INSTANCE = new MainAction();

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.search;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class ClearScrollAction extends Action<ClearScrollResponse> {
public class ClearScrollAction extends StreamableResponseAction<ClearScrollResponse> {
public static final ClearScrollAction INSTANCE = new ClearScrollAction();
public static final String NAME = "indices:data/read/scroll/clear";

View File

@ -31,11 +31,6 @@ public class MultiSearchAction extends Action<MultiSearchResponse> {
super(NAME);
}
@Override
public MultiSearchResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<MultiSearchResponse> getResponseReader() {
return MultiSearchResponse::new;

View File

@ -31,11 +31,6 @@ public class SearchAction extends Action<SearchResponse> {
super(NAME);
}
@Override
public SearchResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<SearchResponse> getResponseReader() {
return SearchResponse::new;

View File

@ -31,11 +31,6 @@ public class SearchScrollAction extends Action<SearchResponse> {
super(NAME);
}
@Override
public SearchResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<SearchResponse> getResponseReader() {
return SearchResponse::new;

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.termvectors;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class MultiTermVectorsAction extends Action<MultiTermVectorsResponse> {
public class MultiTermVectorsAction extends StreamableResponseAction<MultiTermVectorsResponse> {
public static final MultiTermVectorsAction INSTANCE = new MultiTermVectorsAction();
public static final String NAME = "indices:data/read/mtv";

View File

@ -31,11 +31,6 @@ public class TermVectorsAction extends Action<TermVectorsResponse> {
super(NAME);
}
@Override
public TermVectorsResponse newResponse() {
throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable");
}
@Override
public Writeable.Reader<TermVectorsResponse> getResponseReader() {
return TermVectorsResponse::new;

View File

@ -19,9 +19,9 @@
package org.elasticsearch.action.update;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class UpdateAction extends Action<UpdateResponse> {
public class UpdateAction extends StreamableResponseAction<UpdateResponse> {
public static final UpdateAction INSTANCE = new UpdateAction();
public static final String NAME = "indices:data/write/update";

View File

@ -19,9 +19,9 @@
package org.elasticsearch.index.reindex;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class DeleteByQueryAction extends Action<BulkByScrollResponse> {
public class DeleteByQueryAction extends StreamableResponseAction<BulkByScrollResponse> {
public static final DeleteByQueryAction INSTANCE = new DeleteByQueryAction();
public static final String NAME = "indices:data/write/delete/byquery";

View File

@ -19,9 +19,9 @@
package org.elasticsearch.index.reindex;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class ReindexAction extends Action<BulkByScrollResponse> {
public class ReindexAction extends StreamableResponseAction<BulkByScrollResponse> {
public static final ReindexAction INSTANCE = new ReindexAction();
public static final String NAME = "indices:data/write/reindex";

View File

@ -19,9 +19,9 @@
package org.elasticsearch.index.reindex;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.StreamableResponseAction;
public class UpdateByQueryAction extends Action<BulkByScrollResponse> {
public class UpdateByQueryAction extends StreamableResponseAction<BulkByScrollResponse> {
public static final UpdateByQueryAction INSTANCE = new UpdateByQueryAction();
public static final String NAME = "indices:data/write/update/byquery";

View File

@ -19,10 +19,10 @@
package org.elasticsearch.index.seqno;
import org.elasticsearch.action.Action;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.ActionRequestValidationException;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.action.StreamableResponseAction;
import org.elasticsearch.action.support.ActionFilters;
import org.elasticsearch.action.support.single.shard.SingleShardRequest;
import org.elasticsearch.action.support.single.shard.TransportSingleShardAction;
@ -123,7 +123,7 @@ public class RetentionLeaseActions {
}
public static class Add extends Action<Response> {
public static class Add extends StreamableResponseAction<Response> {
public static final Add INSTANCE = new Add();
public static final String ACTION_NAME = "indices:admin/seq_no/add_retention_lease";
@ -176,7 +176,7 @@ public class RetentionLeaseActions {
}
public static class Renew extends Action<Response> {
public static class Renew extends StreamableResponseAction<Response> {
public static final Renew INSTANCE = new Renew();
public static final String ACTION_NAME = "indices:admin/seq_no/renew_retention_lease";
@ -222,7 +222,7 @@ public class RetentionLeaseActions {
}
public static class Remove extends Action<Response> {
public static class Remove extends StreamableResponseAction<Response> {
public static final Remove INSTANCE = new Remove();
public static final String ACTION_NAME = "indices:admin/seq_no/remove_retention_lease";

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