diff --git a/CHANGELOG.md b/CHANGELOG.md index 1dca43e322..423e0357fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -129,6 +129,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Fix missing Highlight and SourceConfig in the MultisearchBody ([#442](https://github.com/opensearch-project/opensearch-java/pull/442)) - Fix parsing /_alias error response for not existing alias ([#476](https://github.com/opensearch-project/opensearch-java/pull/476)) - Fix missing cause message in missing permission to call Fine Grained Access Control Amazon OpenSearch domain ([#473](https://github.com/opensearch-project/opensearch-java/issues/473)) +- Fix StoryStats numeric value out of range of int ([#489](https://github.com/opensearch-project/opensearch-java/pull/489)) ### Security diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/StoreStats.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/StoreStats.java index 6abe2f6626..6931c5c4ee 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/StoreStats.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/StoreStats.java @@ -57,18 +57,18 @@ public class StoreStats implements JsonpSerializable { @Nullable private final String size; - private final int sizeInBytes; + private final long sizeInBytes; @Nullable private final String reserved; - private final int reservedInBytes; + private final long reservedInBytes; @Nullable private final String totalDataSetSize; @Nullable - private final Integer totalDataSetSizeInBytes; + private final Long totalDataSetSizeInBytes; // --------------------------------------------------------------------------------------------- @@ -98,7 +98,7 @@ public final String size() { /** * Required - API name: {@code size_in_bytes} */ - public final int sizeInBytes() { + public final long sizeInBytes() { return this.sizeInBytes; } @@ -113,7 +113,7 @@ public final String reserved() { /** * Required - API name: {@code reserved_in_bytes} */ - public final int reservedInBytes() { + public final long reservedInBytes() { return this.reservedInBytes; } @@ -129,7 +129,7 @@ public final String totalDataSetSize() { * API name: {@code total_data_set_size_in_bytes} */ @Nullable - public final Integer totalDataSetSizeInBytes() { + public final Long totalDataSetSizeInBytes() { return this.totalDataSetSizeInBytes; } @@ -183,18 +183,18 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder op) { op.add(Builder::size, JsonpDeserializer.stringDeserializer(), "size"); - op.add(Builder::sizeInBytes, JsonpDeserializer.integerDeserializer(), "size_in_bytes"); + op.add(Builder::sizeInBytes, JsonpDeserializer.longDeserializer(), "size_in_bytes"); op.add(Builder::reserved, JsonpDeserializer.stringDeserializer(), "reserved"); - op.add(Builder::reservedInBytes, JsonpDeserializer.integerDeserializer(), "reserved_in_bytes"); + op.add(Builder::reservedInBytes, JsonpDeserializer.longDeserializer(), "reserved_in_bytes"); op.add(Builder::totalDataSetSize, JsonpDeserializer.stringDeserializer(), "total_data_set_size"); - op.add(Builder::totalDataSetSizeInBytes, JsonpDeserializer.integerDeserializer(), + op.add(Builder::totalDataSetSizeInBytes, JsonpDeserializer.longDeserializer(), "total_data_set_size_in_bytes"); } diff --git a/java-client/src/test/java/org/opensearch/client/opensearch/integTest/OpenSearchJavaClientTestCase.java b/java-client/src/test/java/org/opensearch/client/opensearch/integTest/OpenSearchJavaClientTestCase.java index 44fd9aacc4..38a053b63a 100644 --- a/java-client/src/test/java/org/opensearch/client/opensearch/integTest/OpenSearchJavaClientTestCase.java +++ b/java-client/src/test/java/org/opensearch/client/opensearch/integTest/OpenSearchJavaClientTestCase.java @@ -47,6 +47,7 @@ import javax.net.ssl.SSLEngine; public abstract class OpenSearchJavaClientTestCase extends OpenSearchRestTestCase implements OpenSearchTransportSupport { + private static final List systemIndices = List.of(".opensearch-observability", ".opendistro_security"); private static OpenSearchClient javaClient; private static OpenSearchClient adminJavaClient; @@ -161,7 +162,7 @@ protected void wipeAllOSIndices() throws IOException { .indices(r -> r.headers("index,creation.date").expandWildcards(ExpandWildcard.All)); for (IndicesRecord index : response.valueBody()) { - if (index.index() != null && !".opendistro_security".equals(index.index())) { + if (index.index() != null && !systemIndices.contains(index.index())) { adminJavaClient().indices().delete(new DeleteIndexRequest.Builder().index(index.index()).build()); } }