@@ -221,21 +221,21 @@ protected Response newResponse() {
221
221
@ Override
222
222
protected void masterOperation (
223
223
final Request request , final ClusterState state , final ActionListener <Response > listener ) throws Exception {
224
- if (ccrLicenseChecker .isCcrAllowed ()) {
225
- final String [] indices = new String []{request .getFollowRequest ().getLeaderIndex ()};
226
- final Map <String , List <String >> remoteClusterIndices = remoteClusterService .groupClusterIndices (indices , s -> false );
227
- if (remoteClusterIndices .containsKey (RemoteClusterAware .LOCAL_CLUSTER_GROUP_KEY )) {
228
- createFollowerIndexAndFollowLocalIndex (request , state , listener );
229
- } else {
230
- assert remoteClusterIndices .size () == 1 ;
231
- final Map .Entry <String , List <String >> entry = remoteClusterIndices .entrySet ().iterator ().next ();
232
- assert entry .getValue ().size () == 1 ;
233
- final String clusterAlias = entry .getKey ();
234
- final String leaderIndex = entry .getValue ().get (0 );
235
- createFollowerIndexAndFollowRemoteIndex (request , clusterAlias , leaderIndex , listener );
236
- }
237
- } else {
224
+ if (ccrLicenseChecker .isCcrAllowed () == false ) {
238
225
listener .onFailure (LicenseUtils .newComplianceException ("ccr" ));
226
+ return ;
227
+ }
228
+ final String [] indices = new String []{request .getFollowRequest ().getLeaderIndex ()};
229
+ final Map <String , List <String >> remoteClusterIndices = remoteClusterService .groupClusterIndices (indices , s -> false );
230
+ if (remoteClusterIndices .containsKey (RemoteClusterAware .LOCAL_CLUSTER_GROUP_KEY )) {
231
+ createFollowerIndexAndFollowLocalIndex (request , state , listener );
232
+ } else {
233
+ assert remoteClusterIndices .size () == 1 ;
234
+ final Map .Entry <String , List <String >> entry = remoteClusterIndices .entrySet ().iterator ().next ();
235
+ assert entry .getValue ().size () == 1 ;
236
+ final String clusterAlias = entry .getKey ();
237
+ final String leaderIndex = entry .getValue ().get (0 );
238
+ createFollowerIndexAndFollowRemoteIndex (request , clusterAlias , leaderIndex , listener );
239
239
}
240
240
}
241
241
0 commit comments