Skip to content

Commit

Permalink
[java] Deprecate async replication in java API
Browse files Browse the repository at this point in the history
Follow up for PR #10171.

As we discussed #10114 (comment), we should also mark the code as deprecated so plugin developers know in advance that they need to adapt their code.
  • Loading branch information
dadoonet committed May 29, 2015
1 parent eae3ddd commit f2ed5d1
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/org/elasticsearch/action/bulk/BulkRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -424,12 +424,19 @@ public boolean refresh() {

/**
* Set the replication type for this operation.
* @deprecated will be removed in 2.0.0. See https://github.com/elastic/elasticsearch/pull/10171
*/
@Deprecated
public BulkRequest replicationType(ReplicationType replicationType) {
this.replicationType = replicationType;
return this;
}

/**
* Get the replication type for this operation.
* @deprecated will be removed in 2.0.0. See https://github.com/elastic/elasticsearch/pull/10171
*/
@Deprecated
public ReplicationType replicationType() {
return this.replicationType;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ public BulkRequestBuilder add(byte[] data, int from, int length, @Nullable Strin

/**
* Set the replication type for this operation.
* @deprecated will be removed in 2.0.0. See https://github.com/elastic/elasticsearch/pull/10171
*/
@Deprecated
public BulkRequestBuilder setReplicationType(ReplicationType replicationType) {
request.replicationType(replicationType);
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ public RequestBuilder setIndicesOptions(IndicesOptions indicesOptions) {

/**
* Sets the replication type.
* @deprecated will be removed in 2.0.0. See https://github.com/elastic/elasticsearch/pull/10171
*/
@Deprecated
@SuppressWarnings("unchecked")
public RequestBuilder setReplicationType(ReplicationType replicationType) {
request.replicationType(replicationType);
Expand All @@ -80,7 +82,9 @@ public RequestBuilder setReplicationType(ReplicationType replicationType) {

/**
* Sets the replication type.
* @deprecated will be removed in 2.0.0. See https://github.com/elastic/elasticsearch/pull/10171
*/
@Deprecated
@SuppressWarnings("unchecked")
public RequestBuilder setReplicationType(String replicationType) {
request.replicationType(replicationType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@

/**
* The type of replication to perform.
* @deprecated will be removed in 2.0.0. See https://github.com/elastic/elasticsearch/pull/10171
*/
@Deprecated
public enum ReplicationType {
/**
* Sync replication, wait till all replicas have performed the operation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,18 @@ public IndicesOptions indicesOptions() {

/**
* The replication type.
* @deprecated will be removed in 2.0.0. See https://github.com/elastic/elasticsearch/pull/10171
*/
@Deprecated
public ReplicationType replicationType() {
return this.replicationType;
}

/**
* Sets the replication type.
* @deprecated will be removed in 2.0.0. See https://github.com/elastic/elasticsearch/pull/10171
*/
@Deprecated
@SuppressWarnings("unchecked")
public final T replicationType(ReplicationType replicationType) {
this.replicationType = replicationType;
Expand All @@ -167,7 +171,9 @@ public final T replicationType(ReplicationType replicationType) {

/**
* Sets the replication type.
* @deprecated will be removed in 2.0.0. See https://github.com/elastic/elasticsearch/pull/10171
*/
@Deprecated
public final T replicationType(String replicationType) {
return replicationType(ReplicationType.fromString(replicationType));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ public final RequestBuilder setIndex(String index) {

/**
* Sets the replication type.
* @deprecated will be removed in 2.0.0. See https://github.com/elastic/elasticsearch/pull/10171
*/
@Deprecated
@SuppressWarnings("unchecked")
public RequestBuilder setReplicationType(ReplicationType replicationType) {
request.replicationType(replicationType);
Expand All @@ -79,7 +81,9 @@ public RequestBuilder setReplicationType(ReplicationType replicationType) {

/**
* Sets the replication type.
* @deprecated will be removed in 2.0.0. See https://github.com/elastic/elasticsearch/pull/10171
*/
@Deprecated
@SuppressWarnings("unchecked")
public RequestBuilder setReplicationType(String replicationType) {
request.replicationType(replicationType);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -375,14 +375,18 @@ public boolean refresh() {

/**
* The replication type.
* @deprecated will be removed in 2.0.0. See https://github.com/elastic/elasticsearch/pull/10171
*/
@Deprecated
public ReplicationType replicationType() {
return this.replicationType;
}

/**
* Sets the replication type.
* @deprecated will be removed in 2.0.0. See https://github.com/elastic/elasticsearch/pull/10171
*/
@Deprecated
public UpdateRequest replicationType(ReplicationType replicationType) {
this.replicationType = replicationType;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,9 @@ public UpdateRequestBuilder setRefresh(boolean refresh) {

/**
* Sets the replication type.
* @deprecated will be removed in 2.0.0. See https://github.com/elastic/elasticsearch/pull/10171
*/
@Deprecated
public UpdateRequestBuilder setReplicationType(ReplicationType replicationType) {
request.replicationType(replicationType);
return this;
Expand Down

0 comments on commit f2ed5d1

Please sign in to comment.