Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,8 @@ public ElasticsearchXpackAsyncClient xpack() {
* <code>Search::Elasticsearch::Client::5_0::Scroll</code></li>
* <li>Python: Check out <code>elasticsearch.helpers.*</code></li>
* <li>JavaScript: Check out <code>client.helpers.*</code></li>
* <li>Java: Check out
* <code>co.elastic.clients.elasticsearch._helpers.bulk.BulkIngester</code></li>
* <li>.NET: Check out <code>BulkAllObservable</code></li>
* <li>PHP: Check out bulk indexing.</li>
* <li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
Expand Down Expand Up @@ -637,6 +639,8 @@ public CompletableFuture<BulkResponse> bulk(BulkRequest request) {
* <code>Search::Elasticsearch::Client::5_0::Scroll</code></li>
* <li>Python: Check out <code>elasticsearch.helpers.*</code></li>
* <li>JavaScript: Check out <code>client.helpers.*</code></li>
* <li>Java: Check out
* <code>co.elastic.clients.elasticsearch._helpers.bulk.BulkIngester</code></li>
* <li>.NET: Check out <code>BulkAllObservable</code></li>
* <li>PHP: Check out bulk indexing.</li>
* <li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
Expand Down Expand Up @@ -812,6 +816,8 @@ public final CompletableFuture<BulkResponse> bulk(Function<BulkRequest.Builder,
* <code>Search::Elasticsearch::Client::5_0::Scroll</code></li>
* <li>Python: Check out <code>elasticsearch.helpers.*</code></li>
* <li>JavaScript: Check out <code>client.helpers.*</code></li>
* <li>Java: Check out
* <code>co.elastic.clients.elasticsearch._helpers.bulk.BulkIngester</code></li>
* <li>.NET: Check out <code>BulkAllObservable</code></li>
* <li>PHP: Check out bulk indexing.</li>
* <li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,8 @@ public ElasticsearchXpackClient xpack() {
* <code>Search::Elasticsearch::Client::5_0::Scroll</code></li>
* <li>Python: Check out <code>elasticsearch.helpers.*</code></li>
* <li>JavaScript: Check out <code>client.helpers.*</code></li>
* <li>Java: Check out
* <code>co.elastic.clients.elasticsearch._helpers.bulk.BulkIngester</code></li>
* <li>.NET: Check out <code>BulkAllObservable</code></li>
* <li>PHP: Check out bulk indexing.</li>
* <li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
Expand Down Expand Up @@ -638,6 +640,8 @@ public BulkResponse bulk(BulkRequest request) throws IOException, ElasticsearchE
* <code>Search::Elasticsearch::Client::5_0::Scroll</code></li>
* <li>Python: Check out <code>elasticsearch.helpers.*</code></li>
* <li>JavaScript: Check out <code>client.helpers.*</code></li>
* <li>Java: Check out
* <code>co.elastic.clients.elasticsearch._helpers.bulk.BulkIngester</code></li>
* <li>.NET: Check out <code>BulkAllObservable</code></li>
* <li>PHP: Check out bulk indexing.</li>
* <li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
Expand Down Expand Up @@ -814,6 +818,8 @@ public final BulkResponse bulk(Function<BulkRequest.Builder, ObjectBuilder<BulkR
* <code>Search::Elasticsearch::Client::5_0::Scroll</code></li>
* <li>Python: Check out <code>elasticsearch.helpers.*</code></li>
* <li>JavaScript: Check out <code>client.helpers.*</code></li>
* <li>Java: Check out
* <code>co.elastic.clients.elasticsearch._helpers.bulk.BulkIngester</code></li>
* <li>.NET: Check out <code>BulkAllObservable</code></li>
* <li>PHP: Check out bulk indexing.</li>
* <li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

package co.elastic.clients.elasticsearch.async_search;

import co.elastic.clients.elasticsearch._types.ErrorCause;
import co.elastic.clients.json.JsonpDeserializable;
import co.elastic.clients.json.JsonpDeserializer;
import co.elastic.clients.json.JsonpMapper;
Expand All @@ -35,6 +36,7 @@
import java.lang.Long;
import java.lang.String;
import java.util.Objects;
import java.util.function.Function;
import javax.annotation.Nullable;

//----------------------------------------------------------------
Expand Down Expand Up @@ -85,6 +87,9 @@ public abstract class AsyncSearchResponseBase implements JsonpSerializable {
@Nullable
private final Long completionTimeInMillis;

@Nullable
private final ErrorCause error;

// ---------------------------------------------------------------------------------------------

protected AsyncSearchResponseBase(AbstractBuilder<?> builder) {
Expand All @@ -99,6 +104,7 @@ protected AsyncSearchResponseBase(AbstractBuilder<?> builder) {
this.startTimeInMillis = ApiTypeHelper.requireNonNull(builder.startTimeInMillis, this, "startTimeInMillis", 0);
this.completionTime = builder.completionTime;
this.completionTimeInMillis = builder.completionTimeInMillis;
this.error = builder.error;

}

Expand Down Expand Up @@ -189,6 +195,14 @@ public final Long completionTimeInMillis() {
return this.completionTimeInMillis;
}

/**
* API name: {@code error}
*/
@Nullable
public final ErrorCause error() {
return this.error;
}

/**
* Serialize this object to JSON.
*/
Expand Down Expand Up @@ -234,6 +248,11 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.write(this.completionTimeInMillis);

}
if (this.error != null) {
generator.writeKey("error");
this.error.serialize(generator, mapper);

}

}

Expand Down Expand Up @@ -268,6 +287,9 @@ public abstract static class AbstractBuilder<BuilderT extends AbstractBuilder<Bu
@Nullable
private Long completionTimeInMillis;

@Nullable
private ErrorCause error;

/**
* API name: {@code id}
*/
Expand Down Expand Up @@ -359,6 +381,21 @@ public final BuilderT completionTimeInMillis(@Nullable Long value) {
return self();
}

/**
* API name: {@code error}
*/
public final BuilderT error(@Nullable ErrorCause value) {
this.error = value;
return self();
}

/**
* API name: {@code error}
*/
public final BuilderT error(Function<ErrorCause.Builder, ObjectBuilder<ErrorCause>> fn) {
return this.error(fn.apply(new ErrorCause.Builder()).build());
}

protected abstract BuilderT self();

}
Expand All @@ -378,6 +415,7 @@ protected static <BuilderT extends AbstractBuilder<BuilderT>> void setupAsyncSea
op.add(AbstractBuilder::completionTime, DateTime._DESERIALIZER, "completion_time");
op.add(AbstractBuilder::completionTimeInMillis, JsonpDeserializer.longDeserializer(),
"completion_time_in_millis");
op.add(AbstractBuilder::error, ErrorCause._DESERIALIZER, "error");

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@
* <code>Search::Elasticsearch::Client::5_0::Scroll</code></li>
* <li>Python: Check out <code>elasticsearch.helpers.*</code></li>
* <li>JavaScript: Check out <code>client.helpers.*</code></li>
* <li>Java: Check out
* <code>co.elastic.clients.elasticsearch._helpers.bulk.BulkIngester</code></li>
* <li>.NET: Check out <code>BulkAllObservable</code></li>
* <li>PHP: Check out bulk indexing.</li>
* <li>Ruby: Check out <code>Elasticsearch::Helpers::BulkHelper</code></li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,15 @@
*/

public class DeleteByQueryRethrottleRequest extends RequestBase {
@Nullable
private final Float requestsPerSecond;
private final float requestsPerSecond;

private final String taskId;

// ---------------------------------------------------------------------------------------------

private DeleteByQueryRethrottleRequest(Builder builder) {

this.requestsPerSecond = builder.requestsPerSecond;
this.requestsPerSecond = ApiTypeHelper.requireNonNull(builder.requestsPerSecond, this, "requestsPerSecond", 0);
this.taskId = ApiTypeHelper.requireNonNull(builder.taskId, this, "taskId");

}
Expand All @@ -89,13 +88,12 @@ public static DeleteByQueryRethrottleRequest of(
}

/**
* The throttle for this request in sub-requests per second. To disable
* throttling, set it to <code>-1</code>.
* Required - The throttle for this request in sub-requests per second. To
* disable throttling, set it to <code>-1</code>.
* <p>
* API name: {@code requests_per_second}
*/
@Nullable
public final Float requestsPerSecond() {
public final float requestsPerSecond() {
return this.requestsPerSecond;
}

Expand All @@ -117,18 +115,17 @@ public final String taskId() {
public static class Builder extends RequestBase.AbstractBuilder<Builder>
implements
ObjectBuilder<DeleteByQueryRethrottleRequest> {
@Nullable
private Float requestsPerSecond;

private String taskId;

/**
* The throttle for this request in sub-requests per second. To disable
* throttling, set it to <code>-1</code>.
* Required - The throttle for this request in sub-requests per second. To
* disable throttling, set it to <code>-1</code>.
* <p>
* API name: {@code requests_per_second}
*/
public final Builder requestsPerSecond(@Nullable Float value) {
public final Builder requestsPerSecond(float value) {
this.requestsPerSecond = value;
return this;
}
Expand Down Expand Up @@ -213,9 +210,7 @@ public DeleteByQueryRethrottleRequest build() {
// Request parameters
request -> {
Map<String, String> params = new HashMap<>();
if (request.requestsPerSecond != null) {
params.put("requests_per_second", String.valueOf(request.requestsPerSecond));
}
params.put("requests_per_second", String.valueOf(request.requestsPerSecond));
return params;

}, SimpleEndpoint.emptyMap(), false, DeleteByQueryRethrottleResponse._DESERIALIZER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,15 @@
*/

public class ReindexRethrottleRequest extends RequestBase {
@Nullable
private final Float requestsPerSecond;
private final float requestsPerSecond;

private final String taskId;

// ---------------------------------------------------------------------------------------------

private ReindexRethrottleRequest(Builder builder) {

this.requestsPerSecond = builder.requestsPerSecond;
this.requestsPerSecond = ApiTypeHelper.requireNonNull(builder.requestsPerSecond, this, "requestsPerSecond", 0);
this.taskId = ApiTypeHelper.requireNonNull(builder.taskId, this, "taskId");

}
Expand All @@ -95,14 +94,13 @@ public static ReindexRethrottleRequest of(Function<Builder, ObjectBuilder<Reinde
}

/**
* The throttle for this request in sub-requests per second. It can be either
* <code>-1</code> to turn off throttling or any decimal number like
* Required - The throttle for this request in sub-requests per second. It can
* be either <code>-1</code> to turn off throttling or any decimal number like
* <code>1.7</code> or <code>12</code> to throttle to that level.
* <p>
* API name: {@code requests_per_second}
*/
@Nullable
public final Float requestsPerSecond() {
public final float requestsPerSecond() {
return this.requestsPerSecond;
}

Expand All @@ -124,19 +122,18 @@ public final String taskId() {
public static class Builder extends RequestBase.AbstractBuilder<Builder>
implements
ObjectBuilder<ReindexRethrottleRequest> {
@Nullable
private Float requestsPerSecond;

private String taskId;

/**
* The throttle for this request in sub-requests per second. It can be either
* <code>-1</code> to turn off throttling or any decimal number like
* Required - The throttle for this request in sub-requests per second. It can
* be either <code>-1</code> to turn off throttling or any decimal number like
* <code>1.7</code> or <code>12</code> to throttle to that level.
* <p>
* API name: {@code requests_per_second}
*/
public final Builder requestsPerSecond(@Nullable Float value) {
public final Builder requestsPerSecond(float value) {
this.requestsPerSecond = value;
return this;
}
Expand Down Expand Up @@ -221,9 +218,7 @@ public ReindexRethrottleRequest build() {
// Request parameters
request -> {
Map<String, String> params = new HashMap<>();
if (request.requestsPerSecond != null) {
params.put("requests_per_second", String.valueOf(request.requestsPerSecond));
}
params.put("requests_per_second", String.valueOf(request.requestsPerSecond));
return params;

}, SimpleEndpoint.emptyMap(), false, ReindexRethrottleResponse._DESERIALIZER);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,15 @@
*/

public class UpdateByQueryRethrottleRequest extends RequestBase {
@Nullable
private final Float requestsPerSecond;
private final float requestsPerSecond;

private final String taskId;

// ---------------------------------------------------------------------------------------------

private UpdateByQueryRethrottleRequest(Builder builder) {

this.requestsPerSecond = builder.requestsPerSecond;
this.requestsPerSecond = ApiTypeHelper.requireNonNull(builder.requestsPerSecond, this, "requestsPerSecond", 0);
this.taskId = ApiTypeHelper.requireNonNull(builder.taskId, this, "taskId");

}
Expand All @@ -89,13 +88,12 @@ public static UpdateByQueryRethrottleRequest of(
}

/**
* The throttle for this request in sub-requests per second. To turn off
* throttling, set it to <code>-1</code>.
* Required - The throttle for this request in sub-requests per second. To turn
* off throttling, set it to <code>-1</code>.
* <p>
* API name: {@code requests_per_second}
*/
@Nullable
public final Float requestsPerSecond() {
public final float requestsPerSecond() {
return this.requestsPerSecond;
}

Expand All @@ -117,18 +115,17 @@ public final String taskId() {
public static class Builder extends RequestBase.AbstractBuilder<Builder>
implements
ObjectBuilder<UpdateByQueryRethrottleRequest> {
@Nullable
private Float requestsPerSecond;

private String taskId;

/**
* The throttle for this request in sub-requests per second. To turn off
* throttling, set it to <code>-1</code>.
* Required - The throttle for this request in sub-requests per second. To turn
* off throttling, set it to <code>-1</code>.
* <p>
* API name: {@code requests_per_second}
*/
public final Builder requestsPerSecond(@Nullable Float value) {
public final Builder requestsPerSecond(float value) {
this.requestsPerSecond = value;
return this;
}
Expand Down Expand Up @@ -213,9 +210,7 @@ public UpdateByQueryRethrottleRequest build() {
// Request parameters
request -> {
Map<String, String> params = new HashMap<>();
if (request.requestsPerSecond != null) {
params.put("requests_per_second", String.valueOf(request.requestsPerSecond));
}
params.put("requests_per_second", String.valueOf(request.requestsPerSecond));
return params;

}, SimpleEndpoint.emptyMap(), false, UpdateByQueryRethrottleResponse._DESERIALIZER);
Expand Down
Loading