|
17 | 17 |
|
18 | 18 | package org.opensearch.action;
|
19 | 19 |
|
| 20 | +import org.opensearch.Version; |
20 | 21 | import org.opensearch.action.admin.cluster.health.ClusterHealthResponse;
|
21 | 22 | import org.opensearch.action.admin.cluster.node.info.NodesInfoResponse;
|
22 | 23 | import org.opensearch.action.admin.cluster.node.stats.NodeStats;
|
|
29 | 30 | import org.opensearch.core.common.io.stream.StreamOutput;
|
30 | 31 | import org.opensearch.common.settings.ClusterSettings;
|
31 | 32 | import org.opensearch.common.settings.Settings;
|
| 33 | +import org.opensearch.search.pipeline.SearchPipelineStats; |
32 | 34 |
|
33 | 35 | import java.io.IOException;
|
34 | 36 |
|
@@ -57,7 +59,11 @@ public NodePrometheusMetricsResponse(StreamInput in) throws IOException {
|
57 | 59 | nodeStats = in.readArray(NodeStats::new, NodeStats[]::new);
|
58 | 60 | indicesStats = PackageAccessHelper.createIndicesStatsResponse(in);
|
59 | 61 | clusterStatsData = new ClusterStatsData(in);
|
60 |
| - snapshotsResponse = new SnapshotsResponse(in); |
| 62 | + if (in.getVersion().onOrAfter(Version.V_2_17_1)) { |
| 63 | + snapshotsResponse = new SnapshotsResponse(in); |
| 64 | + } else { |
| 65 | + snapshotsResponse = null; |
| 66 | + } |
61 | 67 | }
|
62 | 68 |
|
63 | 69 | /**
|
@@ -145,6 +151,8 @@ public void writeTo(StreamOutput out) throws IOException {
|
145 | 151 | out.writeArray(nodeStats);
|
146 | 152 | out.writeOptionalWriteable(indicesStats);
|
147 | 153 | clusterStatsData.writeTo(out);
|
148 |
| - snapshotsResponse.writeTo(out); |
| 154 | + if (out.getVersion().onOrAfter(Version.V_2_17_1)) { |
| 155 | + snapshotsResponse.writeTo(out); |
| 156 | + } |
149 | 157 | }
|
150 | 158 | }
|
0 commit comments