@@ -213,10 +213,8 @@ public void testClusterHealth() throws IOException {
213
213
.routingTable (routingTable .build ())
214
214
.nodes (clusterService .state ().nodes ())
215
215
.build ();
216
- String [] concreteIndices = indexNameExpressionResolver .concreteIndexNames (
217
- clusterState ,
218
- IndicesOptions .strictExpand (),
219
- (String []) null
216
+ Set <String > concreteIndices = Set .of (
217
+ indexNameExpressionResolver .concreteIndexNames (clusterState , IndicesOptions .strictExpand (), (String []) null )
220
218
);
221
219
ClusterStateHealth clusterStateHealth = new ClusterStateHealth (clusterState , concreteIndices );
222
220
logger .info ("cluster status: {}, expected {}" , clusterStateHealth .getStatus (), counter .status ());
@@ -230,7 +228,7 @@ public void testClusterHealth() throws IOException {
230
228
231
229
public void testClusterHealthOnIndexCreation () {
232
230
final String indexName = "test-idx" ;
233
- final String [] indices = new String [] { indexName } ;
231
+ final Set < String > indices = Set . of ( indexName ) ;
234
232
final List <ClusterState > clusterStates = simulateIndexCreationStates (indexName , false );
235
233
for (int i = 0 ; i < clusterStates .size (); i ++) {
236
234
// make sure cluster health is always YELLOW, up until the last state where it should be GREEN
@@ -246,7 +244,7 @@ public void testClusterHealthOnIndexCreation() {
246
244
247
245
public void testClusterHealthOnIndexCreationWithFailedAllocations () {
248
246
final String indexName = "test-idx" ;
249
- final String [] indices = new String [] { indexName } ;
247
+ final Set < String > indices = Set . of ( indexName ) ;
250
248
final List <ClusterState > clusterStates = simulateIndexCreationStates (indexName , true );
251
249
for (int i = 0 ; i < clusterStates .size (); i ++) {
252
250
// make sure cluster health is YELLOW up until the final cluster state, which contains primary shard
@@ -263,7 +261,7 @@ public void testClusterHealthOnIndexCreationWithFailedAllocations() {
263
261
264
262
public void testClusterHealthOnClusterRecovery () {
265
263
final String indexName = "test-idx" ;
266
- final String [] indices = new String [] { indexName } ;
264
+ final Set < String > indices = Set . of ( indexName ) ;
267
265
final List <ClusterState > clusterStates = simulateClusterRecoveryStates (indexName , false , false );
268
266
for (int i = 0 ; i < clusterStates .size (); i ++) {
269
267
// make sure cluster health is YELLOW up until the final cluster state, when it turns GREEN
@@ -279,7 +277,7 @@ public void testClusterHealthOnClusterRecovery() {
279
277
280
278
public void testClusterHealthOnClusterRecoveryWithFailures () {
281
279
final String indexName = "test-idx" ;
282
- final String [] indices = new String [] { indexName } ;
280
+ final Set < String > indices = Set . of ( indexName ) ;
283
281
final List <ClusterState > clusterStates = simulateClusterRecoveryStates (indexName , false , true );
284
282
for (int i = 0 ; i < clusterStates .size (); i ++) {
285
283
// make sure cluster health is YELLOW up until the final cluster state, which contains primary shard
@@ -296,7 +294,7 @@ public void testClusterHealthOnClusterRecoveryWithFailures() {
296
294
297
295
public void testClusterHealthOnClusterRecoveryWithPreviousAllocationIds () {
298
296
final String indexName = "test-idx" ;
299
- final String [] indices = new String [] { indexName } ;
297
+ final Set < String > indices = Set . of ( indexName ) ;
300
298
final List <ClusterState > clusterStates = simulateClusterRecoveryStates (indexName , true , false );
301
299
for (int i = 0 ; i < clusterStates .size (); i ++) {
302
300
// because there were previous allocation ids, we should be RED until the primaries are started,
@@ -319,7 +317,7 @@ public void testClusterHealthOnClusterRecoveryWithPreviousAllocationIds() {
319
317
320
318
public void testClusterHealthOnClusterRecoveryWithPreviousAllocationIdsAndAllocationFailures () {
321
319
final String indexName = "test-idx" ;
322
- final String [] indices = new String [] { indexName } ;
320
+ final Set < String > indices = Set . of ( indexName ) ;
323
321
for (final ClusterState clusterState : simulateClusterRecoveryStates (indexName , true , true )) {
324
322
final ClusterStateHealth health = new ClusterStateHealth (clusterState , indices );
325
323
// if the inactive primaries are due solely to recovery (not failed allocation or previously being allocated)
0 commit comments