@@ -71,8 +71,8 @@ public ShardStateAction(Settings settings, ClusterService clusterService, Transp
7171 super (settings );
7272 this .transportService = transportService ;
7373
74- transportService .registerRequestHandler (SHARD_STARTED_ACTION_NAME , ShardRoutingEntry ::new , ThreadPool .Names .SAME , new ShardStartedTransportHandler (clusterService , new ShardStartedClusterStateHandler (allocationService , logger ), logger ));
75- transportService .registerRequestHandler (SHARD_FAILED_ACTION_NAME , ShardRoutingEntry ::new , ThreadPool .Names .SAME , new ShardFailedTransportHandler (clusterService , new ShardFailedClusterStateHandler (allocationService , routingService , logger ), logger ));
74+ transportService .registerRequestHandler (SHARD_STARTED_ACTION_NAME , ShardRoutingEntry ::new , ThreadPool .Names .SAME , new ShardStartedTransportHandler (clusterService , new ShardStartedClusterStateTaskExecutor (allocationService , logger ), logger ));
75+ transportService .registerRequestHandler (SHARD_FAILED_ACTION_NAME , ShardRoutingEntry ::new , ThreadPool .Names .SAME , new ShardFailedTransportHandler (clusterService , new ShardFailedClusterStateTaskExecutor (allocationService , routingService , logger ), logger ));
7676 }
7777
7878 public void shardFailed (final ClusterState clusterState , final ShardRouting shardRouting , final String indexUUID , final String message , @ Nullable final Throwable failure , Listener listener ) {
@@ -113,12 +113,12 @@ public void handleException(TransportException exp) {
113113
114114 private static class ShardFailedTransportHandler implements TransportRequestHandler <ShardRoutingEntry > {
115115 private final ClusterService clusterService ;
116- private final ShardFailedClusterStateHandler shardFailedClusterStateHandler ;
116+ private final ShardFailedClusterStateTaskExecutor shardFailedClusterStateTaskExecutor ;
117117 private final ESLogger logger ;
118118
119- public ShardFailedTransportHandler (ClusterService clusterService , ShardFailedClusterStateHandler shardFailedClusterStateHandler , ESLogger logger ) {
119+ public ShardFailedTransportHandler (ClusterService clusterService , ShardFailedClusterStateTaskExecutor shardFailedClusterStateTaskExecutor , ESLogger logger ) {
120120 this .clusterService = clusterService ;
121- this .shardFailedClusterStateHandler = shardFailedClusterStateHandler ;
121+ this .shardFailedClusterStateTaskExecutor = shardFailedClusterStateTaskExecutor ;
122122 this .logger = logger ;
123123 }
124124
@@ -129,7 +129,7 @@ public void messageReceived(ShardRoutingEntry request, TransportChannel channel)
129129 "shard-failed (" + request .shardRouting + "), message [" + request .message + "]" ,
130130 request ,
131131 ClusterStateTaskConfig .build (Priority .HIGH ),
132- shardFailedClusterStateHandler ,
132+ shardFailedClusterStateTaskExecutor ,
133133 new ClusterStateTaskListener () {
134134 @ Override
135135 public void onFailure (String source , Throwable t ) {
@@ -164,12 +164,12 @@ public void clusterStateProcessed(String source, ClusterState oldState, ClusterS
164164 }
165165 }
166166
167- private static class ShardFailedClusterStateHandler implements ClusterStateTaskExecutor <ShardRoutingEntry > {
167+ private static class ShardFailedClusterStateTaskExecutor implements ClusterStateTaskExecutor <ShardRoutingEntry > {
168168 private final AllocationService allocationService ;
169169 private final RoutingService routingService ;
170170 private final ESLogger logger ;
171171
172- public ShardFailedClusterStateHandler (AllocationService allocationService , RoutingService routingService , ESLogger logger ) {
172+ public ShardFailedClusterStateTaskExecutor (AllocationService allocationService , RoutingService routingService , ESLogger logger ) {
173173 this .allocationService = allocationService ;
174174 this .routingService = routingService ;
175175 this .logger = logger ;
@@ -227,12 +227,12 @@ public void handleException(TransportException exp) {
227227
228228 private static class ShardStartedTransportHandler implements TransportRequestHandler <ShardRoutingEntry > {
229229 private final ClusterService clusterService ;
230- private final ShardStartedClusterStateHandler shardStartedClusterStateHandler ;
230+ private final ShardStartedClusterStateTaskExecutor shardStartedClusterStateTaskExecutor ;
231231 private final ESLogger logger ;
232232
233- public ShardStartedTransportHandler (ClusterService clusterService , ShardStartedClusterStateHandler shardStartedClusterStateHandler , ESLogger logger ) {
233+ public ShardStartedTransportHandler (ClusterService clusterService , ShardStartedClusterStateTaskExecutor shardStartedClusterStateTaskExecutor , ESLogger logger ) {
234234 this .clusterService = clusterService ;
235- this .shardStartedClusterStateHandler = shardStartedClusterStateHandler ;
235+ this .shardStartedClusterStateTaskExecutor = shardStartedClusterStateTaskExecutor ;
236236 this .logger = logger ;
237237 }
238238
@@ -243,17 +243,17 @@ public void messageReceived(ShardRoutingEntry request, TransportChannel channel)
243243 "shard-started (" + request .shardRouting + "), reason [" + request .message + "]" ,
244244 request ,
245245 ClusterStateTaskConfig .build (Priority .URGENT ),
246- shardStartedClusterStateHandler ,
247- shardStartedClusterStateHandler );
246+ shardStartedClusterStateTaskExecutor ,
247+ shardStartedClusterStateTaskExecutor );
248248 channel .sendResponse (TransportResponse .Empty .INSTANCE );
249249 }
250250 }
251251
252- private static class ShardStartedClusterStateHandler implements ClusterStateTaskExecutor <ShardRoutingEntry >, ClusterStateTaskListener {
252+ private static class ShardStartedClusterStateTaskExecutor implements ClusterStateTaskExecutor <ShardRoutingEntry >, ClusterStateTaskListener {
253253 private final AllocationService allocationService ;
254254 private final ESLogger logger ;
255255
256- public ShardStartedClusterStateHandler (AllocationService allocationService , ESLogger logger ) {
256+ public ShardStartedClusterStateTaskExecutor (AllocationService allocationService , ESLogger logger ) {
257257 this .allocationService = allocationService ;
258258 this .logger = logger ;
259259 }
0 commit comments