mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-09 14:35:04 +00:00
Adapt bwc versions after backporting #30983 to 6.4
This commit is contained in:
parent
4624ba5e10
commit
81172c0c31
@ -63,7 +63,7 @@ public class ClusterRerouteResponse extends AcknowledgedResponse implements ToXC
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
|
if (in.getVersion().onOrAfter(Version.V_6_4_0)) {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
state = ClusterState.readFrom(in, null);
|
state = ClusterState.readFrom(in, null);
|
||||||
explanations = RoutingExplanations.readFrom(in);
|
explanations = RoutingExplanations.readFrom(in);
|
||||||
@ -76,7 +76,7 @@ public class ClusterRerouteResponse extends AcknowledgedResponse implements ToXC
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
public void writeTo(StreamOutput out) throws IOException {
|
||||||
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
|
if (out.getVersion().onOrAfter(Version.V_6_4_0)) {
|
||||||
super.writeTo(out);
|
super.writeTo(out);
|
||||||
state.writeTo(out);
|
state.writeTo(out);
|
||||||
RoutingExplanations.writeTo(explanations, out);
|
RoutingExplanations.writeTo(explanations, out);
|
||||||
|
@ -68,7 +68,7 @@ public class ClusterUpdateSettingsResponse extends AcknowledgedResponse {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
|
if (in.getVersion().onOrAfter(Version.V_6_4_0)) {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
transientSettings = Settings.readSettingsFromStream(in);
|
transientSettings = Settings.readSettingsFromStream(in);
|
||||||
persistentSettings = Settings.readSettingsFromStream(in);
|
persistentSettings = Settings.readSettingsFromStream(in);
|
||||||
@ -89,7 +89,7 @@ public class ClusterUpdateSettingsResponse extends AcknowledgedResponse {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
public void writeTo(StreamOutput out) throws IOException {
|
||||||
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
|
if (out.getVersion().onOrAfter(Version.V_6_4_0)) {
|
||||||
super.writeTo(out);
|
super.writeTo(out);
|
||||||
Settings.writeSettingsToStream(transientSettings, out);
|
Settings.writeSettingsToStream(transientSettings, out);
|
||||||
Settings.writeSettingsToStream(persistentSettings, out);
|
Settings.writeSettingsToStream(persistentSettings, out);
|
||||||
|
@ -115,7 +115,7 @@ public final class RolloverResponse extends ShardsAcknowledgedResponse implement
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void readFrom(StreamInput in) throws IOException {
|
public void readFrom(StreamInput in) throws IOException {
|
||||||
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
|
if (in.getVersion().onOrAfter(Version.V_6_4_0)) {
|
||||||
super.readFrom(in);
|
super.readFrom(in);
|
||||||
oldIndex = in.readString();
|
oldIndex = in.readString();
|
||||||
newIndex = in.readString();
|
newIndex = in.readString();
|
||||||
@ -144,7 +144,7 @@ public final class RolloverResponse extends ShardsAcknowledgedResponse implement
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void writeTo(StreamOutput out) throws IOException {
|
public void writeTo(StreamOutput out) throws IOException {
|
||||||
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
|
if (out.getVersion().onOrAfter(Version.V_6_4_0)) {
|
||||||
super.writeTo(out);
|
super.writeTo(out);
|
||||||
out.writeString(oldIndex);
|
out.writeString(oldIndex);
|
||||||
out.writeString(newIndex);
|
out.writeString(newIndex);
|
||||||
|
@ -102,6 +102,6 @@ public class ClusterUpdateSettingsResponseTests extends AbstractStreamableXConte
|
|||||||
|
|
||||||
public void testOldSerialisation() throws IOException {
|
public void testOldSerialisation() throws IOException {
|
||||||
ClusterUpdateSettingsResponse original = createTestInstance();
|
ClusterUpdateSettingsResponse original = createTestInstance();
|
||||||
assertSerialization(original, VersionUtils.randomVersionBetween(random(), Version.V_6_0_0, Version.V_7_0_0_alpha1));
|
assertSerialization(original, VersionUtils.randomVersionBetween(random(), Version.V_6_0_0, Version.V_6_4_0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
|
|
||||||
package org.elasticsearch.action.admin.indices.rollover;
|
package org.elasticsearch.action.admin.indices.rollover;
|
||||||
|
|
||||||
|
import com.carrotsearch.randomizedtesting.annotations.Repeat;
|
||||||
|
|
||||||
import org.elasticsearch.Version;
|
import org.elasticsearch.Version;
|
||||||
import org.elasticsearch.common.unit.TimeValue;
|
import org.elasticsearch.common.unit.TimeValue;
|
||||||
import org.elasticsearch.common.xcontent.XContentParser;
|
import org.elasticsearch.common.xcontent.XContentParser;
|
||||||
@ -130,8 +132,9 @@ public class RolloverResponseTests extends AbstractStreamableXContentTestCase<Ro
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Repeat(iterations=1000)
|
||||||
public void testOldSerialisation() throws IOException {
|
public void testOldSerialisation() throws IOException {
|
||||||
RolloverResponse original = createTestInstance();
|
RolloverResponse original = createTestInstance();
|
||||||
assertSerialization(original, VersionUtils.randomVersionBetween(random(), Version.V_6_0_0, Version.V_7_0_0_alpha1));
|
assertSerialization(original, VersionUtils.randomVersionBetween(random(), Version.V_6_0_0, Version.V_6_4_0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user