Skip to content

Commit

Permalink
fixing bwc tests
Browse files Browse the repository at this point in the history
Signed-off-by: Bharathwaj G <[email protected]>
  • Loading branch information
bharath-techie committed Sep 2, 2024
1 parent 7247266 commit 85395e9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public CreateIndexRequest(StreamInput in) throws IOException {
aliases.add(new Alias(in));
}
waitForActiveShards = ActiveShardCount.readFrom(in);
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
if (in.getVersion().onOrAfter(Version.V_2_17_0)) {
context = in.readOptionalWriteable(Context::new);
}
}
Expand Down Expand Up @@ -632,7 +632,7 @@ public void writeTo(StreamOutput out) throws IOException {
alias.writeTo(out);
}
waitForActiveShards.writeTo(out);
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
if (out.getVersion().onOrAfter(Version.V_2_17_0)) {
out.writeOptionalWriteable(context);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public GetIndexResponse(
}
dataStreams = Collections.unmodifiableMap(dataStreamsMapBuilder);

if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
if (in.getVersion().onOrAfter(Version.V_2_17_0)) {
final Map<String, Context> contextMapBuilder = new HashMap<>();
int contextSize = in.readVInt();
for (int i = 0; i < contextSize; i++) {
Expand Down Expand Up @@ -297,7 +297,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeOptionalString(indexEntry.getValue());
}

if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
if (out.getVersion().onOrAfter(Version.V_2_17_0)) {
out.writeVInt(contexts.size());
for (final Map.Entry<String, Context> indexEntry : contexts.entrySet()) {
out.writeString(indexEntry.getKey());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1129,7 +1129,7 @@ private static class IndexMetadataDiff implements Diff<IndexMetadata> {
);
rolloverInfos = DiffableUtils.readJdkMapDiff(in, DiffableUtils.getStringKeySerializer(), ROLLOVER_INFO_DIFF_VALUE_READER);
isSystem = in.readBoolean();
if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
if (in.getVersion().onOrAfter(Version.V_2_17_0)) {
context = in.readOptionalWriteable(Context::new);
} else {
context = null;
Expand All @@ -1153,7 +1153,7 @@ public void writeTo(StreamOutput out) throws IOException {
inSyncAllocationIds.writeTo(out);
rolloverInfos.writeTo(out);
out.writeBoolean(isSystem);
if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
if (out.getVersion().onOrAfter(Version.V_2_17_0)) {
out.writeOptionalWriteable(context);
}
}
Expand Down Expand Up @@ -1218,7 +1218,7 @@ public static IndexMetadata readFrom(StreamInput in) throws IOException {
}
builder.system(in.readBoolean());

if (in.getVersion().onOrAfter(Version.V_3_0_0)) {
if (in.getVersion().onOrAfter(Version.V_2_17_0)) {
builder.context(in.readOptionalWriteable(Context::new));
}
return builder.build();
Expand Down Expand Up @@ -1259,7 +1259,7 @@ public void writeTo(StreamOutput out) throws IOException {
}
out.writeBoolean(isSystem);

if (out.getVersion().onOrAfter(Version.V_3_0_0)) {
if (out.getVersion().onOrAfter(Version.V_2_17_0)) {
out.writeOptionalWriteable(context);
}
}
Expand Down

0 comments on commit 85395e9

Please sign in to comment.