From 5a78387b8ee3a322522f10b14e18344c2dd67d07 Mon Sep 17 00:00:00 2001 From: Pranshu Shukla Date: Thu, 11 Jul 2024 15:57:49 +0530 Subject: [PATCH] test: adding optimizedFlags on main - 3 --- .../action/admin/indices/stats/CommonStatsFlags.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/server/src/main/java/org/opensearch/action/admin/indices/stats/CommonStatsFlags.java b/server/src/main/java/org/opensearch/action/admin/indices/stats/CommonStatsFlags.java index 58105908fdb3e..18f24e24d4759 100644 --- a/server/src/main/java/org/opensearch/action/admin/indices/stats/CommonStatsFlags.java +++ b/server/src/main/java/org/opensearch/action/admin/indices/stats/CommonStatsFlags.java @@ -98,13 +98,13 @@ public CommonStatsFlags(StreamInput in) throws IOException { includeUnloadedSegments = in.readBoolean(); includeAllShardIndexingPressureTrackers = in.readBoolean(); includeOnlyTopIndexingPressureMetrics = in.readBoolean(); + if (in.getVersion().onOrAfter(Version.V_2_16_0)) { + optimizeNodeIndicesStatsOnLevel = in.readOptionalBoolean(); + } if (in.getVersion().onOrAfter(Version.V_2_14_0)) { includeCaches = in.readEnumSet(CacheType.class); levels = in.readStringArray(); } - if (in.getVersion().onOrAfter(Version.V_2_16_0)) { - optimizeNodeIndicesStatsOnLevel = in.readOptionalBoolean(); - } } @Override @@ -125,13 +125,13 @@ public void writeTo(StreamOutput out) throws IOException { out.writeBoolean(includeUnloadedSegments); out.writeBoolean(includeAllShardIndexingPressureTrackers); out.writeBoolean(includeOnlyTopIndexingPressureMetrics); + if (out.getVersion().onOrAfter(Version.V_2_16_0)) { + out.writeOptionalBoolean(optimizeNodeIndicesStatsOnLevel); + } if (out.getVersion().onOrAfter(Version.V_2_14_0)) { out.writeEnumSet(includeCaches); out.writeStringArrayNullable(levels); } - if (out.getVersion().onOrAfter(Version.V_2_16_0)) { - out.writeOptionalBoolean(optimizeNodeIndicesStatsOnLevel); - } } /**