Skip to content

Commit 9db1778

Browse files
authored
Use StreamOutput::writeWriteable instead of writeTo directly (#112027)
1 parent f152839 commit 9db1778

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

modules/data-streams/src/main/java/org/elasticsearch/datastreams/lifecycle/action/GetDataStreamLifecycleStatsAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public Response(StreamInput in) throws IOException {
7676
public void writeTo(StreamOutput out) throws IOException {
7777
out.writeOptionalVLong(runDuration);
7878
out.writeOptionalVLong(timeBetweenStarts);
79-
out.writeCollection(dataStreamStats, (o, v) -> v.writeTo(o));
79+
out.writeCollection(dataStreamStats, StreamOutput::writeWriteable);
8080
}
8181

8282
public Long getRunDuration() {

server/src/main/java/org/elasticsearch/cluster/ClusterState.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ public void writeTo(StreamOutput out) throws IOException {
10811081
routingTable.writeTo(out);
10821082
nodes.writeTo(out);
10831083
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_8_0)) {
1084-
out.writeMap(compatibilityVersions, (streamOutput, versions) -> versions.writeTo(streamOutput));
1084+
out.writeMap(compatibilityVersions, StreamOutput::writeWriteable);
10851085
}
10861086
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_12_0)) {
10871087
clusterFeatures.writeTo(out);

server/src/main/java/org/elasticsearch/cluster/version/CompatibilityVersions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public void writeTo(StreamOutput out) throws IOException {
120120
TransportVersion.writeVersion(this.transportVersion(), out);
121121

122122
if (out.getTransportVersion().onOrAfter(TransportVersions.V_8_11_X)) {
123-
out.writeMap(this.systemIndexMappingsVersion(), (o, v) -> v.writeTo(o));
123+
out.writeMap(this.systemIndexMappingsVersion(), StreamOutput::writeWriteable);
124124
}
125125
}
126126

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/datatiers/NodeDataTiersUsage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,6 @@ public Map<String, UsageStats> getUsageStatsByTier() {
108108
@Override
109109
public void writeTo(StreamOutput out) throws IOException {
110110
super.writeTo(out);
111-
out.writeMap(usageStatsByTier, (o, v) -> v.writeTo(o));
111+
out.writeMap(usageStatsByTier, StreamOutput::writeWriteable);
112112
}
113113
}

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/enrich/EnrichPolicyResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ private static class LookupResponse extends TransportResponse {
332332

333333
@Override
334334
public void writeTo(StreamOutput out) throws IOException {
335-
out.writeMap(policies, (o, v) -> v.writeTo(o));
335+
out.writeMap(policies, StreamOutput::writeWriteable);
336336
out.writeMap(failures, StreamOutput::writeString);
337337
}
338338
}

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/session/Configuration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public void writeTo(StreamOutput out) throws IOException {
117117
out.writeBoolean(profile);
118118
}
119119
if (out.getTransportVersion().onOrAfter(TransportVersions.ESQL_REQUEST_TABLES)) {
120-
out.writeMap(tables, (o1, columns) -> o1.writeMap(columns, (o2, column) -> column.writeTo(o2)));
120+
out.writeMap(tables, (o1, columns) -> o1.writeMap(columns, StreamOutput::writeWriteable));
121121
}
122122
}
123123

0 commit comments

Comments
 (0)