From 5631c938cde200077ccaf3f85ebeb843084b5269 Mon Sep 17 00:00:00 2001 From: Rishikesh1159 Date: Thu, 16 Mar 2023 04:49:33 +0000 Subject: [PATCH] remove usages of version Signed-off-by: Rishikesh1159 --- .../opensearch/action/admin/cluster/node/stats/NodeStats.java | 4 ++-- server/src/main/java/org/opensearch/monitor/fs/FsInfo.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodeStats.java b/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodeStats.java index 465aece287ac3..80a44c9674103 100644 --- a/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodeStats.java +++ b/server/src/main/java/org/opensearch/action/admin/cluster/node/stats/NodeStats.java @@ -189,7 +189,7 @@ public NodeStats(StreamInput in) throws IOException { } else { weightedRoutingStats = null; } - if (in.getVersion().onOrAfter(Version.V_2_7_0) && FeatureFlags.isEnabled(FeatureFlags.SEARCHABLE_SNAPSHOT)) { + if (in.getVersion().onOrAfter(Version.V_2_6_0) && FeatureFlags.isEnabled(FeatureFlags.SEARCHABLE_SNAPSHOT)) { fileCacheStats = in.readOptionalWriteable(FileCacheStats::new); } else { fileCacheStats = null; @@ -409,7 +409,7 @@ public void writeTo(StreamOutput out) throws IOException { if (out.getVersion().onOrAfter(Version.V_2_6_0)) { out.writeOptionalWriteable(weightedRoutingStats); } - if (out.getVersion().onOrAfter(Version.V_2_7_0) && FeatureFlags.isEnabled(FeatureFlags.SEARCHABLE_SNAPSHOT)) { + if (out.getVersion().onOrAfter(Version.V_2_6_0) && FeatureFlags.isEnabled(FeatureFlags.SEARCHABLE_SNAPSHOT)) { out.writeOptionalWriteable(fileCacheStats); } } diff --git a/server/src/main/java/org/opensearch/monitor/fs/FsInfo.java b/server/src/main/java/org/opensearch/monitor/fs/FsInfo.java index 36d094917665a..0cee4d69ecda8 100644 --- a/server/src/main/java/org/opensearch/monitor/fs/FsInfo.java +++ b/server/src/main/java/org/opensearch/monitor/fs/FsInfo.java @@ -97,7 +97,7 @@ public Path(StreamInput in) throws IOException { total = in.readLong(); free = in.readLong(); available = in.readLong(); - if (FeatureFlags.isEnabled(FeatureFlags.SEARCHABLE_SNAPSHOT) && in.getVersion().onOrAfter(Version.V_2_7_0)) { + if (FeatureFlags.isEnabled(FeatureFlags.SEARCHABLE_SNAPSHOT) && in.getVersion().onOrAfter(Version.V_2_6_0)) { fileCacheReserved = in.readLong(); fileCacheUtilized = in.readLong(); } @@ -111,7 +111,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeLong(total); out.writeLong(free); out.writeLong(available); - if (FeatureFlags.isEnabled(FeatureFlags.SEARCHABLE_SNAPSHOT) && out.getVersion().onOrAfter(Version.V_2_7_0)) { + if (FeatureFlags.isEnabled(FeatureFlags.SEARCHABLE_SNAPSHOT) && out.getVersion().onOrAfter(Version.V_2_6_0)) { out.writeLong(fileCacheReserved); out.writeLong(fileCacheUtilized); }