Skip to content

Commit

Permalink
[ML] Adapt wire serialization code and re-enable BWC tests after back…
Browse files Browse the repository at this point in the history
…port (elastic#75847)
  • Loading branch information
przemekwitek authored and ywangd committed Jul 30, 2021
1 parent bbf4c94 commit 8dd1deb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 24 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ tasks.register("verifyVersions") {
* after the backport of the backcompat code is complete.
*/

boolean bwc_tests_enabled = false
boolean bwc_tests_enabled = true
// place a PR link here when committing bwc changes:
String bwc_tests_disabled_issue = "https://github.com/elastic/elasticsearch/pull/75617"
String bwc_tests_disabled_issue = ""
/*
* FIPS 140-2 behavior was fixed in 7.11.0. Before that there is no way to run elasticsearch in a
* JVM that is properly configured to be in fips mode with BCFIPS. For now we need to disable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,7 @@ public Job(StreamInput in) throws IOException {
modelSnapshotRetentionDays = in.readOptionalLong();
dailyModelSnapshotRetentionAfterDays = in.readOptionalLong();
resultsRetentionDays = in.readOptionalLong();
if (in.getVersion().onOrAfter(Version.V_8_0_0)) { // TODO: 7.15
systemAnnotationsRetentionDays = in.readOptionalLong();
} else {
systemAnnotationsRetentionDays = null;
}
systemAnnotationsRetentionDays = in.readOptionalLong();
Map<String, Object> readCustomSettings = in.readMap();
customSettings = readCustomSettings == null ? null : Collections.unmodifiableMap(readCustomSettings);
modelSnapshotId = in.readOptionalString();
Expand Down Expand Up @@ -539,9 +535,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeOptionalLong(modelSnapshotRetentionDays);
out.writeOptionalLong(dailyModelSnapshotRetentionAfterDays);
out.writeOptionalLong(resultsRetentionDays);
if (out.getVersion().onOrAfter(Version.V_8_0_0)) { // TODO: 7.15
out.writeOptionalLong(systemAnnotationsRetentionDays);
}
out.writeOptionalLong(systemAnnotationsRetentionDays);
out.writeMap(customSettings);
out.writeOptionalString(modelSnapshotId);
if (modelSnapshotMinVersion != null) {
Expand Down Expand Up @@ -795,9 +789,7 @@ public Builder(StreamInput in) throws IOException {
modelSnapshotRetentionDays = in.readOptionalLong();
dailyModelSnapshotRetentionAfterDays = in.readOptionalLong();
resultsRetentionDays = in.readOptionalLong();
if (in.getVersion().onOrAfter(Version.V_8_0_0)) { // TODO: 7.15
systemAnnotationsRetentionDays = in.readOptionalLong();
}
systemAnnotationsRetentionDays = in.readOptionalLong();
customSettings = in.readMap();
modelSnapshotId = in.readOptionalString();
if (in.readBoolean()) {
Expand Down Expand Up @@ -1030,9 +1022,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeOptionalLong(modelSnapshotRetentionDays);
out.writeOptionalLong(dailyModelSnapshotRetentionAfterDays);
out.writeOptionalLong(resultsRetentionDays);
if (out.getVersion().onOrAfter(Version.V_8_0_0)) { // TODO: 7.15
out.writeOptionalLong(systemAnnotationsRetentionDays);
}
out.writeOptionalLong(systemAnnotationsRetentionDays);
out.writeMap(customSettings);
out.writeOptionalString(modelSnapshotId);
if (modelSnapshotMinVersion != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,7 @@ public JobUpdate(StreamInput in) throws IOException {
modelSnapshotRetentionDays = in.readOptionalLong();
dailyModelSnapshotRetentionAfterDays = in.readOptionalLong();
resultsRetentionDays = in.readOptionalLong();
if (in.getVersion().onOrAfter(Version.V_8_0_0)) { // TODO: 7.15
systemAnnotationsRetentionDays = in.readOptionalLong();
} else {
systemAnnotationsRetentionDays = null;
}
systemAnnotationsRetentionDays = in.readOptionalLong();
if (in.readBoolean()) {
categorizationFilters = in.readStringList();
} else {
Expand Down Expand Up @@ -187,9 +183,7 @@ public void writeTo(StreamOutput out) throws IOException {
out.writeOptionalLong(modelSnapshotRetentionDays);
out.writeOptionalLong(dailyModelSnapshotRetentionAfterDays);
out.writeOptionalLong(resultsRetentionDays);
if (out.getVersion().onOrAfter(Version.V_8_0_0)) { // TODO: 7.15
out.writeOptionalLong(systemAnnotationsRetentionDays);
}
out.writeOptionalLong(systemAnnotationsRetentionDays);
out.writeBoolean(categorizationFilters != null);
if (categorizationFilters != null) {
out.writeStringCollection(categorizationFilters);
Expand Down

0 comments on commit 8dd1deb

Please sign in to comment.