Skip to content

Commit

Permalink
Updating Cluster Stats Optimisation Versions to 2.16 (opensearch-proj…
Browse files Browse the repository at this point in the history
…ect#14914)

* Updating Cluster Stats Optimisation Versions to 2.16

Signed-off-by: Pranshu Shukla <[email protected]>
  • Loading branch information
Pranshu-S authored and harshavamsi committed Aug 20, 2024
1 parent 42dfe22 commit f686e64
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public ClusterStatsNodeResponse(StreamInput in) throws IOException {
}
this.nodeInfo = new NodeInfo(in);
this.nodeStats = new NodeStats(in);
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
if (in.getVersion().onOrAfter(Version.V_2_16_0)) {
this.shardsStats = in.readOptionalArray(ShardStats::new, ShardStats[]::new);
this.aggregatedNodeLevelStats = in.readOptionalWriteable(AggregatedNodeLevelStats::new);
} else {
Expand Down Expand Up @@ -156,7 +156,7 @@ public void writeTo(StreamOutput out) throws IOException {
}
nodeInfo.writeTo(out);
nodeStats.writeTo(out);
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
if (out.getVersion().onOrAfter(Version.V_2_16_0)) {
if (aggregatedNodeLevelStats != null) {
out.writeOptionalArray(null);
out.writeOptionalWriteable(aggregatedNodeLevelStats);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class ClusterStatsRequest extends BaseNodesRequest<ClusterStatsRequest> {

public ClusterStatsRequest(StreamInput in) throws IOException {
super(in);
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
if (in.getVersion().onOrAfter(Version.V_2_16_0)) {
useAggregatedNodeLevelResponses = in.readOptionalBoolean();
}
}
Expand All @@ -76,7 +76,7 @@ public void useAggregatedNodeLevelResponses(boolean useAggregatedNodeLevelRespon
@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
if (out.getVersion().onOrAfter(Version.V_2_16_0)) {
out.writeOptionalBoolean(useAggregatedNodeLevelResponses);
}
}
Expand Down

0 comments on commit f686e64

Please sign in to comment.