Changed versions in serialization code after backporting #35535
This commit is contained in:
parent
998c663f0d
commit
447e5d212a
|
@ -57,8 +57,7 @@ public class ClusterStateRequest extends MasterNodeReadRequest<ClusterStateReque
|
|||
customs = in.readBoolean();
|
||||
indices = in.readStringArray();
|
||||
indicesOptions = IndicesOptions.readIndicesOptions(in);
|
||||
// TODO: change version to V_6_6_0 after backporting:
|
||||
if (in.getVersion().onOrAfter(Version.V_7_0_0)) {
|
||||
if (in.getVersion().onOrAfter(Version.V_6_6_0)) {
|
||||
waitForTimeout = in.readTimeValue();
|
||||
waitForMetaDataVersion = in.readOptionalLong();
|
||||
}
|
||||
|
@ -74,8 +73,7 @@ public class ClusterStateRequest extends MasterNodeReadRequest<ClusterStateReque
|
|||
out.writeBoolean(customs);
|
||||
out.writeStringArray(indices);
|
||||
indicesOptions.writeIndicesOptions(out);
|
||||
// TODO: change version to V_6_6_0 after backporting:
|
||||
if (out.getVersion().onOrAfter(Version.V_7_0_0)) {
|
||||
if (out.getVersion().onOrAfter(Version.V_6_6_0)) {
|
||||
out.writeTimeValue(waitForTimeout);
|
||||
out.writeOptionalLong(waitForMetaDataVersion);
|
||||
}
|
||||
|
|
|
@ -91,8 +91,7 @@ public class ClusterStateResponse extends ActionResponse {
|
|||
public void readFrom(StreamInput in) throws IOException {
|
||||
super.readFrom(in);
|
||||
clusterName = new ClusterName(in);
|
||||
// TODO: change version to V_6_6_0 after backporting:
|
||||
if (in.getVersion().onOrAfter(Version.V_7_0_0)) {
|
||||
if (in.getVersion().onOrAfter(Version.V_6_6_0)) {
|
||||
clusterState = in.readOptionalWriteable(innerIn -> ClusterState.readFrom(innerIn, null));
|
||||
} else {
|
||||
clusterState = ClusterState.readFrom(in, null);
|
||||
|
@ -106,8 +105,7 @@ public class ClusterStateResponse extends ActionResponse {
|
|||
// at which point the correct cluster state size will always be reported
|
||||
totalCompressedSize = new ByteSizeValue(0L);
|
||||
}
|
||||
// TODO: change version to V_6_6_0 after backporting:
|
||||
if (in.getVersion().onOrAfter(Version.V_7_0_0)) {
|
||||
if (in.getVersion().onOrAfter(Version.V_6_6_0)) {
|
||||
waitForTimedOut = in.readBoolean();
|
||||
}
|
||||
}
|
||||
|
@ -116,8 +114,7 @@ public class ClusterStateResponse extends ActionResponse {
|
|||
public void writeTo(StreamOutput out) throws IOException {
|
||||
super.writeTo(out);
|
||||
clusterName.writeTo(out);
|
||||
// TODO: change version to V_6_6_0 after backporting:
|
||||
if (out.getVersion().onOrAfter(Version.V_7_0_0)) {
|
||||
if (out.getVersion().onOrAfter(Version.V_6_6_0)) {
|
||||
out.writeOptionalWriteable(clusterState);
|
||||
} else {
|
||||
if (out.getVersion().onOrAfter(Version.V_6_3_0)) {
|
||||
|
@ -129,8 +126,7 @@ public class ClusterStateResponse extends ActionResponse {
|
|||
if (out.getVersion().onOrAfter(Version.V_6_0_0_alpha1)) {
|
||||
totalCompressedSize.writeTo(out);
|
||||
}
|
||||
// TODO: change version to V_6_6_0 after backporting:
|
||||
if (out.getVersion().onOrAfter(Version.V_7_0_0)) {
|
||||
if (out.getVersion().onOrAfter(Version.V_6_6_0)) {
|
||||
out.writeBoolean(waitForTimedOut);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,8 +67,7 @@ public class ClusterStateRequestTests extends ESTestCase {
|
|||
assertThat(deserializedCSRequest.blocks(), equalTo(clusterStateRequest.blocks()));
|
||||
assertThat(deserializedCSRequest.indices(), equalTo(clusterStateRequest.indices()));
|
||||
assertOptionsMatch(deserializedCSRequest.indicesOptions(), clusterStateRequest.indicesOptions());
|
||||
// TODO: change version to V_6_6_0 after backporting:
|
||||
if (testVersion.onOrAfter(Version.V_7_0_0)) {
|
||||
if (testVersion.onOrAfter(Version.V_6_6_0)) {
|
||||
assertThat(deserializedCSRequest.waitForMetaDataVersion(), equalTo(clusterStateRequest.waitForMetaDataVersion()));
|
||||
assertThat(deserializedCSRequest.waitForTimeout(), equalTo(clusterStateRequest.waitForTimeout()));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue