Skip to content

Commit

Permalink
Fixing IoUsage Stats Version Check After Backport (opensearch-project…
Browse files Browse the repository at this point in the history
…#12564)

Signed-off-by: Ajay Kumar Movva <[email protected]>
Signed-off-by: Shivansh Arora <[email protected]>
  • Loading branch information
ajaymovva authored and shiv0408 committed Apr 25, 2024
1 parent 446c090 commit 88684da
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public NodeResourceUsageStats(StreamInput in) throws IOException {
this.timestamp = in.readLong();
this.cpuUtilizationPercent = in.readDouble();
this.memoryUtilizationPercent = in.readDouble();
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
if (in.getVersion().onOrAfter(Version.V_2_13_0)) {
this.ioUsageStats = in.readOptionalWriteable(IoUsageStats::new);
} else {
this.ioUsageStats = null;
Expand All @@ -59,7 +59,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeLong(this.timestamp);
out.writeDouble(this.cpuUtilizationPercent);
out.writeDouble(this.memoryUtilizationPercent);
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
if (out.getVersion().onOrAfter(Version.V_2_13_0)) {
out.writeOptionalWriteable(this.ioUsageStats);
}
}
Expand Down

0 comments on commit 88684da

Please sign in to comment.