mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-04-24 23:27:25 -04:00
Remove remoteAddress field from TransportResponse (#120016)
This field is only used (by security) for requests, having it in responses is redundant. Also, we have a couple of responses that are singletons/quasi-enums where setting the value needlessly might introduce some strange contention even though it's a plain store. This isn't just a cosmetic change. It makes it clear at compile time that each response instance is exclusively defined by the bytes that it is read from. This makes it easier to reason about the validity of suggested optimizations like https://github.com/elastic/elasticsearch/pull/120010
This commit is contained in:
parent
6b6fc8028d
commit
4c1c51e870
201 changed files with 20 additions and 263 deletions
|
@ -97,7 +97,6 @@ public class GetAnalyticsCollectionAction {
|
|||
public static final ParseField EVENT_DATA_STREAM_NAME_FIELD = new ParseField("name");
|
||||
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
this.collections = in.readCollectionAsList(AnalyticsCollection::new);
|
||||
}
|
||||
|
||||
|
|
|
@ -24,7 +24,6 @@ public class ConnectorCreateActionResponse extends ActionResponse implements ToX
|
|||
private final DocWriteResponse.Result result;
|
||||
|
||||
public ConnectorCreateActionResponse(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
this.id = in.readString();
|
||||
this.result = DocWriteResponse.Result.readFrom(in);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,6 @@ public class ConnectorUpdateActionResponse extends ActionResponse implements ToX
|
|||
final DocWriteResponse.Result result;
|
||||
|
||||
public ConnectorUpdateActionResponse(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
result = DocWriteResponse.Result.readFrom(in);
|
||||
}
|
||||
|
||||
|
|
|
@ -122,7 +122,6 @@ public class GetConnectorAction {
|
|||
}
|
||||
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
this.connector = new ConnectorSearchResult(in);
|
||||
}
|
||||
|
||||
|
|
|
@ -184,7 +184,6 @@ public class ListConnectorAction {
|
|||
final QueryPage<ConnectorSearchResult> queryPage;
|
||||
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
this.queryPage = new QueryPage<>(in, ConnectorSearchResult::new);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@ public class DeleteConnectorSecretResponse extends ActionResponse implements ToX
|
|||
}
|
||||
|
||||
public DeleteConnectorSecretResponse(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
this.deleted = in.readBoolean();
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ public class GetConnectorSecretResponse extends ActionResponse implements ToXCon
|
|||
private final String value;
|
||||
|
||||
public GetConnectorSecretResponse(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
id = in.readString();
|
||||
value = in.readString();
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ public class PostConnectorSecretResponse extends ActionResponse implements ToXCo
|
|||
}
|
||||
|
||||
public PostConnectorSecretResponse(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
this.id = in.readString();
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@ public class PutConnectorSecretResponse extends ActionResponse implements ToXCon
|
|||
}
|
||||
|
||||
public PutConnectorSecretResponse(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
result = DocWriteResponse.Result.readFrom(in);
|
||||
}
|
||||
|
||||
|
|
|
@ -116,7 +116,6 @@ public class GetConnectorSyncJobAction {
|
|||
}
|
||||
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
this.connectorSyncJob = new ConnectorSyncJobSearchResult(in);
|
||||
}
|
||||
|
||||
|
|
|
@ -171,7 +171,6 @@ public class ListConnectorSyncJobsAction {
|
|||
final QueryPage<ConnectorSyncJobSearchResult> queryPage;
|
||||
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
this.queryPage = new QueryPage<>(in, ConnectorSyncJobSearchResult::new);
|
||||
}
|
||||
|
||||
|
|
|
@ -146,7 +146,6 @@ public class PostConnectorSyncJobAction {
|
|||
private final String id;
|
||||
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
this.id = in.readString();
|
||||
}
|
||||
|
||||
|
|
|
@ -126,7 +126,6 @@ public class GetQueryRuleAction {
|
|||
private final QueryRule queryRule;
|
||||
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
this.queryRule = new QueryRule(in);
|
||||
}
|
||||
|
||||
|
|
|
@ -115,7 +115,6 @@ public class GetQueryRulesetAction {
|
|||
private final QueryRuleset queryRuleset;
|
||||
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
this.queryRuleset = new QueryRuleset(in);
|
||||
}
|
||||
|
||||
|
|
|
@ -107,7 +107,6 @@ public class ListQueryRulesetsAction {
|
|||
final QueryPage<QueryRulesetListItem> queryPage;
|
||||
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
this.queryPage = new QueryPage<>(in, QueryRulesetListItem::new);
|
||||
}
|
||||
|
||||
|
|
|
@ -151,7 +151,6 @@ public class PutQueryRuleAction {
|
|||
final DocWriteResponse.Result result;
|
||||
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
result = DocWriteResponse.Result.readFrom(in);
|
||||
}
|
||||
|
||||
|
|
|
@ -136,7 +136,6 @@ public class PutQueryRulesetAction {
|
|||
final DocWriteResponse.Result result;
|
||||
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
result = DocWriteResponse.Result.readFrom(in);
|
||||
}
|
||||
|
||||
|
|
|
@ -150,7 +150,6 @@ public class TestQueryRulesetAction {
|
|||
private static final ParseField MATCHED_RULES_FIELD = new ParseField("matched_rules");
|
||||
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
this.totalMatchedRules = in.readVInt();
|
||||
this.matchedRules = in.readCollectionAsList(MatchedRule::new);
|
||||
}
|
||||
|
|
|
@ -109,7 +109,6 @@ public class GetSearchApplicationAction {
|
|||
private final SearchApplication searchApp;
|
||||
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
this.searchApp = new SearchApplication(in);
|
||||
}
|
||||
|
||||
|
|
|
@ -127,7 +127,6 @@ public class ListSearchApplicationAction {
|
|||
final QueryPage<SearchApplicationListItem> queryPage;
|
||||
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
this.queryPage = new QueryPage<>(in, SearchApplicationListItem::new);
|
||||
}
|
||||
|
||||
|
|
|
@ -135,7 +135,6 @@ public class PutSearchApplicationAction {
|
|||
final DocWriteResponse.Result result;
|
||||
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
result = DocWriteResponse.Result.readFrom(in);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@ public class RenderSearchApplicationQueryAction {
|
|||
private final SearchSourceBuilder searchSourceBuilder;
|
||||
|
||||
public Response(StreamInput in) throws IOException {
|
||||
super(in);
|
||||
this.searchSourceBuilder = new SearchSourceBuilder(in);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue