From a5be6f2d1d7ca1b488bca09ae3362b3b9eebe537 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 23 Feb 2024 20:16:33 +0000 Subject: [PATCH] Fix integer overflow for remaining index stats (#877) * Fix integer overflow for remaining index stats Signed-off-by: Vacha Shah * Adding changelog Signed-off-by: Vacha Shah --------- Signed-off-by: Vacha Shah (cherry picked from commit 0c88a6a0ffc7449ab2d9625539858f82a0e0af28) Signed-off-by: github-actions[bot] --- CHANGELOG.md | 1 + .../opensearch/_types/QueryCacheStats.java | 10 +- .../opensearch/_types/SegmentsStats.java | 110 +++++++++--------- 3 files changed, 61 insertions(+), 60 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99dbf27195..4615e8c7d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) ### Removed ### Fixed +- Fix integer overflow for variables in indices stats response ([#877](https://github.com/opensearch-project/opensearch-java/pull/877)) ### Security diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/_types/QueryCacheStats.java b/java-client/src/main/java/org/opensearch/client/opensearch/_types/QueryCacheStats.java index d5ba4b1224..77e93b0e9e 100644 --- a/java-client/src/main/java/org/opensearch/client/opensearch/_types/QueryCacheStats.java +++ b/java-client/src/main/java/org/opensearch/client/opensearch/_types/QueryCacheStats.java @@ -60,7 +60,7 @@ public class QueryCacheStats implements JsonpSerializable { @Nullable private final String memorySize; - private final int memorySizeInBytes; + private final long memorySizeInBytes; private final int missCount; @@ -124,7 +124,7 @@ public final String memorySize() { /** * Required - API name: {@code memory_size_in_bytes} */ - public final int memorySizeInBytes() { + public final long memorySizeInBytes() { return this.memorySizeInBytes; } @@ -199,7 +199,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder fileSizes; @Nullable private final String fixedBitSet; - private final int fixedBitSetMemoryInBytes; + private final long fixedBitSetMemoryInBytes; @Nullable private final String indexWriterMemory; @Nullable - private final Integer indexWriterMaxMemoryInBytes; + private final Long indexWriterMaxMemoryInBytes; - private final int indexWriterMemoryInBytes; + private final long indexWriterMemoryInBytes; private final long maxUnsafeAutoIdTimestamp; @Nullable private final String memory; - private final int memoryInBytes; + private final long memoryInBytes; @Nullable private final String normsMemory; - private final int normsMemoryInBytes; + private final long normsMemoryInBytes; @Nullable private final String pointsMemory; - private final int pointsMemoryInBytes; + private final long pointsMemoryInBytes; @Nullable private final String storedMemory; - private final int storedFieldsMemoryInBytes; + private final long storedFieldsMemoryInBytes; - private final int termsMemoryInBytes; + private final long termsMemoryInBytes; @Nullable private final String termsMemory; @@ -103,12 +103,12 @@ public class SegmentsStats implements JsonpSerializable { @Nullable private final String termVectoryMemory; - private final int termVectorsMemoryInBytes; + private final long termVectorsMemoryInBytes; @Nullable private final String versionMapMemory; - private final int versionMapMemoryInBytes; + private final long versionMapMemoryInBytes; // --------------------------------------------------------------------------------------------- @@ -163,7 +163,7 @@ public final String docValuesMemory() { /** * Required - API name: {@code doc_values_memory_in_bytes} */ - public final int docValuesMemoryInBytes() { + public final long docValuesMemoryInBytes() { return this.docValuesMemoryInBytes; } @@ -185,7 +185,7 @@ public final String fixedBitSet() { /** * Required - API name: {@code fixed_bit_set_memory_in_bytes} */ - public final int fixedBitSetMemoryInBytes() { + public final long fixedBitSetMemoryInBytes() { return this.fixedBitSetMemoryInBytes; } @@ -201,14 +201,14 @@ public final String indexWriterMemory() { * API name: {@code index_writer_max_memory_in_bytes} */ @Nullable - public final Integer indexWriterMaxMemoryInBytes() { + public final Long indexWriterMaxMemoryInBytes() { return this.indexWriterMaxMemoryInBytes; } /** * Required - API name: {@code index_writer_memory_in_bytes} */ - public final int indexWriterMemoryInBytes() { + public final long indexWriterMemoryInBytes() { return this.indexWriterMemoryInBytes; } @@ -230,7 +230,7 @@ public final String memory() { /** * Required - API name: {@code memory_in_bytes} */ - public final int memoryInBytes() { + public final long memoryInBytes() { return this.memoryInBytes; } @@ -245,7 +245,7 @@ public final String normsMemory() { /** * Required - API name: {@code norms_memory_in_bytes} */ - public final int normsMemoryInBytes() { + public final long normsMemoryInBytes() { return this.normsMemoryInBytes; } @@ -260,7 +260,7 @@ public final String pointsMemory() { /** * Required - API name: {@code points_memory_in_bytes} */ - public final int pointsMemoryInBytes() { + public final long pointsMemoryInBytes() { return this.pointsMemoryInBytes; } @@ -275,14 +275,14 @@ public final String storedMemory() { /** * Required - API name: {@code stored_fields_memory_in_bytes} */ - public final int storedFieldsMemoryInBytes() { + public final long storedFieldsMemoryInBytes() { return this.storedFieldsMemoryInBytes; } /** * Required - API name: {@code terms_memory_in_bytes} */ - public final int termsMemoryInBytes() { + public final long termsMemoryInBytes() { return this.termsMemoryInBytes; } @@ -305,7 +305,7 @@ public final String termVectoryMemory() { /** * Required - API name: {@code term_vectors_memory_in_bytes} */ - public final int termVectorsMemoryInBytes() { + public final long termVectorsMemoryInBytes() { return this.termVectorsMemoryInBytes; } @@ -320,7 +320,7 @@ public final String versionMapMemory() { /** * Required - API name: {@code version_map_memory_in_bytes} */ - public final int versionMapMemoryInBytes() { + public final long versionMapMemoryInBytes() { return this.versionMapMemoryInBytes; } @@ -451,46 +451,46 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder fileSizes; @Nullable private String fixedBitSet; - private Integer fixedBitSetMemoryInBytes; + private Long fixedBitSetMemoryInBytes; @Nullable private String indexWriterMemory; @Nullable - private Integer indexWriterMaxMemoryInBytes; + private Long indexWriterMaxMemoryInBytes; - private Integer indexWriterMemoryInBytes; + private Long indexWriterMemoryInBytes; private Long maxUnsafeAutoIdTimestamp; @Nullable private String memory; - private Integer memoryInBytes; + private Long memoryInBytes; @Nullable private String normsMemory; - private Integer normsMemoryInBytes; + private Long normsMemoryInBytes; @Nullable private String pointsMemory; - private Integer pointsMemoryInBytes; + private Long pointsMemoryInBytes; @Nullable private String storedMemory; - private Integer storedFieldsMemoryInBytes; + private Long storedFieldsMemoryInBytes; - private Integer termsMemoryInBytes; + private Long termsMemoryInBytes; @Nullable private String termsMemory; @@ -498,12 +498,12 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder