@@ -116,8 +116,8 @@ public class SnapshotShardsService extends AbstractLifecycleComponent implements
116116 private final UpdateSnapshotStatusAction updateSnapshotStatusHandler ;
117117
118118 @ Inject
119- public SnapshotShardsService (Settings settings , ClusterService clusterService , SnapshotsService snapshotsService , ThreadPool threadPool ,
120- TransportService transportService , IndicesService indicesService ,
119+ public SnapshotShardsService (Settings settings , ClusterService clusterService , SnapshotsService snapshotsService ,
120+ ThreadPool threadPool , TransportService transportService , IndicesService indicesService ,
121121 ActionFilters actionFilters , IndexNameExpressionResolver indexNameExpressionResolver ) {
122122 super (settings );
123123 this .indicesService = indicesService ;
@@ -188,7 +188,8 @@ public void beforeIndexShardClosed(ShardId shardId, @Nullable IndexShard indexSh
188188 for (Map .Entry <Snapshot , Map <ShardId , IndexShardSnapshotStatus >> snapshotShards : snapshotShardsMap .entrySet ()) {
189189 Map <ShardId , IndexShardSnapshotStatus > shards = snapshotShards .getValue ();
190190 if (shards .containsKey (shardId )) {
191- logger .debug ("[{}] shard closing, abort snapshotting for snapshot [{}]" , shardId , snapshotShards .getKey ().getSnapshotId ());
191+ logger .debug ("[{}] shard closing, abort snapshotting for snapshot [{}]" ,
192+ shardId , snapshotShards .getKey ().getSnapshotId ());
192193 shards .get (shardId ).abortIfNotCompleted ("shard is closing, aborting" );
193194 }
194195 }
@@ -337,7 +338,8 @@ public void doRun() {
337338
338339 @ Override
339340 public void onFailure (Exception e ) {
340- logger .warn (() -> new ParameterizedMessage ("[{}][{}] failed to snapshot shard" , shardId , snapshot ), e );
341+ logger .warn (() -> new ParameterizedMessage ("[{}][{}] failed to snapshot shard" ,
342+ shardId , snapshot ), e );
341343 failure .set (e );
342344 }
343345
@@ -367,7 +369,8 @@ public void onAfter() {
367369 * @param snapshot snapshot
368370 * @param snapshotStatus snapshot status
369371 */
370- private void snapshot (final IndexShard indexShard , final Snapshot snapshot , final IndexId indexId , final IndexShardSnapshotStatus snapshotStatus ) {
372+ private void snapshot (final IndexShard indexShard , final Snapshot snapshot , final IndexId indexId ,
373+ final IndexShardSnapshotStatus snapshotStatus ) {
371374 final ShardId shardId = indexShard .shardId ();
372375 if (indexShard .routingEntry ().primary () == false ) {
373376 throw new IndexShardSnapshotFailedException (shardId , "snapshot should be performed only on primary" );
@@ -526,7 +529,8 @@ void sendSnapshotShardUpdate(final Snapshot snapshot, final ShardId shardId, fin
526529 *
527530 * @param request update shard status request
528531 */
529- private void innerUpdateSnapshotState (final UpdateIndexShardSnapshotStatusRequest request , ActionListener <UpdateIndexShardSnapshotStatusResponse > listener ) {
532+ private void innerUpdateSnapshotState (final UpdateIndexShardSnapshotStatusRequest request ,
533+ ActionListener <UpdateIndexShardSnapshotStatusResponse > listener ) {
530534 logger .trace ("received updated snapshot restore state [{}]" , request );
531535 clusterService .submitStateUpdateTask (
532536 "update snapshot state" ,
@@ -549,7 +553,8 @@ public void clusterStateProcessed(String source, ClusterState oldState, ClusterS
549553 class SnapshotStateExecutor implements ClusterStateTaskExecutor <UpdateIndexShardSnapshotStatusRequest > {
550554
551555 @ Override
552- public ClusterTasksResult <UpdateIndexShardSnapshotStatusRequest > execute (ClusterState currentState , List <UpdateIndexShardSnapshotStatusRequest > tasks ) throws Exception {
556+ public ClusterTasksResult <UpdateIndexShardSnapshotStatusRequest >
557+ execute (ClusterState currentState , List <UpdateIndexShardSnapshotStatusRequest > tasks ) throws Exception {
553558 final SnapshotsInProgress snapshots = currentState .custom (SnapshotsInProgress .TYPE );
554559 if (snapshots != null ) {
555560 int changedCount = 0 ;
@@ -560,7 +565,8 @@ public ClusterTasksResult<UpdateIndexShardSnapshotStatusRequest> execute(Cluster
560565
561566 for (UpdateIndexShardSnapshotStatusRequest updateSnapshotState : tasks ) {
562567 if (entry .snapshot ().equals (updateSnapshotState .snapshot ())) {
563- logger .trace ("[{}] Updating shard [{}] with status [{}]" , updateSnapshotState .snapshot (), updateSnapshotState .shardId (), updateSnapshotState .status ().state ());
568+ logger .trace ("[{}] Updating shard [{}] with status [{}]" , updateSnapshotState .snapshot (),
569+ updateSnapshotState .shardId (), updateSnapshotState .status ().state ());
564570 if (updated == false ) {
565571 shards .putAll (entry .shards ());
566572 updated = true ;
@@ -588,7 +594,8 @@ public ClusterTasksResult<UpdateIndexShardSnapshotStatusRequest> execute(Cluster
588594 if (changedCount > 0 ) {
589595 logger .trace ("changed cluster state triggered by {} snapshot state updates" , changedCount );
590596
591- final SnapshotsInProgress updatedSnapshots = new SnapshotsInProgress (entries .toArray (new SnapshotsInProgress .Entry [entries .size ()]));
597+ final SnapshotsInProgress updatedSnapshots =
598+ new SnapshotsInProgress (entries .toArray (new SnapshotsInProgress .Entry [entries .size ()]));
592599 return ClusterTasksResult .<UpdateIndexShardSnapshotStatusRequest >builder ().successes (tasks ).build (
593600 ClusterState .builder (currentState ).putCustom (SnapshotsInProgress .TYPE , updatedSnapshots ).build ());
594601 }
@@ -606,8 +613,8 @@ private class UpdateSnapshotStatusAction
606613 UpdateSnapshotStatusAction (TransportService transportService , ClusterService clusterService ,
607614 ThreadPool threadPool , ActionFilters actionFilters , IndexNameExpressionResolver indexNameExpressionResolver ) {
608615 super (
609- SnapshotShardsService .UPDATE_SNAPSHOT_STATUS_ACTION_NAME , transportService , clusterService , threadPool , actionFilters ,
610- indexNameExpressionResolver , UpdateIndexShardSnapshotStatusRequest ::new
616+ SnapshotShardsService .UPDATE_SNAPSHOT_STATUS_ACTION_NAME , transportService , clusterService , threadPool ,
617+ actionFilters , indexNameExpressionResolver , UpdateIndexShardSnapshotStatusRequest ::new
611618 );
612619 }
613620
@@ -622,7 +629,8 @@ protected UpdateIndexShardSnapshotStatusResponse newResponse() {
622629 }
623630
624631 @ Override
625- protected void masterOperation (UpdateIndexShardSnapshotStatusRequest request , ClusterState state , ActionListener <UpdateIndexShardSnapshotStatusResponse > listener ) throws Exception {
632+ protected void masterOperation (UpdateIndexShardSnapshotStatusRequest request , ClusterState state ,
633+ ActionListener <UpdateIndexShardSnapshotStatusResponse > listener ) throws Exception {
626634 innerUpdateSnapshotState (request , listener );
627635 }
628636
0 commit comments