From c4757972646cdb095f925bde78524a6106aee06f Mon Sep 17 00:00:00 2001 From: Pranshu Shukla Date: Thu, 11 Jul 2024 14:27:13 +0530 Subject: [PATCH] test: create optimizeNodeIndicesStatsOnLevel and serialization --- .../admin/indices/stats/CommonStatsFlags.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 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 53425a3923d53..bd215137272ed 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 @@ -67,7 +67,7 @@ public class CommonStatsFlags implements Writeable, Cloneable { // Used for metric CACHE_STATS, to determine which caches to report stats for private EnumSet includeCaches = EnumSet.noneOf(CacheType.class); private String[] levels = new String[0]; -// private boolean optimizeNodeIndicesStatsOnLevel = false; + private boolean optimizeNodeIndicesStatsOnLevel = false; /** * @param flags flags to set. If no flags are supplied, default flags will be set. @@ -101,9 +101,9 @@ public CommonStatsFlags(StreamInput in) throws IOException { includeCaches = in.readEnumSet(CacheType.class); levels = in.readStringArray(); } -// if (in.getVersion().onOrAfter(Version.V_2_16_0)) { -// optimizeNodeIndicesStatsOnLevel = in.readBoolean(); -// } + if (in.getVersion().onOrAfter(Version.V_2_16_0)) { + optimizeNodeIndicesStatsOnLevel = in.readBoolean(); + } } @Override @@ -128,9 +128,9 @@ public void writeTo(StreamOutput out) throws IOException { out.writeEnumSet(includeCaches); out.writeStringArrayNullable(levels); } -// if (out.getVersion().onOrAfter(Version.V_2_16_0)) { -// out.writeBoolean(optimizeNodeIndicesStatsOnLevel); -// } + if (out.getVersion().onOrAfter(Version.V_2_16_0)) { + out.writeBoolean(optimizeNodeIndicesStatsOnLevel); + } } /**