Skip to content

Commit 6ecc6ac

Browse files
author
Andrey Ershov
committed
BwC fix
1 parent 4bf8e56 commit 6ecc6ac

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/get/GetSnapshotsRequest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public class GetSnapshotsRequest extends MasterNodeRequest<GetSnapshotsRequest>
3838
public static final String ALL_SNAPSHOTS = "_all";
3939
public static final String CURRENT_SNAPSHOT = "_current";
4040
public static final boolean DEFAULT_VERBOSE_MODE = true;
41+
public static final Version MULTIPLE_REPOSITORIES_SUPPORT_ADDED = Version.V_8_0_0;
4142

4243
private String[] repositories;
4344

@@ -72,7 +73,7 @@ public GetSnapshotsRequest(String... repositories) {
7273

7374
public GetSnapshotsRequest(StreamInput in) throws IOException {
7475
super(in);
75-
if (in.getVersion().onOrAfter(Version.V_7_1_0)) {
76+
if (in.getVersion().onOrAfter(MULTIPLE_REPOSITORIES_SUPPORT_ADDED)) {
7677
repositories = in.readStringArray();
7778
} else {
7879
repositories = new String[]{in.readString()};
@@ -85,7 +86,7 @@ public GetSnapshotsRequest(StreamInput in) throws IOException {
8586
@Override
8687
public void writeTo(StreamOutput out) throws IOException {
8788
super.writeTo(out);
88-
if (out.getVersion().onOrAfter(Version.V_7_1_0)) {
89+
if (out.getVersion().onOrAfter(MULTIPLE_REPOSITORIES_SUPPORT_ADDED)) {
8990
out.writeStringArray(repositories);
9091
} else {
9192
out.writeString(repositories[0]);

server/src/main/java/org/elasticsearch/snapshots/SnapshotInfo.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ private SnapshotInfo(SnapshotId snapshotId, String repository, List<String> indi
282282
*/
283283
public SnapshotInfo(final StreamInput in) throws IOException {
284284
snapshotId = new SnapshotId(in);
285-
if (in.getVersion().onOrAfter(Version.V_7_1_0)) {
285+
if (in.getVersion().onOrAfter(GetSnapshotsRequest.MULTIPLE_REPOSITORIES_SUPPORT_ADDED)) {
286286
repository = in.readString();
287287
} else {
288288
repository = null;
@@ -693,7 +693,7 @@ public static SnapshotInfo fromXContentInternal(final XContentParser parser) thr
693693
@Override
694694
public void writeTo(final StreamOutput out) throws IOException {
695695
snapshotId.writeTo(out);
696-
if (out.getVersion().onOrAfter(Version.V_7_1_0)) {
696+
if (out.getVersion().onOrAfter(GetSnapshotsRequest.MULTIPLE_REPOSITORIES_SUPPORT_ADDED)) {
697697
out.writeString(repository);
698698
}
699699
out.writeVInt(indices.size());

0 commit comments

Comments
 (0)