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@3830203f50
This commit is contained in:
Alexander Reelsen 2016-11-08 19:09:09 +01:00 committed by GitHub
parent fe460bba37
commit 7d10100fcb
3 changed files with 0 additions and 52 deletions

View File

@ -49,18 +49,6 @@ public class DeleteWatchRequest extends MasterNodeRequest<DeleteWatchRequest> {
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;

View File

@ -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<GetWatchRequest> {
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<GetWatchRequest> {
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);
}

View File

@ -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;
}
}