Skip to content

Throttling info in DeleteByQueryResponse is optional #600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2023
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 @@ -83,12 +83,14 @@ public class DeleteByQueryResponse implements JsonpSerializable {
@Nullable
private final Time throttled;

private final long throttledMillis;
@Nullable
private final Long throttledMillis;

@Nullable
private final Time throttledUntil;

private final long throttledUntilMillis;
@Nullable
private final Long throttledUntilMillis;

@Nullable
private final Boolean timedOut;
Expand All @@ -115,10 +117,9 @@ private DeleteByQueryResponse(Builder builder) {
this.sliceId = builder.sliceId;
this.task = builder.task;
this.throttled = builder.throttled;
this.throttledMillis = ApiTypeHelper.requireNonNull(builder.throttledMillis, this, "throttledMillis");
this.throttledMillis = builder.throttledMillis;
this.throttledUntil = builder.throttledUntil;
this.throttledUntilMillis = ApiTypeHelper.requireNonNull(builder.throttledUntilMillis, this,
"throttledUntilMillis");
this.throttledUntilMillis = builder.throttledUntilMillis;
this.timedOut = builder.timedOut;
this.took = builder.took;
this.total = builder.total;
Expand Down Expand Up @@ -202,9 +203,10 @@ public final Time throttled() {
}

/**
* Required - API name: {@code throttled_millis}
* API name: {@code throttled_millis}
*/
public final long throttledMillis() {
@Nullable
public final Long throttledMillis() {
return this.throttledMillis;
}

Expand All @@ -217,9 +219,10 @@ public final Time throttledUntil() {
}

/**
* Required - API name: {@code throttled_until_millis}
* API name: {@code throttled_until_millis}
*/
public final long throttledUntilMillis() {
@Nullable
public final Long throttledUntilMillis() {
return this.throttledUntilMillis;
}

Expand Down Expand Up @@ -316,17 +319,21 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
this.throttled.serialize(generator, mapper);

}
generator.writeKey("throttled_millis");
generator.write(this.throttledMillis);
if (this.throttledMillis != null) {
generator.writeKey("throttled_millis");
generator.write(this.throttledMillis);

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

}
generator.writeKey("throttled_until_millis");
generator.write(this.throttledUntilMillis);
if (this.throttledUntilMillis != null) {
generator.writeKey("throttled_until_millis");
generator.write(this.throttledUntilMillis);

}
if (this.timedOut != null) {
generator.writeKey("timed_out");
generator.write(this.timedOut);
Expand Down Expand Up @@ -391,11 +398,13 @@ public static class Builder extends WithJsonObjectBuilderBase<Builder>
@Nullable
private Time throttled;

@Nullable
private Long throttledMillis;

@Nullable
private Time throttledUntil;

@Nullable
private Long throttledUntilMillis;

@Nullable
Expand Down Expand Up @@ -519,9 +528,9 @@ public final Builder throttled(Function<Time.Builder, ObjectBuilder<Time>> fn) {
}

/**
* Required - API name: {@code throttled_millis}
* API name: {@code throttled_millis}
*/
public final Builder throttledMillis(long value) {
public final Builder throttledMillis(@Nullable Long value) {
this.throttledMillis = value;
return this;
}
Expand All @@ -542,9 +551,9 @@ public final Builder throttledUntil(Function<Time.Builder, ObjectBuilder<Time>>
}

/**
* Required - API name: {@code throttled_until_millis}
* API name: {@code throttled_until_millis}
*/
public final Builder throttledUntilMillis(long value) {
public final Builder throttledUntilMillis(@Nullable Long value) {
this.throttledUntilMillis = value;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2609,10 +2609,10 @@
if (hash.length > 1) {
hash = hash.substring(1);
}
window.location = "https://github.com/elastic/elasticsearch-specification/tree/0a58ae2e52dd1bc6227f65da9cbbcea5b61dde96/specification/" + (paths[hash] || "");
window.location = "https://github.com/elastic/elasticsearch-specification/tree/9139309163228dcff9f68065d48b638af4124ce5/specification/" + (paths[hash] || "");
</script>
</head>
<body>
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/0a58ae2e52dd1bc6227f65da9cbbcea5b61dde96/specification/">Elasticsearch API specification</a>.
Please see the <a href="https://github.com/elastic/elasticsearch-specification/tree/9139309163228dcff9f68065d48b638af4124ce5/specification/">Elasticsearch API specification</a>.
</body>
</html>