|
9 | 9 |
|
10 | 10 | package org.elasticsearch.action.admin.cluster.snapshots.get; |
11 | 11 |
|
| 12 | +import org.elasticsearch.TransportVersions; |
12 | 13 | import org.elasticsearch.action.ActionResponse; |
13 | 14 | import org.elasticsearch.common.Strings; |
14 | 15 | import org.elasticsearch.common.collect.Iterators; |
@@ -48,8 +49,9 @@ public GetSnapshotsResponse(List<SnapshotInfo> snapshots, @Nullable String next, |
48 | 49 |
|
49 | 50 | public GetSnapshotsResponse(StreamInput in) throws IOException { |
50 | 51 | this.snapshots = in.readCollectionAsImmutableList(SnapshotInfo::readFrom); |
51 | | - // TODO Skip when we have V9 in TransportVersions |
52 | | - in.readMap(StreamInput::readException); |
| 52 | + if (in.getTransportVersion().before(TransportVersions.REMOVE_SNAPSHOT_FAILURES)) { |
| 53 | + in.readMap(StreamInput::readException); |
| 54 | + } |
53 | 55 | this.next = in.readOptionalString(); |
54 | 56 | this.total = in.readVInt(); |
55 | 57 | this.remaining = in.readVInt(); |
@@ -80,8 +82,9 @@ public int remaining() { |
80 | 82 | @Override |
81 | 83 | public void writeTo(StreamOutput out) throws IOException { |
82 | 84 | out.writeCollection(snapshots); |
83 | | - // TODO Skip when we have V9 in TransportVersions |
84 | | - out.writeMap(Map.of(), StreamOutput::writeException); |
| 85 | + if (out.getTransportVersion().before(TransportVersions.REMOVE_SNAPSHOT_FAILURES)) { |
| 86 | + out.writeMap(Map.of(), StreamOutput::writeException); |
| 87 | + } |
85 | 88 | out.writeOptionalString(next); |
86 | 89 | out.writeVInt(total); |
87 | 90 | out.writeVInt(remaining); |
|
0 commit comments