Skip to content

Commit

Permalink
Remove line length violations for o.e.cluster (mostly) (#34923)
Browse files Browse the repository at this point in the history
This commit removes line length violations in most of the classes under
org.elasticsearch.cluster.
  • Loading branch information
rjernst authored and kcm committed Oct 30, 2018
1 parent 071bd15 commit 7d74cf9
Show file tree
Hide file tree
Showing 97 changed files with 1,080 additions and 585 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
import org.elasticsearch.common.Priority;
import org.elasticsearch.common.unit.TimeValue;

public class ClusterHealthRequestBuilder extends MasterNodeReadOperationRequestBuilder<ClusterHealthRequest, ClusterHealthResponse, ClusterHealthRequestBuilder> {
public class ClusterHealthRequestBuilder
extends MasterNodeReadOperationRequestBuilder<ClusterHealthRequest, ClusterHealthResponse, ClusterHealthRequestBuilder> {

public ClusterHealthRequestBuilder(ElasticsearchClient client, ClusterHealthAction action) {
super(client, action, new ClusterHealthRequest());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@

import java.util.function.Predicate;

public class TransportClusterHealthAction extends TransportMasterNodeReadAction<ClusterHealthRequest, ClusterHealthResponse> {
public class TransportClusterHealthAction
extends TransportMasterNodeReadAction<ClusterHealthRequest, ClusterHealthResponse> {

private final GatewayAllocator gatewayAllocator;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
import org.elasticsearch.client.ElasticsearchClient;
import org.elasticsearch.common.unit.TimeValue;

public class NodesHotThreadsRequestBuilder extends NodesOperationRequestBuilder<NodesHotThreadsRequest, NodesHotThreadsResponse, NodesHotThreadsRequestBuilder> {
public class NodesHotThreadsRequestBuilder
extends NodesOperationRequestBuilder<NodesHotThreadsRequest, NodesHotThreadsResponse, NodesHotThreadsRequestBuilder> {

public NodesHotThreadsRequestBuilder(ElasticsearchClient client, NodesHotThreadsAction action) {
super(client, action, new NodesHotThreadsRequest());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
import org.elasticsearch.action.support.nodes.NodesOperationRequestBuilder;
import org.elasticsearch.client.ElasticsearchClient;

public class NodesStatsRequestBuilder extends NodesOperationRequestBuilder<NodesStatsRequest, NodesStatsResponse, NodesStatsRequestBuilder> {
public class NodesStatsRequestBuilder
extends NodesOperationRequestBuilder<NodesStatsRequest, NodesStatsResponse, NodesStatsRequestBuilder> {

public NodesStatsRequestBuilder(ElasticsearchClient client, NodesStatsAction action) {
super(client, action, new NodesStatsRequest());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
/**
* Builder for unregister repository request
*/
public class DeleteRepositoryRequestBuilder extends AcknowledgedRequestBuilder<DeleteRepositoryRequest, AcknowledgedResponse, DeleteRepositoryRequestBuilder> {
public class DeleteRepositoryRequestBuilder
extends AcknowledgedRequestBuilder<DeleteRepositoryRequest, AcknowledgedResponse, DeleteRepositoryRequestBuilder> {

/**
* Constructs unregister repository request builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public class TransportDeleteRepositoryAction extends TransportMasterNodeAction<D
public TransportDeleteRepositoryAction(Settings settings, TransportService transportService, ClusterService clusterService,
RepositoriesService repositoriesService, ThreadPool threadPool, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver) {
super(settings, DeleteRepositoryAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, DeleteRepositoryRequest::new);
super(settings, DeleteRepositoryAction.NAME, transportService, clusterService, threadPool, actionFilters,
indexNameExpressionResolver, DeleteRepositoryRequest::new);
this.repositoriesService = repositoriesService;
}

Expand All @@ -66,7 +67,8 @@ protected ClusterBlockException checkBlock(DeleteRepositoryRequest request, Clus
}

@Override
protected void masterOperation(final DeleteRepositoryRequest request, ClusterState state, final ActionListener<AcknowledgedResponse> listener) {
protected void masterOperation(final DeleteRepositoryRequest request, ClusterState state,
final ActionListener<AcknowledgedResponse> listener) {
repositoriesService.unregisterRepository(
new RepositoriesService.UnregisterRepositoryRequest("delete_repository [" + request.name() + "]", request.name())
.masterNodeTimeout(request.masterNodeTimeout()).ackTimeout(request.timeout()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
/**
* Get repository request builder
*/
public class GetRepositoriesRequestBuilder extends MasterNodeReadOperationRequestBuilder<GetRepositoriesRequest, GetRepositoriesResponse, GetRepositoriesRequestBuilder> {
public class GetRepositoriesRequestBuilder
extends MasterNodeReadOperationRequestBuilder<GetRepositoriesRequest, GetRepositoriesResponse, GetRepositoriesRequestBuilder> {

/**
* Creates new get repository request builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,10 @@ public class TransportGetRepositoriesAction extends TransportMasterNodeReadActio

@Inject
public TransportGetRepositoriesAction(Settings settings, TransportService transportService, ClusterService clusterService,
ThreadPool threadPool, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
super(settings, GetRepositoriesAction.NAME, transportService, clusterService, threadPool, actionFilters, GetRepositoriesRequest::new, indexNameExpressionResolver);
ThreadPool threadPool, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver) {
super(settings, GetRepositoriesAction.NAME, transportService, clusterService, threadPool, actionFilters,
GetRepositoriesRequest::new, indexNameExpressionResolver);
}

@Override
Expand All @@ -70,7 +72,8 @@ protected ClusterBlockException checkBlock(GetRepositoriesRequest request, Clust
}

@Override
protected void masterOperation(final GetRepositoriesRequest request, ClusterState state, final ActionListener<GetRepositoriesResponse> listener) {
protected void masterOperation(final GetRepositoriesRequest request, ClusterState state,
final ActionListener<GetRepositoriesResponse> listener) {
MetaData metaData = state.metaData();
RepositoriesMetaData repositories = metaData.custom(RepositoriesMetaData.TYPE);
if (request.repositories().length == 0 || (request.repositories().length == 1 && "_all".equals(request.repositories()[0]))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
/**
* Register repository request builder
*/
public class PutRepositoryRequestBuilder extends AcknowledgedRequestBuilder<PutRepositoryRequest, AcknowledgedResponse, PutRepositoryRequestBuilder> {
public class PutRepositoryRequestBuilder
extends AcknowledgedRequestBuilder<PutRepositoryRequest, AcknowledgedResponse, PutRepositoryRequestBuilder> {

/**
* Constructs register repository request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public class TransportPutRepositoryAction extends TransportMasterNodeAction<PutR
public TransportPutRepositoryAction(Settings settings, TransportService transportService, ClusterService clusterService,
RepositoriesService repositoriesService, ThreadPool threadPool, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver) {
super(settings, PutRepositoryAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, PutRepositoryRequest::new);
super(settings, PutRepositoryAction.NAME, transportService, clusterService, threadPool, actionFilters,
indexNameExpressionResolver, PutRepositoryRequest::new);
this.repositoriesService = repositoriesService;
}

Expand All @@ -66,7 +67,8 @@ protected ClusterBlockException checkBlock(PutRepositoryRequest request, Cluster
}

@Override
protected void masterOperation(final PutRepositoryRequest request, ClusterState state, final ActionListener<AcknowledgedResponse> listener) {
protected void masterOperation(final PutRepositoryRequest request, ClusterState state,
final ActionListener<AcknowledgedResponse> listener) {

repositoriesService.registerRepository(
new RepositoriesService.RegisterRepositoryRequest("put_repository [" + request.name() + "]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public class TransportVerifyRepositoryAction extends TransportMasterNodeAction<V
public TransportVerifyRepositoryAction(Settings settings, TransportService transportService, ClusterService clusterService,
RepositoriesService repositoriesService, ThreadPool threadPool, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver) {
super(settings, VerifyRepositoryAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, VerifyRepositoryRequest::new);
super(settings, VerifyRepositoryAction.NAME, transportService, clusterService, threadPool, actionFilters,
indexNameExpressionResolver, VerifyRepositoryRequest::new);
this.repositoriesService = repositoriesService;
}

Expand All @@ -66,7 +67,8 @@ protected ClusterBlockException checkBlock(VerifyRepositoryRequest request, Clus
}

@Override
protected void masterOperation(final VerifyRepositoryRequest request, ClusterState state, final ActionListener<VerifyRepositoryResponse> listener) {
protected void masterOperation(final VerifyRepositoryRequest request, ClusterState state,
final ActionListener<VerifyRepositoryResponse> listener) {
repositoriesService.verifyRepository(request.name(), new ActionListener<RepositoriesService.VerifyResponse>() {
@Override
public void onResponse(RepositoriesService.VerifyResponse verifyResponse) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
/**
* Builder for unregister repository request
*/
public class VerifyRepositoryRequestBuilder extends MasterNodeOperationRequestBuilder<VerifyRepositoryRequest, VerifyRepositoryResponse, VerifyRepositoryRequestBuilder> {
public class VerifyRepositoryRequestBuilder
extends MasterNodeOperationRequestBuilder<VerifyRepositoryRequest, VerifyRepositoryResponse, VerifyRepositoryRequestBuilder> {

/**
* Constructs unregister repository request builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ public class TransportClusterRerouteAction extends TransportMasterNodeAction<Clu
private final AllocationService allocationService;

@Inject
public TransportClusterRerouteAction(Settings settings, TransportService transportService, ClusterService clusterService, ThreadPool threadPool,
AllocationService allocationService, ActionFilters actionFilters, IndexNameExpressionResolver indexNameExpressionResolver) {
super(settings, ClusterRerouteAction.NAME, transportService, clusterService, threadPool, actionFilters, indexNameExpressionResolver, ClusterRerouteRequest::new);
public TransportClusterRerouteAction(Settings settings, TransportService transportService, ClusterService clusterService,
ThreadPool threadPool, AllocationService allocationService, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver) {
super(settings, ClusterRerouteAction.NAME, transportService, clusterService, threadPool, actionFilters,
indexNameExpressionResolver, ClusterRerouteRequest::new);
this.allocationService = allocationService;
}

Expand All @@ -66,7 +68,8 @@ protected ClusterRerouteResponse newResponse() {
}

@Override
protected void masterOperation(final ClusterRerouteRequest request, final ClusterState state, final ActionListener<ClusterRerouteResponse> listener) {
protected void masterOperation(final ClusterRerouteRequest request, final ClusterState state,
final ActionListener<ClusterRerouteResponse> listener) {
ActionListener<ClusterRerouteResponse> logWrapper = ActionListener.wrap(
response -> {
if (request.dryRun() == false) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
/**
* Builder for a cluster update settings request
*/
public class ClusterUpdateSettingsRequestBuilder extends AcknowledgedRequestBuilder<ClusterUpdateSettingsRequest, ClusterUpdateSettingsResponse, ClusterUpdateSettingsRequestBuilder> {
public class ClusterUpdateSettingsRequestBuilder extends AcknowledgedRequestBuilder<ClusterUpdateSettingsRequest,
ClusterUpdateSettingsResponse, ClusterUpdateSettingsRequestBuilder> {

public ClusterUpdateSettingsRequestBuilder(ElasticsearchClient client, ClusterUpdateSettingsAction action) {
super(client, action, new ClusterUpdateSettingsRequest());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
import org.elasticsearch.action.support.master.MasterNodeReadOperationRequestBuilder;
import org.elasticsearch.client.ElasticsearchClient;

public class ClusterSearchShardsRequestBuilder extends MasterNodeReadOperationRequestBuilder<ClusterSearchShardsRequest, ClusterSearchShardsResponse, ClusterSearchShardsRequestBuilder> {
public class ClusterSearchShardsRequestBuilder extends MasterNodeReadOperationRequestBuilder<ClusterSearchShardsRequest,
ClusterSearchShardsResponse, ClusterSearchShardsRequestBuilder> {

public ClusterSearchShardsRequestBuilder(ElasticsearchClient client, ClusterSearchShardsAction action) {
super(client, action, new ClusterSearchShardsRequest());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ protected void masterOperation(final ClusterSearchShardsRequest request, final C
}

Set<String> nodeIds = new HashSet<>();
GroupShardsIterator<ShardIterator> groupShardsIterator = clusterService.operationRouting().searchShards(clusterState, concreteIndices,
routingMap, request.preference());
GroupShardsIterator<ShardIterator> groupShardsIterator = clusterService.operationRouting()
.searchShards(clusterState, concreteIndices, routingMap, request.preference());
ShardRouting shard;
ClusterSearchShardsGroup[] groupResponses = new ClusterSearchShardsGroup[groupShardsIterator.size()];
int currentGroup = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
/**
* Create snapshot request builder
*/
public class CreateSnapshotRequestBuilder extends MasterNodeOperationRequestBuilder<CreateSnapshotRequest, CreateSnapshotResponse, CreateSnapshotRequestBuilder> {
public class CreateSnapshotRequestBuilder extends MasterNodeOperationRequestBuilder<CreateSnapshotRequest,
CreateSnapshotResponse, CreateSnapshotRequestBuilder> {

/**
* Constructs a new create snapshot request builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public class TransportCreateSnapshotAction extends TransportMasterNodeAction<Cre
public TransportCreateSnapshotAction(Settings settings, TransportService transportService, ClusterService clusterService,
ThreadPool threadPool, SnapshotsService snapshotsService, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver) {
super(settings, CreateSnapshotAction.NAME, transportService, clusterService, threadPool, actionFilters,CreateSnapshotRequest::new, indexNameExpressionResolver);
super(settings, CreateSnapshotAction.NAME, transportService, clusterService, threadPool, actionFilters,
CreateSnapshotRequest::new, indexNameExpressionResolver);
this.snapshotsService = snapshotsService;
}

Expand All @@ -66,11 +67,13 @@ protected ClusterBlockException checkBlock(CreateSnapshotRequest request, Cluste
if (clusterBlockException != null) {
return clusterBlockException;
}
return state.blocks().indicesBlockedException(ClusterBlockLevel.READ, indexNameExpressionResolver.concreteIndexNames(state, request));
return state.blocks()
.indicesBlockedException(ClusterBlockLevel.READ, indexNameExpressionResolver.concreteIndexNames(state, request));
}

@Override
protected void masterOperation(final CreateSnapshotRequest request, ClusterState state, final ActionListener<CreateSnapshotResponse> listener) {
protected void masterOperation(final CreateSnapshotRequest request, ClusterState state,
final ActionListener<CreateSnapshotResponse> listener) {
final String snapshotName = indexNameExpressionResolver.resolveDateMathExpression(request.snapshot());
SnapshotsService.SnapshotRequest snapshotRequest =
new SnapshotsService.SnapshotRequest(request.repository(), snapshotName, "create_snapshot [" + snapshotName + "]")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
/**
* Delete snapshot request builder
*/
public class DeleteSnapshotRequestBuilder extends MasterNodeOperationRequestBuilder<DeleteSnapshotRequest, AcknowledgedResponse, DeleteSnapshotRequestBuilder> {
public class DeleteSnapshotRequestBuilder extends MasterNodeOperationRequestBuilder<DeleteSnapshotRequest,
AcknowledgedResponse, DeleteSnapshotRequestBuilder> {

/**
* Constructs delete snapshot request builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public class TransportDeleteSnapshotAction extends TransportMasterNodeAction<Del
public TransportDeleteSnapshotAction(Settings settings, TransportService transportService, ClusterService clusterService,
ThreadPool threadPool, SnapshotsService snapshotsService, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver) {
super(settings, DeleteSnapshotAction.NAME, transportService, clusterService, threadPool, actionFilters, DeleteSnapshotRequest::new,indexNameExpressionResolver);
super(settings, DeleteSnapshotAction.NAME, transportService, clusterService, threadPool, actionFilters,
DeleteSnapshotRequest::new,indexNameExpressionResolver);
this.snapshotsService = snapshotsService;
}

Expand All @@ -65,7 +66,8 @@ protected ClusterBlockException checkBlock(DeleteSnapshotRequest request, Cluste
}

@Override
protected void masterOperation(final DeleteSnapshotRequest request, ClusterState state, final ActionListener<AcknowledgedResponse> listener) {
protected void masterOperation(final DeleteSnapshotRequest request, ClusterState state,
final ActionListener<AcknowledgedResponse> listener) {
snapshotsService.deleteSnapshot(request.repository(), request.snapshot(), new SnapshotsService.DeleteSnapshotListener() {
@Override
public void onResponse() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
/**
* Get snapshots request builder
*/
public class GetSnapshotsRequestBuilder extends MasterNodeOperationRequestBuilder<GetSnapshotsRequest, GetSnapshotsResponse, GetSnapshotsRequestBuilder> {
public class GetSnapshotsRequestBuilder extends MasterNodeOperationRequestBuilder<GetSnapshotsRequest,
GetSnapshotsResponse, GetSnapshotsRequestBuilder> {

/**
* Constructs the new get snapshot request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
/**
* Restore snapshot request builder
*/
public class RestoreSnapshotRequestBuilder extends MasterNodeOperationRequestBuilder<RestoreSnapshotRequest, RestoreSnapshotResponse, RestoreSnapshotRequestBuilder> {
public class RestoreSnapshotRequestBuilder extends MasterNodeOperationRequestBuilder<RestoreSnapshotRequest,
RestoreSnapshotResponse, RestoreSnapshotRequestBuilder> {

/**
* Constructs new restore snapshot request builder
Expand Down
Loading

0 comments on commit 7d74cf9

Please sign in to comment.