@@ -86,7 +86,7 @@ public void testAutoFollower() {
86
86
ClusterState remoteState = createRemoteClusterState ("logs-20190101" , true );
87
87
88
88
AutoFollowPattern autoFollowPattern = new AutoFollowPattern ("remote" , Collections .singletonList ("logs-*" ),
89
- null , null , null , null , null , null , null , null , null , null , null );
89
+ null , true , null , null , null , null , null , null , null , null , null , null );
90
90
Map <String , AutoFollowPattern > patterns = new HashMap <>();
91
91
patterns .put ("remote" , autoFollowPattern );
92
92
Map <String , List <String >> followedLeaderIndexUUIDS = new HashMap <>();
@@ -155,7 +155,7 @@ public void testAutoFollowerClusterStateApiFailure() {
155
155
when (client .getRemoteClusterClient (anyString ())).thenReturn (client );
156
156
157
157
AutoFollowPattern autoFollowPattern = new AutoFollowPattern ("remote" , Collections .singletonList ("logs-*" ),
158
- null , null , null , null , null , null , null , null , null , null , null );
158
+ null , true , null , null , null , null , null , null , null , null , null , null );
159
159
Map <String , AutoFollowPattern > patterns = new HashMap <>();
160
160
patterns .put ("remote" , autoFollowPattern );
161
161
Map <String , List <String >> followedLeaderIndexUUIDS = new HashMap <>();
@@ -207,7 +207,7 @@ public void testAutoFollowerUpdateClusterStateFailure() {
207
207
ClusterState remoteState = createRemoteClusterState ("logs-20190101" , true );
208
208
209
209
AutoFollowPattern autoFollowPattern = new AutoFollowPattern ("remote" , Collections .singletonList ("logs-*" ),
210
- null , null , null , null , null , null , null , null , null , null , null );
210
+ null , true , null , null , null , null , null , null , null , null , null , null );
211
211
Map <String , AutoFollowPattern > patterns = new HashMap <>();
212
212
patterns .put ("remote" , autoFollowPattern );
213
213
Map <String , List <String >> followedLeaderIndexUUIDS = new HashMap <>();
@@ -483,7 +483,7 @@ public void testAutoFollowerCreateAndFollowApiCallFailure() {
483
483
ClusterState remoteState = createRemoteClusterState ("logs-20190101" , true );
484
484
485
485
AutoFollowPattern autoFollowPattern = new AutoFollowPattern ("remote" , Collections .singletonList ("logs-*" ),
486
- null , null , null , null , null , null , null , null , null , null , null );
486
+ null , true , null , null , null , null , null , null , null , null , null , null );
487
487
Map <String , AutoFollowPattern > patterns = new HashMap <>();
488
488
patterns .put ("remote" , autoFollowPattern );
489
489
Map <String , List <String >> followedLeaderIndexUUIDS = new HashMap <>();
@@ -608,7 +608,7 @@ public void testGetLeaderIndicesToFollow() {
608
608
609
609
public void testGetLeaderIndicesToFollow_shardsNotStarted () {
610
610
AutoFollowPattern autoFollowPattern = new AutoFollowPattern ("remote" , Collections .singletonList ("*" ),
611
- null , null , null , null , null , null , null , null , null , null , null );
611
+ null , true , null , null , null , null , null , null , null , null , null , null );
612
612
613
613
// 1 shard started and another not started:
614
614
ClusterState remoteState = createRemoteClusterState ("index1" , true );
@@ -755,15 +755,15 @@ public void testCleanFollowedLeaderIndicesNoEntry() {
755
755
}
756
756
757
757
public void testGetFollowerIndexName () {
758
- AutoFollowPattern autoFollowPattern = new AutoFollowPattern ("remote" , Collections .singletonList ("metrics-*" ), null , null ,
758
+ AutoFollowPattern autoFollowPattern = new AutoFollowPattern ("remote" , Collections .singletonList ("metrics-*" ), null , true , null ,
759
759
null , null , null , null , null , null , null , null , null );
760
760
assertThat (AutoFollower .getFollowerIndexName (autoFollowPattern , "metrics-0" ), equalTo ("metrics-0" ));
761
761
762
- autoFollowPattern = new AutoFollowPattern ("remote" , Collections .singletonList ("metrics-*" ), "eu-metrics-0" , null , null ,
762
+ autoFollowPattern = new AutoFollowPattern ("remote" , Collections .singletonList ("metrics-*" ), "eu-metrics-0" , true , null , null ,
763
763
null , null , null , null , null , null , null , null );
764
764
assertThat (AutoFollower .getFollowerIndexName (autoFollowPattern , "metrics-0" ), equalTo ("eu-metrics-0" ));
765
765
766
- autoFollowPattern = new AutoFollowPattern ("remote" , Collections .singletonList ("metrics-*" ), "eu-{{leader_index}}" , null ,
766
+ autoFollowPattern = new AutoFollowPattern ("remote" , Collections .singletonList ("metrics-*" ), "eu-{{leader_index}}" , true , null ,
767
767
null , null , null , null , null , null , null , null , null );
768
768
assertThat (AutoFollower .getFollowerIndexName (autoFollowPattern , "metrics-0" ), equalTo ("eu-metrics-0" ));
769
769
}
@@ -846,11 +846,11 @@ public void testUpdateAutoFollowers() {
846
846
Runnable ::run );
847
847
// Add 3 patterns:
848
848
Map <String , AutoFollowPattern > patterns = new HashMap <>();
849
- patterns .put ("pattern1" , new AutoFollowPattern ("remote1" , Collections .singletonList ("logs-*" ), null , null , null ,
849
+ patterns .put ("pattern1" , new AutoFollowPattern ("remote1" , Collections .singletonList ("logs-*" ), null , true , null , null ,
850
850
null , null , null , null , null , null , null , null ));
851
- patterns .put ("pattern2" , new AutoFollowPattern ("remote2" , Collections .singletonList ("logs-*" ), null , null , null ,
851
+ patterns .put ("pattern2" , new AutoFollowPattern ("remote2" , Collections .singletonList ("logs-*" ), null , true , null , null ,
852
852
null , null , null , null , null , null , null , null ));
853
- patterns .put ("pattern3" , new AutoFollowPattern ("remote2" , Collections .singletonList ("metrics-*" ), null , null , null ,
853
+ patterns .put ("pattern3" , new AutoFollowPattern ("remote2" , Collections .singletonList ("metrics-*" ), null , true , null , null ,
854
854
null , null , null , null , null , null , null , null ));
855
855
ClusterState clusterState = ClusterState .builder (new ClusterName ("remote" ))
856
856
.metaData (MetaData .builder ().putCustom (AutoFollowMetadata .TYPE ,
@@ -876,7 +876,7 @@ public void testUpdateAutoFollowers() {
876
876
assertThat (autoFollowCoordinator .getStats ().getAutoFollowedClusters ().get ("remote2" ), notNullValue ());
877
877
assertThat (removedAutoFollower1 .removed , is (true ));
878
878
// Add pattern 4:
879
- patterns .put ("pattern4" , new AutoFollowPattern ("remote1" , Collections .singletonList ("metrics-*" ), null , null , null ,
879
+ patterns .put ("pattern4" , new AutoFollowPattern ("remote1" , Collections .singletonList ("metrics-*" ), null , true , null , null ,
880
880
null , null , null , null , null , null , null , null ));
881
881
clusterState = ClusterState .builder (new ClusterName ("remote" ))
882
882
.metaData (MetaData .builder ().putCustom (AutoFollowMetadata .TYPE ,
@@ -1029,7 +1029,7 @@ public void testWaitForMetadataVersion() {
1029
1029
when (client .getRemoteClusterClient (anyString ())).thenReturn (client );
1030
1030
1031
1031
AutoFollowPattern autoFollowPattern = new AutoFollowPattern ("remote" , Collections .singletonList ("logs-*" ),
1032
- null , null , null , null , null , null , null , null , null , null , null );
1032
+ null , true , null , null , null , null , null , null , null , null , null , null );
1033
1033
Map <String , AutoFollowPattern > patterns = new HashMap <>();
1034
1034
patterns .put ("remote" , autoFollowPattern );
1035
1035
Map <String , List <String >> followedLeaderIndexUUIDS = new HashMap <>();
@@ -1092,7 +1092,7 @@ public void testWaitForTimeOut() {
1092
1092
when (client .getRemoteClusterClient (anyString ())).thenReturn (client );
1093
1093
1094
1094
AutoFollowPattern autoFollowPattern = new AutoFollowPattern ("remote" , Collections .singletonList ("logs-*" ),
1095
- null , null , null , null , null , null , null , null , null , null , null );
1095
+ null , true , null , null , null , null , null , null , null , null , null , null );
1096
1096
Map <String , AutoFollowPattern > patterns = new HashMap <>();
1097
1097
patterns .put ("remote" , autoFollowPattern );
1098
1098
Map <String , List <String >> followedLeaderIndexUUIDS = new HashMap <>();
@@ -1150,7 +1150,7 @@ public void testAutoFollowerSoftDeletesDisabled() {
1150
1150
ClusterState remoteState = createRemoteClusterState ("logs-20190101" , false );
1151
1151
1152
1152
AutoFollowPattern autoFollowPattern = new AutoFollowPattern ("remote" , Collections .singletonList ("logs-*" ),
1153
- null , null , null , null , null , null , null , null , null , null , null );
1153
+ null , true , null , null , null , null , null , null , null , null , null , null );
1154
1154
Map <String , AutoFollowPattern > patterns = new HashMap <>();
1155
1155
patterns .put ("remote" , autoFollowPattern );
1156
1156
Map <String , List <String >> followedLeaderIndexUUIDS = new HashMap <>();
@@ -1216,7 +1216,7 @@ public void testAutoFollowerFollowerIndexAlreadyExists() {
1216
1216
ClusterState remoteState = createRemoteClusterState ("logs-20190101" , true );
1217
1217
1218
1218
AutoFollowPattern autoFollowPattern = new AutoFollowPattern ("remote" , Collections .singletonList ("logs-*" ),
1219
- null , null , null , null , null , null , null , null , null , null , null );
1219
+ null , true , null , null , null , null , null , null , null , null , null , null );
1220
1220
Map <String , AutoFollowPattern > patterns = new HashMap <>();
1221
1221
patterns .put ("remote" , autoFollowPattern );
1222
1222
Map <String , List <String >> followedLeaderIndexUUIDS = new HashMap <>();
@@ -1302,7 +1302,7 @@ public void testRepeatedFailures() throws InterruptedException {
1302
1302
"remote" ,
1303
1303
List .of ("*" ),
1304
1304
"{}" ,
1305
- 0 ,
1305
+ true , 0 ,
1306
1306
0 ,
1307
1307
0 ,
1308
1308
0 ,
0 commit comments