From adcba69d96a9d68f72ecd69b0327454499c4fdbf Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Sun, 30 Jun 2019 21:40:40 +0200 Subject: [PATCH] required changes after merge --- .../enrich/action/DeleteEnrichPolicyAction.java | 13 +------------ .../enrich/action/ExecuteEnrichPolicyAction.java | 13 +------------ .../core/enrich/action/GetEnrichPolicyAction.java | 13 +------------ .../core/enrich/action/ListEnrichPolicyAction.java | 13 +------------ .../core/enrich/action/PutEnrichPolicyAction.java | 13 +------------ 5 files changed, 5 insertions(+), 60 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/DeleteEnrichPolicyAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/DeleteEnrichPolicyAction.java index f892d84bec6..9c6c03a3120 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/DeleteEnrichPolicyAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/DeleteEnrichPolicyAction.java @@ -11,7 +11,6 @@ import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.action.support.master.MasterNodeRequest; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.io.stream.Writeable; import java.io.IOException; import java.util.Objects; @@ -22,17 +21,7 @@ public class DeleteEnrichPolicyAction extends Action { public static final String NAME = "cluster:admin/xpack/enrich/delete"; private DeleteEnrichPolicyAction() { - super(NAME); - } - - @Override - public Writeable.Reader getResponseReader() { - return AcknowledgedResponse::new; - } - - @Override - public AcknowledgedResponse newResponse() { - throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable"); + super(NAME, AcknowledgedResponse::new); } public static class Request extends MasterNodeRequest { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/ExecuteEnrichPolicyAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/ExecuteEnrichPolicyAction.java index 7493c1e3291..ea416e0b53a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/ExecuteEnrichPolicyAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/ExecuteEnrichPolicyAction.java @@ -11,7 +11,6 @@ import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.action.support.master.MasterNodeReadRequest; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.io.stream.Writeable; import java.io.IOException; import java.util.Objects; @@ -22,17 +21,7 @@ public class ExecuteEnrichPolicyAction extends Action { public static final String NAME = "cluster:admin/xpack/enrich/execute"; private ExecuteEnrichPolicyAction() { - super(NAME); - } - - @Override - public Writeable.Reader getResponseReader() { - return AcknowledgedResponse::new; - } - - @Override - public AcknowledgedResponse newResponse() { - throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable"); + super(NAME, AcknowledgedResponse::new); } public static class Request extends MasterNodeReadRequest { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/GetEnrichPolicyAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/GetEnrichPolicyAction.java index 9a3a5c8d9a6..4c361126f44 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/GetEnrichPolicyAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/GetEnrichPolicyAction.java @@ -11,7 +11,6 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.support.master.MasterNodeReadRequest; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; @@ -25,17 +24,7 @@ public class GetEnrichPolicyAction extends Action getResponseReader() { - return Response::new; + super(NAME, Response::new); } public static class Request extends MasterNodeReadRequest { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/ListEnrichPolicyAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/ListEnrichPolicyAction.java index 6362808e990..8c312bc24dd 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/ListEnrichPolicyAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/ListEnrichPolicyAction.java @@ -11,7 +11,6 @@ import org.elasticsearch.action.ActionResponse; import org.elasticsearch.action.support.master.MasterNodeRequest; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.ToXContentObject; import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; @@ -29,17 +28,7 @@ public class ListEnrichPolicyAction extends Action getResponseReader() { - return Response::new; + super(NAME, Response::new); } public static class Request extends MasterNodeRequest { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/PutEnrichPolicyAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/PutEnrichPolicyAction.java index 1020da2ee9f..3dd132cf993 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/PutEnrichPolicyAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/action/PutEnrichPolicyAction.java @@ -11,7 +11,6 @@ import org.elasticsearch.action.support.master.AcknowledgedResponse; import org.elasticsearch.action.support.master.MasterNodeRequest; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.xpack.core.enrich.EnrichPolicy; @@ -24,23 +23,13 @@ public class PutEnrichPolicyAction extends Action { public static final String NAME = "cluster:admin/xpack/enrich/put"; private PutEnrichPolicyAction() { - super(NAME); + super(NAME, AcknowledgedResponse::new); } public static Request fromXContent(XContentParser parser, String name) throws IOException { return new Request(name, EnrichPolicy.fromXContent(parser)); } - @Override - public Writeable.Reader getResponseReader() { - return AcknowledgedResponse::new; - } - - @Override - public AcknowledgedResponse newResponse() { - throw new UnsupportedOperationException("usage of Streamable is to be replaced by Writeable"); - } - public static class Request extends MasterNodeRequest { private final EnrichPolicy policy;