Skip to content

Commit

Permalink
RemoteStoreUploadStats.pressure as optional
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia committed Dec 18, 2024
1 parent 866c3c1 commit 4c67b40
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public class RemoteStoreUploadStats

private final long maxRefreshTimeLagInMillis;

@Nonnull
@Nullable
private final RemoteStoreUploadPressureStats pressure;

@Nonnull
Expand All @@ -90,7 +90,7 @@ public class RemoteStoreUploadStats
private RemoteStoreUploadStats(Builder builder) {
this.maxRefreshTimeLag = builder.maxRefreshTimeLag;
this.maxRefreshTimeLagInMillis = ApiTypeHelper.requireNonNull(builder.maxRefreshTimeLagInMillis, this, "maxRefreshTimeLagInMillis");
this.pressure = ApiTypeHelper.requireNonNull(builder.pressure, this, "pressure");
this.pressure = builder.pressure;
this.refreshSizeLag = ApiTypeHelper.requireNonNull(builder.refreshSizeLag, this, "refreshSizeLag");
this.totalTimeSpent = builder.totalTimeSpent;
this.totalTimeSpentInMillis = ApiTypeHelper.requireNonNull(builder.totalTimeSpentInMillis, this, "totalTimeSpentInMillis");
Expand Down Expand Up @@ -123,9 +123,9 @@ public final long maxRefreshTimeLagInMillis() {
}

/**
* Required - API name: {@code pressure}
* API name: {@code pressure}
*/
@Nonnull
@Nullable
public final RemoteStoreUploadPressureStats pressure() {
return this.pressure;
}
Expand Down Expand Up @@ -186,8 +186,10 @@ protected void serializeInternal(JsonGenerator generator, JsonpMapper mapper) {
generator.writeKey("max_refresh_time_lag_in_millis");
generator.write(this.maxRefreshTimeLagInMillis);

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

generator.writeKey("refresh_size_lag");
this.refreshSizeLag.serialize(generator, mapper);
Expand Down Expand Up @@ -224,6 +226,7 @@ public static class Builder extends ObjectBuilderBase implements CopyableBuilder
@Nullable
private Time maxRefreshTimeLag;
private Long maxRefreshTimeLagInMillis;
@Nullable
private RemoteStoreUploadPressureStats pressure;
private RemoteStoreUploadRefreshSizeLagStats refreshSizeLag;
@Nullable
Expand Down Expand Up @@ -295,16 +298,16 @@ public final Builder maxRefreshTimeLagInMillis(long value) {
}

/**
* Required - API name: {@code pressure}
* API name: {@code pressure}
*/
@Nonnull
public final Builder pressure(RemoteStoreUploadPressureStats value) {
public final Builder pressure(@Nullable RemoteStoreUploadPressureStats value) {
this.pressure = value;
return this;
}

/**
* Required - API name: {@code pressure}
* API name: {@code pressure}
*/
@Nonnull
public final Builder pressure(Function<RemoteStoreUploadPressureStats.Builder, ObjectBuilder<RemoteStoreUploadPressureStats>> fn) {
Expand Down Expand Up @@ -423,7 +426,7 @@ public int hashCode() {
int result = 17;
result = 31 * result + Objects.hashCode(this.maxRefreshTimeLag);
result = 31 * result + Long.hashCode(this.maxRefreshTimeLagInMillis);
result = 31 * result + this.pressure.hashCode();
result = 31 * result + Objects.hashCode(this.pressure);
result = 31 * result + this.refreshSizeLag.hashCode();
result = 31 * result + Objects.hashCode(this.totalTimeSpent);
result = 31 * result + Long.hashCode(this.totalTimeSpentInMillis);
Expand All @@ -438,7 +441,7 @@ public boolean equals(Object o) {
RemoteStoreUploadStats other = (RemoteStoreUploadStats) o;
return Objects.equals(this.maxRefreshTimeLag, other.maxRefreshTimeLag)
&& this.maxRefreshTimeLagInMillis == other.maxRefreshTimeLagInMillis
&& this.pressure.equals(other.pressure)
&& Objects.equals(this.pressure, other.pressure)
&& this.refreshSizeLag.equals(other.refreshSizeLag)
&& Objects.equals(this.totalTimeSpent, other.totalTimeSpent)
&& this.totalTimeSpentInMillis == other.totalTimeSpentInMillis
Expand Down
1 change: 0 additions & 1 deletion java-codegen/opensearch-openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33586,7 +33586,6 @@ components:
$ref: '#/components/schemas/_common___RemoteStoreUploadDownloadStats'
required:
- max_refresh_time_lag_in_millis
- pressure
- refresh_size_lag
- total_time_spent_in_millis
- total_upload_size
Expand Down

0 comments on commit 4c67b40

Please sign in to comment.