Skip to content

Commit

Permalink
test: create optimizeNodeIndicesStatsOnLevel and serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Pranshu-S committed Jul 11, 2024
1 parent 7e43dda commit c475797
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<CacheType> 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.
Expand Down Expand Up @@ -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
Expand All @@ -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);
}
}

/**
Expand Down

0 comments on commit c475797

Please sign in to comment.