From 7d10100fcbc3d3e4ac19bfd0e058427d42dfe78e Mon Sep 17 00:00:00 2001 From: Alexander Reelsen Date: Tue, 8 Nov 2016 19:09:09 +0100 Subject: [PATCH] Watcher: Remove version/versiontype support in get/delete watch (elastic/elasticsearch#3977) As we are not dependent on any versions any more and we never exposed an version type functionality, nor documented it nor tested it, we should remove this for the next major release. Note, this just removes the ability to set those options, which we ignored anyway in the transport action. Original commit: elastic/x-pack-elasticsearch@3830203f50c0e129b63a5b1a38b6579f874bb1a2 --- .../actions/delete/DeleteWatchRequest.java | 12 ------- .../actions/get/GetWatchRequest.java | 31 ------------------- .../actions/get/GetWatchRequestBuilder.java | 9 ------ 3 files changed, 52 deletions(-) diff --git a/elasticsearch/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/delete/DeleteWatchRequest.java b/elasticsearch/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/delete/DeleteWatchRequest.java index 6b3e3aba30e..e78b5191087 100644 --- a/elasticsearch/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/delete/DeleteWatchRequest.java +++ b/elasticsearch/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/delete/DeleteWatchRequest.java @@ -49,18 +49,6 @@ public class DeleteWatchRequest extends MasterNodeRequest { this.id = id; } - /** - * Sets the version, which will cause the delete operation to only be performed if a matching - * version exists and no changes happened on the doc since then. - */ - public long getVersion() { - return version; - } - - public void setVersion(long version) { - this.version = version; - } - @Override public ActionRequestValidationException validate() { ActionRequestValidationException validationException = null; diff --git a/elasticsearch/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/get/GetWatchRequest.java b/elasticsearch/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/get/GetWatchRequest.java index 0458d719a78..762828547ee 100644 --- a/elasticsearch/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/get/GetWatchRequest.java +++ b/elasticsearch/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/get/GetWatchRequest.java @@ -10,8 +10,6 @@ import org.elasticsearch.action.ValidateActions; 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.lucene.uid.Versions; -import org.elasticsearch.index.VersionType; import org.elasticsearch.xpack.watcher.watch.Watch; import java.io.IOException; @@ -22,9 +20,6 @@ import java.io.IOException; public class GetWatchRequest extends MasterNodeReadRequest { private String id; - private long version = Versions.MATCH_ANY; - private VersionType versionType = VersionType.INTERNAL; - public GetWatchRequest() { } @@ -61,41 +56,15 @@ public class GetWatchRequest extends MasterNodeReadRequest { return id; } - /** - * Sets the version, which will cause the delete operation to only be performed if a matching - * version exists and no changes happened on the doc since then. - */ - public GetWatchRequest setVersion(long version) { - this.version = version; - return this; - } - - public long getVersion() { - return this.version; - } - - public GetWatchRequest setVersionType(VersionType versionType) { - this.versionType = versionType; - return this; - } - - public VersionType getVersionType() { - return this.versionType; - } - @Override public void readFrom(StreamInput in) throws IOException { super.readFrom(in); - version = in.readLong(); - versionType = VersionType.fromValue(in.readByte()); id = in.readString(); } @Override public void writeTo(StreamOutput out) throws IOException { super.writeTo(out); - out.writeLong(version); - out.writeByte(versionType.getValue()); out.writeString(id); } diff --git a/elasticsearch/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/get/GetWatchRequestBuilder.java b/elasticsearch/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/get/GetWatchRequestBuilder.java index cb266ac8fb4..1a768e4b30a 100644 --- a/elasticsearch/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/get/GetWatchRequestBuilder.java +++ b/elasticsearch/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/get/GetWatchRequestBuilder.java @@ -7,7 +7,6 @@ package org.elasticsearch.xpack.watcher.transport.actions.get; import org.elasticsearch.action.support.master.MasterNodeReadOperationRequestBuilder; import org.elasticsearch.client.ElasticsearchClient; -import org.elasticsearch.index.VersionType; /** * A delete document action request builder. @@ -28,12 +27,4 @@ public class GetWatchRequestBuilder extends MasterNodeReadOperationRequestBuilde request.setId(id); return this; } - - /** - * Sets the type of versioning to use. Defaults to {@link org.elasticsearch.index.VersionType#INTERNAL}. - */ - public GetWatchRequestBuilder setVersionType(VersionType versionType) { - request.setVersionType(versionType); - return this; - } }