Cleanup suppressed overlength line for action.support package#34889
Conversation
AthenaEryma
left a comment
There was a problem hiding this comment.
Left a few nits that you can either take or not as you like, overall LGTM.
| if (indexMetaData != null) { | ||
| for (IntObjectCursor<IndexShardRoutingTable> shardRouting : clusterState.getRoutingTable().indicesRouting().get(index).getShards()) { | ||
| for (IntObjectCursor<IndexShardRoutingTable> shardRouting : | ||
| clusterState.getRoutingTable().indicesRouting().get(index).getShards()) { |
There was a problem hiding this comment.
I did this kind of thing as
for (IntObjectCursor<IndexShardRoutingTable> shardRouting
: clusterState.getRoutingTable().indicesRouting().get(index).getShards()) {
Since I thought it made it more visually obvious that the second line was part of the for and not the code block below, but I could see either way.
There was a problem hiding this comment.
+1. I really like indenting an extra level for things like this so the for loop's "for" parts don't line up with the block's body.
| public abstract class TransportInstanceSingleOperationAction<Request extends InstanceShardOperationRequest<Request>, Response extends ActionResponse> | ||
| extends HandledTransportAction<Request, Response> { | ||
| public abstract class TransportInstanceSingleOperationAction<Request extends InstanceShardOperationRequest<Request>, | ||
| Response extends ActionResponse> extends HandledTransportAction<Request, Response> { |
There was a problem hiding this comment.
I'd prefer:
| Response extends ActionResponse> extends HandledTransportAction<Request, Response> { | |
| Response extends ActionResponse> | |
| extends HandledTransportAction<Request, Response> { |
But again, either way really.
There was a problem hiding this comment.
public abstract class TransportInstanceSingleOperationAction<
Request extends InstanceShardOperationRequest<Request>,
Response extends ActionResponse
> extends HandledTransportAction<Request, Response> {
Is my preference. Stately.
| } | ||
| transportService.sendRequest(node, transportShardAction, internalRequest.request(), new TransportResponseHandler<Response>() { | ||
| transportService.sendRequest(node, transportShardAction, internalRequest.request(), new TransportResponseHandler<Response>() | ||
| { |
There was a problem hiding this comment.
I think moving the whole new new TransportResponseHandler<Response>() { onto the next line is a little clearer.
nik9000
left a comment
There was a problem hiding this comment.
I've left a few minor things but also LGTM.
|
|
||
| public abstract class DelegatingActionListener<Instigator extends ActionResponse, Delegated extends ActionResponse> implements ActionListener<Instigator> { | ||
| public abstract class DelegatingActionListener<Instigator extends ActionResponse, Delegated extends ActionResponse> | ||
| implements ActionListener<Instigator> { |
| import org.elasticsearch.client.ElasticsearchClient; | ||
|
|
||
| public abstract class BroadcastOperationRequestBuilder<Request extends BroadcastRequest<Request>, Response extends BroadcastResponse, RequestBuilder extends BroadcastOperationRequestBuilder<Request, Response, RequestBuilder>> | ||
| public abstract class BroadcastOperationRequestBuilder<Request extends BroadcastRequest<Request>, Response extends BroadcastResponse, |
There was a problem hiding this comment.
I'd probably do these one-per-line at this point.
|
|
||
| public abstract class TransportBroadcastAction<Request extends BroadcastRequest<Request>, Response extends BroadcastResponse, ShardRequest extends BroadcastShardRequest, ShardResponse extends BroadcastShardResponse> | ||
| public abstract class TransportBroadcastAction<Request extends BroadcastRequest<Request>, Response extends BroadcastResponse, | ||
| ShardRequest extends BroadcastShardRequest, ShardResponse extends BroadcastShardResponse> |
| onOperation(shard, shardIt, shardIndex, new NoShardAvailableActionException(shardIt.shardId())); | ||
| } else { | ||
| transportService.sendRequest(node, transportShardAction, shardRequest, new TransportResponseHandler<ShardResponse>() { | ||
| transportService.sendRequest(node, transportShardAction, shardRequest, new TransportResponseHandler<ShardResponse>() |
There was a problem hiding this comment.
Maybe put the class on a new line rather than move the body opening like this.
| public abstract class TransportInstanceSingleOperationAction<Request extends InstanceShardOperationRequest<Request>, Response extends ActionResponse> | ||
| extends HandledTransportAction<Request, Response> { | ||
| public abstract class TransportInstanceSingleOperationAction<Request extends InstanceShardOperationRequest<Request>, | ||
| Response extends ActionResponse> extends HandledTransportAction<Request, Response> { |
There was a problem hiding this comment.
public abstract class TransportInstanceSingleOperationAction<
Request extends InstanceShardOperationRequest<Request>,
Response extends ActionResponse
> extends HandledTransportAction<Request, Response> {
Is my preference. Stately.
| } | ||
| transportService.sendRequest(node, transportShardAction, internalRequest.request(), new TransportResponseHandler<Response>() { | ||
| transportService.sendRequest(node, transportShardAction, internalRequest.request(), new TransportResponseHandler<Response>() | ||
| { |
| TestBroadcastReplicationAction(Settings settings, ClusterService clusterService, TransportService transportService, | ||
| ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver, | ||
| TransportReplicationAction<BasicReplicationRequest, BasicReplicationRequest, ReplicationResponse> replicatedBroadcastShardAction) { | ||
| TransportReplicationAction<BasicReplicationRequest, BasicReplicationRequest, ReplicationResponse> |
There was a problem hiding this comment.
Wow! I've never thought of breaking the type from the name before but it looks like we kind of have to to fit it in.
There was a problem hiding this comment.
yeah, I'm really not happy with doing it this way, but the only alternative I saw was to split the type parameters out to separate lines, which looked worse to me. I'm open to suggestions.
|
Please remember to add all relevant labels (area label, version label(s) and change type label) on all PRs and please look for this as part of reviews. The release note generation process is made much harder when PRs are not labelled correctly. |
|
Pinging @elastic/es-core-infra |
Conflicts: server/src/main/java/org/elasticsearch/action/support/broadcast/TransportBroadcastAction.java server/src/main/java/org/elasticsearch/action/support/single/shard/TransportSingleShardAction.java
Clean up lines over 140 characters in the `org.elasticsearch.action.support.*` packages Relates to #34884
Clean up lines over 140 characters in the
org.elasticsearch.action.support.*packages (master branch version)Relates to #34884