@@ -152,7 +152,7 @@ public void testUpdateExecutionInfoWithUnavailableClusters() {
152
152
executionInfo .swapCluster (REMOTE2_ALIAS , (k , v ) -> new EsqlExecutionInfo .Cluster (REMOTE2_ALIAS , "mylogs1,mylogs2,logs*" , true ));
153
153
154
154
var failure = new FieldCapabilitiesFailure (new String [] { "logs-a" }, new NoSeedNodeLeftException ("unable to connect" ));
155
- var unvailableClusters = Map .of (REMOTE1_ALIAS , failure , REMOTE2_ALIAS , failure );
155
+ var unvailableClusters = Map .of (REMOTE1_ALIAS , List . of ( failure ) , REMOTE2_ALIAS , List . of ( failure ) );
156
156
EsqlCCSUtils .updateExecutionInfoWithUnavailableClusters (executionInfo , unvailableClusters );
157
157
158
158
assertThat (executionInfo .clusterAliases (), equalTo (Set .of (LOCAL_CLUSTER_ALIAS , REMOTE1_ALIAS , REMOTE2_ALIAS )));
@@ -184,7 +184,7 @@ public void testUpdateExecutionInfoWithUnavailableClusters() {
184
184
var failure = new FieldCapabilitiesFailure (new String [] { "logs-a" }, new NoSeedNodeLeftException ("unable to connect" ));
185
185
RemoteTransportException e = expectThrows (
186
186
RemoteTransportException .class ,
187
- () -> EsqlCCSUtils .updateExecutionInfoWithUnavailableClusters (executionInfo , Map .of (REMOTE2_ALIAS , failure ))
187
+ () -> EsqlCCSUtils .updateExecutionInfoWithUnavailableClusters (executionInfo , Map .of (REMOTE2_ALIAS , List . of ( failure ) ))
188
188
);
189
189
assertThat (e .status ().getStatus (), equalTo (500 ));
190
190
assertThat (
@@ -337,8 +337,8 @@ public void testUpdateExecutionInfoWithClustersWithNoMatchingIndices() {
337
337
);
338
338
// remote1 is unavailable
339
339
var failure = new FieldCapabilitiesFailure (new String [] { "logs-a" }, new NoSeedNodeLeftException ("unable to connect" ));
340
- var unavailableClusters = Map .of (REMOTE1_ALIAS , List .of (failure ));
341
- IndexResolution indexResolution = IndexResolution .valid (esIndex , esIndex .concreteIndices (), unavailableClusters );
340
+ var failures = Map .of (REMOTE1_ALIAS , List .of (failure ));
341
+ IndexResolution indexResolution = IndexResolution .valid (esIndex , esIndex .concreteIndices (), failures );
342
342
343
343
EsqlCCSUtils .updateExecutionInfoWithClustersWithNoMatchingIndices (executionInfo , indexResolution );
344
344
@@ -348,9 +348,8 @@ public void testUpdateExecutionInfoWithClustersWithNoMatchingIndices() {
348
348
349
349
EsqlExecutionInfo .Cluster remote1Cluster = executionInfo .getCluster (REMOTE1_ALIAS );
350
350
assertThat (remote1Cluster .getIndexExpression (), equalTo ("*" ));
351
- // since remote1 is in the unavailable Map (passed to IndexResolution.valid), it's status will not be changed
352
- // by updateExecutionInfoWithClustersWithNoMatchingIndices (it is handled in updateExecutionInfoWithUnavailableClusters)
353
- assertThat (remote1Cluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .RUNNING ));
351
+ // since remote1 is in the failures Map (passed to IndexResolution.valid),
352
+ assertThat (remote1Cluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
354
353
355
354
EsqlExecutionInfo .Cluster remote2Cluster = executionInfo .getCluster (REMOTE2_ALIAS );
356
355
assertThat (remote2Cluster .getIndexExpression (), equalTo ("mylogs1*,mylogs2*,logs*" ));
@@ -380,18 +379,17 @@ public void testUpdateExecutionInfoWithClustersWithNoMatchingIndices() {
380
379
);
381
380
382
381
var failure = new FieldCapabilitiesFailure (new String [] { "logs-a" }, new NoSeedNodeLeftException ("unable to connect" ));
383
- var unavailableClusters = Map .of (REMOTE1_ALIAS , List .of (failure ));
384
- IndexResolution indexResolution = IndexResolution .valid (esIndex , esIndex .concreteIndices (), unavailableClusters );
382
+ var failures = Map .of (REMOTE1_ALIAS , List .of (failure ));
383
+ IndexResolution indexResolution = IndexResolution .valid (esIndex , esIndex .concreteIndices (), failures );
385
384
EsqlCCSUtils .updateExecutionInfoWithClustersWithNoMatchingIndices (executionInfo , indexResolution );
386
385
387
386
EsqlExecutionInfo .Cluster localCluster = executionInfo .getCluster (LOCAL_CLUSTER_ALIAS );
388
387
assertThat (localCluster .getIndexExpression (), equalTo ("logs*" ));
389
388
assertClusterStatusAndShardCounts (localCluster , EsqlExecutionInfo .Cluster .Status .RUNNING );
390
389
391
390
EsqlExecutionInfo .Cluster remote1Cluster = executionInfo .getCluster (REMOTE1_ALIAS );
392
- // since remote1 is in the unavailable Map (passed to IndexResolution.valid), it's status will not be changed
393
- // by updateExecutionInfoWithClustersWithNoMatchingIndices (it is handled in updateExecutionInfoWithUnavailableClusters)
394
- assertThat (remote1Cluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .RUNNING ));
391
+ // skipped since remote1 is in the failures Map
392
+ assertThat (remote1Cluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
395
393
396
394
EsqlExecutionInfo .Cluster remote2Cluster = executionInfo .getCluster (REMOTE2_ALIAS );
397
395
assertThat (remote2Cluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
@@ -429,8 +427,8 @@ public void testUpdateExecutionInfoWithClustersWithNoMatchingIndices() {
429
427
430
428
// remote1 is unavailable
431
429
var failure = new FieldCapabilitiesFailure (new String [] { "logs-a" }, new NoSeedNodeLeftException ("unable to connect" ));
432
- var unavailableClusters = Map .of (REMOTE1_ALIAS , List .of (failure ));
433
- IndexResolution indexResolution = IndexResolution .valid (esIndex , esIndex .concreteIndices (), unavailableClusters );
430
+ var failures = Map .of (REMOTE1_ALIAS , List .of (failure ));
431
+ IndexResolution indexResolution = IndexResolution .valid (esIndex , esIndex .concreteIndices (), failures );
434
432
435
433
EsqlCCSUtils .updateExecutionInfoWithClustersWithNoMatchingIndices (executionInfo , indexResolution );
436
434
@@ -440,9 +438,8 @@ public void testUpdateExecutionInfoWithClustersWithNoMatchingIndices() {
440
438
441
439
EsqlExecutionInfo .Cluster remote1Cluster = executionInfo .getCluster (REMOTE1_ALIAS );
442
440
assertThat (remote1Cluster .getIndexExpression (), equalTo ("*" ));
443
- // since remote1 is in the unavailable Map (passed to IndexResolution.valid), it's status will not be changed
444
- // by updateExecutionInfoWithClustersWithNoMatchingIndices (it is handled in updateExecutionInfoWithUnavailableClusters)
445
- assertThat (remote1Cluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .RUNNING ));
441
+ // skipped since remote1 is in the failures Map
442
+ assertThat (remote1Cluster .getStatus (), equalTo (EsqlExecutionInfo .Cluster .Status .SKIPPED ));
446
443
447
444
EsqlExecutionInfo .Cluster remote2Cluster = executionInfo .getCluster (REMOTE2_ALIAS );
448
445
assertThat (remote2Cluster .getIndexExpression (), equalTo ("mylogs1*,mylogs2*,logs*" ));
0 commit comments