Skip to content

Commit

Permalink
Fix integer overflow for remaining index stats (#877) (#879)
Browse files Browse the repository at this point in the history
* Fix integer overflow for remaining index stats



* Adding changelog



---------


(cherry picked from commit 0c88a6a)

Signed-off-by: Vacha Shah <vachshah@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 307e2be commit c6d87d8
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 60 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -199,7 +199,7 @@ public static class Builder extends ObjectBuilderBase implements ObjectBuilder<Q
@Nullable
private String memorySize;

private Integer memorySizeInBytes;
private Long memorySizeInBytes;

private Integer missCount;

Expand Down Expand Up @@ -248,7 +248,7 @@ public final Builder memorySize(@Nullable String value) {
/**
* Required - API name: {@code memory_size_in_bytes}
*/
public final Builder memorySizeInBytes(int value) {
public final Builder memorySizeInBytes(long value) {
this.memorySizeInBytes = value;
return this;
}
Expand Down Expand Up @@ -299,7 +299,7 @@ protected static void setupQueryCacheStatsDeserializer(ObjectDeserializer<QueryC
op.add(Builder::evictions, JsonpDeserializer.integerDeserializer(), "evictions");
op.add(Builder::hitCount, JsonpDeserializer.integerDeserializer(), "hit_count");
op.add(Builder::memorySize, JsonpDeserializer.stringDeserializer(), "memory_size");
op.add(Builder::memorySizeInBytes, JsonpDeserializer.integerDeserializer(), "memory_size_in_bytes");
op.add(Builder::memorySizeInBytes, JsonpDeserializer.longDeserializer(), "memory_size_in_bytes");
op.add(Builder::missCount, JsonpDeserializer.integerDeserializer(), "miss_count");
op.add(Builder::totalCount, JsonpDeserializer.integerDeserializer(), "total_count");

Expand Down
Loading

0 comments on commit c6d87d8

Please sign in to comment.