Skip to content

Commit abbcdb4

Browse files
Pranshu-Swangdongyu.danny
authored and
wangdongyu.danny
committed
Updating Cluster Stats Optimisation Versions to 2.16 (opensearch-project#14914)
* Updating Cluster Stats Optimisation Versions to 2.16 Signed-off-by: Pranshu Shukla <pranshushukla06@gmail.com>
1 parent 29a7a03 commit abbcdb4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsNodeResponse.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public ClusterStatsNodeResponse(StreamInput in) throws IOException {
7777
}
7878
this.nodeInfo = new NodeInfo(in);
7979
this.nodeStats = new NodeStats(in);
80-
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
80+
if (in.getVersion().onOrAfter(Version.V_2_16_0)) {
8181
this.shardsStats = in.readOptionalArray(ShardStats::new, ShardStats[]::new);
8282
this.aggregatedNodeLevelStats = in.readOptionalWriteable(AggregatedNodeLevelStats::new);
8383
} else {
@@ -156,7 +156,7 @@ public void writeTo(StreamOutput out) throws IOException {
156156
}
157157
nodeInfo.writeTo(out);
158158
nodeStats.writeTo(out);
159-
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
159+
if (out.getVersion().onOrAfter(Version.V_2_16_0)) {
160160
if (aggregatedNodeLevelStats != null) {
161161
out.writeOptionalArray(null);
162162
out.writeOptionalWriteable(aggregatedNodeLevelStats);

server/src/main/java/org/opensearch/action/admin/cluster/stats/ClusterStatsRequest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class ClusterStatsRequest extends BaseNodesRequest<ClusterStatsRequest> {
5050

5151
public ClusterStatsRequest(StreamInput in) throws IOException {
5252
super(in);
53-
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
53+
if (in.getVersion().onOrAfter(Version.V_2_16_0)) {
5454
useAggregatedNodeLevelResponses = in.readOptionalBoolean();
5555
}
5656
}
@@ -76,7 +76,7 @@ public void useAggregatedNodeLevelResponses(boolean useAggregatedNodeLevelRespon
7676
@Override
7777
public void writeTo(StreamOutput out) throws IOException {
7878
super.writeTo(out);
79-
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
79+
if (out.getVersion().onOrAfter(Version.V_2_16_0)) {
8080
out.writeOptionalBoolean(useAggregatedNodeLevelResponses);
8181
}
8282
}

0 commit comments

Comments
 (0)