Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ static TransportVersion def(int id) {
public static final TransportVersion V_8_15_0 = def(8_702_0_02);
public static final TransportVersion V_8_15_2 = def(8_702_0_03);
public static final TransportVersion V_8_16_0 = def(8_772_0_01);
public static final TransportVersion V_8_16_1 = def(8_772_0_04);
// TODO: leave this version until the very end to satisfy max transport version test
public static final TransportVersion INITIAL_ELASTICSEARCH_8_17_5 = def(8_797_0_05);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ public NodeInfo(StreamInput in) throws IOException {
super(in);
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_12_0)) {
version = in.readString();
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_16_1)) {
compatibilityVersions = CompatibilityVersions.readVersion(in);
} else {
compatibilityVersions = new CompatibilityVersions(TransportVersion.readVersion(in), Map.of()); // unknown mappings versions
}
compatibilityVersions = CompatibilityVersions.readVersion(in);
indexVersion = IndexVersion.readVersion(in);
} else {
Version legacyVersion = Version.readVersion(in);
Expand Down Expand Up @@ -251,11 +247,7 @@ public void writeTo(StreamOutput out) throws IOException {
} else {
Version.writeVersion(Version.fromString(version), out);
}
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_16_1)) {
compatibilityVersions.writeTo(out);
} else if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) {
TransportVersion.writeVersion(compatibilityVersions.transportVersion(), out);
}
compatibilityVersions.writeTo(out);
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_11_X)) {
IndexVersion.writeVersion(indexVersion, out);
out.writeMap(componentVersions, StreamOutput::writeString, StreamOutput::writeVInt);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,11 +286,7 @@ public SearchSourceBuilder(StreamInput in) throws IOException {
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) {
rankBuilder = in.readOptionalNamedWriteable(RankBuilder.class);
}
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_16_1)) {
skipInnerHits = in.readBoolean();
} else {
skipInnerHits = false;
}
skipInnerHits = in.readBoolean();
}

@Override
Expand Down Expand Up @@ -370,9 +366,7 @@ public void writeTo(StreamOutput out) throws IOException {
} else if (rankBuilder != null) {
throw new IllegalArgumentException("cannot serialize [rank] to version [" + out.getTransportVersion().toReleaseVersion() + "]");
}
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_16_1)) {
out.writeBoolean(skipInnerHits);
}
out.writeBoolean(skipInnerHits);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import static org.hamcrest.Matchers.hasKey;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.notNullValue;
import static org.hamcrest.Matchers.nullValue;
import static org.hamcrest.Matchers.sameInstance;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,7 @@ public QueryRulesetListItem(StreamInput in) throws IOException {
} else {
this.criteriaTypeToCountMap = Map.of();
}
TransportVersion streamTransportVersion = in.getTransportVersion();
if (streamTransportVersion.onOrAfter(TransportVersions.V_8_16_1)) {
this.ruleTypeToCountMap = in.readMap(m -> in.readEnum(QueryRule.QueryRuleType.class), StreamInput::readInt);
} else {
this.ruleTypeToCountMap = Map.of();
}
this.ruleTypeToCountMap = in.readMap(m -> in.readEnum(QueryRule.QueryRuleType.class), StreamInput::readInt);
}

@Override
Expand Down Expand Up @@ -101,10 +96,7 @@ public void writeTo(StreamOutput out) throws IOException {
if (out.getTransportVersion().onOrAfter(EXPANDED_RULESET_COUNT_TRANSPORT_VERSION)) {
out.writeMap(criteriaTypeToCountMap, StreamOutput::writeEnum, StreamOutput::writeInt);
}
TransportVersion streamTransportVersion = out.getTransportVersion();
if (streamTransportVersion.onOrAfter(TransportVersions.V_8_16_1)) {
out.writeMap(ruleTypeToCountMap, StreamOutput::writeEnum, StreamOutput::writeInt);
}
out.writeMap(ruleTypeToCountMap, StreamOutput::writeEnum, StreamOutput::writeInt);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
package org.elasticsearch.xpack.application.rules.action;

import org.elasticsearch.TransportVersion;
import org.elasticsearch.TransportVersions;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.xpack.application.EnterpriseSearchModuleTestUtils;
import org.elasticsearch.xpack.application.rules.QueryRule;
Expand All @@ -17,8 +16,6 @@
import org.elasticsearch.xpack.application.rules.QueryRulesetListItem;
import org.elasticsearch.xpack.core.ml.AbstractBWCWireSerializationTestCase;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class ListQueryRulesetsActionResponseBWCSerializingTests extends AbstractBWCWireSerializationTestCase<
Expand Down Expand Up @@ -59,22 +56,6 @@ protected ListQueryRulesetsAction.Response mutateInstanceForVersion(
ListQueryRulesetsAction.Response instance,
TransportVersion version
) {
if (version.onOrAfter(TransportVersions.V_8_16_1)) {
return instance;
} else if (version.onOrAfter(QueryRulesetListItem.EXPANDED_RULESET_COUNT_TRANSPORT_VERSION)) {
List<QueryRulesetListItem> updatedResults = new ArrayList<>();
for (QueryRulesetListItem listItem : instance.queryPage.results()) {
updatedResults.add(
new QueryRulesetListItem(listItem.rulesetId(), listItem.ruleTotalCount(), listItem.criteriaTypeToCountMap(), Map.of())
);
}
return new ListQueryRulesetsAction.Response(updatedResults, instance.queryPage.count());
} else {
List<QueryRulesetListItem> updatedResults = new ArrayList<>();
for (QueryRulesetListItem listItem : instance.queryPage.results()) {
updatedResults.add(new QueryRulesetListItem(listItem.rulesetId(), listItem.ruleTotalCount(), Map.of(), Map.of()));
}
return new ListQueryRulesetsAction.Response(updatedResults, instance.queryPage.count());
}
return instance;
}
}