Skip to content

Commit 799e1a7

Browse files
Remove BWC in UpdateWatcherSettingsAction (#116686)
This removes code which was providing transport compatibility with pre-8.15 nodes, which is not needed for 9.0. At this point, the `readFrom` method is a one-liner, so it is inlined, making the constructor public (which is more conventional).
1 parent 103a8b0 commit 799e1a7

File tree

2 files changed

+3
-21
lines changed

2 files changed

+3
-21
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/watcher/transport/actions/put/UpdateWatcherSettingsAction.java

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
package org.elasticsearch.xpack.core.watcher.transport.actions.put;
99

10-
import org.elasticsearch.TransportVersions;
1110
import org.elasticsearch.action.ActionRequestValidationException;
1211
import org.elasticsearch.action.ActionType;
1312
import org.elasticsearch.action.ValidateActions;
@@ -17,7 +16,6 @@
1716
import org.elasticsearch.common.io.stream.StreamInput;
1817
import org.elasticsearch.common.io.stream.StreamOutput;
1918
import org.elasticsearch.core.TimeValue;
20-
import org.elasticsearch.core.UpdateForV9;
2119

2220
import java.io.IOException;
2321
import java.util.Map;
@@ -56,30 +54,14 @@ public Request(TimeValue masterNodeTimeout, TimeValue ackTimeout, Map<String, Ob
5654
this.settings = settings;
5755
}
5856

59-
public static Request readFrom(StreamInput in) throws IOException {
60-
if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
61-
return new Request(in);
62-
} else {
63-
return new Request(TimeValue.THIRTY_SECONDS, TimeValue.THIRTY_SECONDS, in);
64-
}
65-
}
66-
67-
private Request(StreamInput in) throws IOException {
57+
public Request(StreamInput in) throws IOException {
6858
super(in);
6959
this.settings = in.readGenericMap();
7060
}
7161

72-
@UpdateForV9(owner = UpdateForV9.Owner.DATA_MANAGEMENT) // bwc no longer required
73-
private Request(TimeValue masterNodeTimeout, TimeValue ackTimeout, StreamInput in) throws IOException {
74-
super(masterNodeTimeout, ackTimeout);
75-
this.settings = in.readGenericMap();
76-
}
77-
7862
@Override
7963
public void writeTo(StreamOutput out) throws IOException {
80-
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) {
81-
super.writeTo(out);
82-
}
64+
super.writeTo(out);
8365
out.writeGenericMap(this.settings);
8466
}
8567

x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transport/actions/TransportUpdateWatcherSettingsAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public TransportUpdateWatcherSettingsAction(
6868
clusterService,
6969
threadPool,
7070
actionFilters,
71-
UpdateWatcherSettingsAction.Request::readFrom,
71+
UpdateWatcherSettingsAction.Request::new,
7272
indexNameExpressionResolver,
7373
AcknowledgedResponse::readFrom,
7474
EsExecutors.DIRECT_EXECUTOR_SERVICE

0 commit comments

Comments
 (0)