From c9810304f0c3b5af8a7e7d488268dfa3c1dce128 Mon Sep 17 00:00:00 2001 From: Ajay Kumar Movva Date: Fri, 8 Mar 2024 12:25:47 +0530 Subject: [PATCH] Fixing IoUsage Stats Version Check After Backport 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); } }