mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 01:22:26 -04:00
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:
parent
5ac7ec2513
commit
e6444d3007
277 changed files with 346 additions and 934 deletions
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue