From c073a2c8f838abd3879dfef4c7c2111fe576322a Mon Sep 17 00:00:00 2001 From: Movva Ajaykumar Date: Fri, 8 Mar 2024 14:36:51 +0530 Subject: [PATCH] Fixing IoUsage Stats Version Check After Backport (#12564) Signed-off-by: Ajay Kumar Movva --- .../main/java/org/opensearch/node/NodeResourceUsageStats.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/org/opensearch/node/NodeResourceUsageStats.java b/server/src/main/java/org/opensearch/node/NodeResourceUsageStats.java index 7747d8c845e9d..26e53218cf026 100644 --- a/server/src/main/java/org/opensearch/node/NodeResourceUsageStats.java +++ b/server/src/main/java/org/opensearch/node/NodeResourceUsageStats.java @@ -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; @@ -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); } }