Skip to content

Commit 8a2d154

Browse files
committed
Update serialization versions for custom IndexMetaData backport
1 parent bbbb11a commit 8a2d154

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
@@ -448,7 +448,7 @@ public void readFrom(StreamInput in) throws IOException {
448448
}
449449
mappings.put(type, source);
450450
}
451-
if (in.getVersion().before(Version.V_7_0_0_alpha1)) {
451+
if (in.getVersion().before(Version.V_6_5_0)) {
452452
// This used to be the size of custom metadata classes
453453
int customSize = in.readVInt();
454454
assert customSize == 0 : "unexpected custom metadata when none is supported";
@@ -477,7 +477,7 @@ public void writeTo(StreamOutput out) throws IOException {
477477
out.writeString(entry.getKey());
478478
out.writeString(entry.getValue());
479479
}
480-
if (out.getVersion().before(Version.V_7_0_0_alpha1)) {
480+
if (out.getVersion().before(Version.V_6_5_0)) {
481481
// Size of custom index metadata, which is removed
482482
out.writeVInt(0);
483483
}

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
@@ -474,7 +474,7 @@ public void readFrom(StreamInput in) throws IOException {
474474
String mappingSource = in.readString();
475475
mappings.put(type, mappingSource);
476476
}
477-
if (in.getVersion().before(Version.V_7_0_0_alpha1)) {
477+
if (in.getVersion().before(Version.V_6_5_0)) {
478478
// Used to be used for custom index metadata
479479
int customSize = in.readVInt();
480480
assert customSize == 0 : "expected not to have any custom metadata";
@@ -507,7 +507,7 @@ public void writeTo(StreamOutput out) throws IOException {
507507
out.writeString(entry.getKey());
508508
out.writeString(entry.getValue());
509509
}
510-
if (out.getVersion().before(Version.V_7_0_0_alpha1)) {
510+
if (out.getVersion().before(Version.V_6_5_0)) {
511511
out.writeVInt(0);
512512
}
513513
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
@@ -706,7 +706,7 @@ public static IndexMetaData readFrom(StreamInput in) throws IOException {
706706
builder.putAlias(aliasMd);
707707
}
708708
int customSize = in.readVInt();
709-
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
709+
if (in.getVersion().onOrAfter(Version.V_6_5_0)) {
710710
for (int i = 0; i < customSize; i++) {
711711
String key = in.readString();
712712
DiffableStringMap custom = new DiffableStringMap(in);
@@ -752,7 +752,7 @@ public void writeTo(StreamOutput out) throws IOException {
752752
for (ObjectCursor<AliasMetaData> cursor : aliases.values()) {
753753
cursor.value.writeTo(out);
754754
}
755-
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
755+
if (out.getVersion().onOrAfter(Version.V_6_5_0)) {
756756
out.writeVInt(customData.size());
757757
for (final ObjectObjectCursor<String, DiffableStringMap> cursor : customData) {
758758
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";
@@ -245,7 +245,7 @@ public void writeTo(StreamOutput out) throws IOException {
245245
for (ObjectCursor<AliasMetaData> cursor : aliases.values()) {
246246
cursor.value.writeTo(out);
247247
}
248-
if (out.getVersion().before(Version.V_7_0_0_alpha1)) {
248+
if (out.getVersion().before(Version.V_6_5_0)) {
249249
out.writeVInt(0);
250250
}
251251
out.writeOptionalVInt(version);

0 commit comments

Comments
 (0)