|
33 | 33 | package org.opensearch.action.admin.indices.get;
|
34 | 34 |
|
35 | 35 | import com.carrotsearch.hppc.cursors.ObjectObjectCursor;
|
36 |
| -import org.opensearch.LegacyESVersion; |
37 | 36 | import org.opensearch.Version;
|
38 | 37 | import org.opensearch.action.ActionResponse;
|
39 | 38 | import org.opensearch.cluster.metadata.AliasMetadata;
|
@@ -152,14 +151,12 @@ public GetIndexResponse(
|
152 | 151 | }
|
153 | 152 | defaultSettings = defaultSettingsMapBuilder.build();
|
154 | 153 |
|
155 |
| - if (in.getVersion().onOrAfter(LegacyESVersion.V_7_8_0)) { |
156 |
| - ImmutableOpenMap.Builder<String, String> dataStreamsMapBuilder = ImmutableOpenMap.builder(); |
157 |
| - int dataStreamsSize = in.readVInt(); |
158 |
| - for (int i = 0; i < dataStreamsSize; i++) { |
159 |
| - dataStreamsMapBuilder.put(in.readString(), in.readOptionalString()); |
160 |
| - } |
161 |
| - dataStreams = dataStreamsMapBuilder.build(); |
| 154 | + ImmutableOpenMap.Builder<String, String> dataStreamsMapBuilder = ImmutableOpenMap.builder(); |
| 155 | + int dataStreamsSize = in.readVInt(); |
| 156 | + for (int i = 0; i < dataStreamsSize; i++) { |
| 157 | + dataStreamsMapBuilder.put(in.readString(), in.readOptionalString()); |
162 | 158 | }
|
| 159 | + dataStreams = dataStreamsMapBuilder.build(); |
163 | 160 | }
|
164 | 161 |
|
165 | 162 | public String[] indices() {
|
@@ -272,12 +269,10 @@ public void writeTo(StreamOutput out) throws IOException {
|
272 | 269 | out.writeString(indexEntry.key);
|
273 | 270 | Settings.writeSettingsToStream(indexEntry.value, out);
|
274 | 271 | }
|
275 |
| - if (out.getVersion().onOrAfter(LegacyESVersion.V_7_8_0)) { |
276 |
| - out.writeVInt(dataStreams.size()); |
277 |
| - for (ObjectObjectCursor<String, String> indexEntry : dataStreams) { |
278 |
| - out.writeString(indexEntry.key); |
279 |
| - out.writeOptionalString(indexEntry.value); |
280 |
| - } |
| 272 | + out.writeVInt(dataStreams.size()); |
| 273 | + for (ObjectObjectCursor<String, String> indexEntry : dataStreams) { |
| 274 | + out.writeString(indexEntry.key); |
| 275 | + out.writeOptionalString(indexEntry.value); |
281 | 276 | }
|
282 | 277 | }
|
283 | 278 |
|
|
0 commit comments