Skip to content

Commit 3262f4a

Browse files
committed
Update serialization versions for custom IndexMetaData backport
1 parent df45716 commit 3262f4a

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

server/src/main/java/org/elasticsearch/action/admin/indices/create/CreateIndexRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ public void readFrom(StreamInput in) throws IOException {
474474
}
475475
mappings.put(type, source);
476476
}
477-
if (in.getVersion().before(Version.V_7_0_0_alpha1)) {
477+
if (in.getVersion().before(Version.V_6_5_0)) {
478478
// This used to be the size of custom metadata classes
479479
int customSize = in.readVInt();
480480
assert customSize == 0 : "unexpected custom metadata when none is supported";
@@ -501,7 +501,7 @@ public void writeTo(StreamOutput out) throws IOException {
501501
out.writeString(entry.getKey());
502502
out.writeString(entry.getValue());
503503
}
504-
if (out.getVersion().before(Version.V_7_0_0_alpha1)) {
504+
if (out.getVersion().before(Version.V_6_5_0)) {
505505
// Size of custom index metadata, which is removed
506506
out.writeVInt(0);
507507
}

server/src/main/java/org/elasticsearch/action/admin/indices/template/put/PutIndexTemplateRequest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ public void readFrom(StreamInput in) throws IOException {
480480
}
481481
mappings.put(type, mappingSource);
482482
}
483-
if (in.getVersion().before(Version.V_7_0_0_alpha1)) {
483+
if (in.getVersion().before(Version.V_6_5_0)) {
484484
// Used to be used for custom index metadata
485485
int customSize = in.readVInt();
486486
assert customSize == 0 : "expected not to have any custom metadata";
@@ -513,7 +513,7 @@ public void writeTo(StreamOutput out) throws IOException {
513513
out.writeString(entry.getKey());
514514
out.writeString(entry.getValue());
515515
}
516-
if (out.getVersion().before(Version.V_7_0_0_alpha1)) {
516+
if (out.getVersion().before(Version.V_6_5_0)) {
517517
out.writeVInt(0);
518518
}
519519
out.writeVInt(aliases.size());

server/src/main/java/org/elasticsearch/cluster/metadata/IndexMetaData.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ public static IndexMetaData readFrom(StreamInput in) throws IOException {
715715
builder.putAlias(aliasMd);
716716
}
717717
int customSize = in.readVInt();
718-
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
718+
if (in.getVersion().onOrAfter(Version.V_6_5_0)) {
719719
for (int i = 0; i < customSize; i++) {
720720
String key = in.readString();
721721
DiffableStringMap custom = new DiffableStringMap(in);
@@ -761,7 +761,7 @@ public void writeTo(StreamOutput out) throws IOException {
761761
for (ObjectCursor<AliasMetaData> cursor : aliases.values()) {
762762
cursor.value.writeTo(out);
763763
}
764-
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
764+
if (out.getVersion().onOrAfter(Version.V_6_5_0)) {
765765
out.writeVInt(customData.size());
766766
for (final ObjectObjectCursor<String, DiffableStringMap> cursor : customData) {
767767
out.writeString(cursor.key);

server/src/main/java/org/elasticsearch/cluster/metadata/IndexTemplateMetaData.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public static IndexTemplateMetaData readFrom(StreamInput in) throws IOException
210210
AliasMetaData aliasMd = new AliasMetaData(in);
211211
builder.putAlias(aliasMd);
212212
}
213-
if (in.getVersion().before(Version.V_7_0_0_alpha1)) {
213+
if (in.getVersion().before(Version.V_6_5_0)) {
214214
// Previously we allowed custom metadata
215215
int customSize = in.readVInt();
216216
assert customSize == 0 : "expected no custom metadata";
@@ -247,7 +247,7 @@ public void writeTo(StreamOutput out) throws IOException {
247247
for (ObjectCursor<AliasMetaData> cursor : aliases.values()) {
248248
cursor.value.writeTo(out);
249249
}
250-
if (out.getVersion().before(Version.V_7_0_0_alpha1)) {
250+
if (out.getVersion().before(Version.V_6_5_0)) {
251251
out.writeVInt(0);
252252
}
253253
if (out.getVersion().onOrAfter(Version.V_5_0_0_beta1)) {

0 commit comments

Comments
 (0)