Skip to content
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

[Backport 2.x] Fix integer overflow for remaining index stats #879

Merged
merged 1 commit into from
Feb 23, 2024
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
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
Loading