@@ -59,62 +59,6 @@ public class EsqlCCSUtilsTests extends ESTestCase {
59
59
private final String REMOTE1_ALIAS = "remote1" ;
60
60
private final String REMOTE2_ALIAS = "remote2" ;
61
61
62
- public void testCreateIndexExpressionFromAvailableClusters () {
63
- var skipped = EsqlExecutionInfo .Cluster .Status .SKIPPED ;
64
- // no clusters marked as skipped
65
- {
66
- EsqlExecutionInfo executionInfo = new EsqlExecutionInfo (true );
67
- executionInfo .swapCluster (LOCAL_CLUSTER_ALIAS , (k , v ) -> new EsqlExecutionInfo .Cluster (LOCAL_CLUSTER_ALIAS , "logs*" , false ));
68
- executionInfo .swapCluster (REMOTE1_ALIAS , (k , v ) -> new EsqlExecutionInfo .Cluster (REMOTE1_ALIAS , "*" , true ));
69
- executionInfo .swapCluster (REMOTE2_ALIAS , (k , v ) -> new EsqlExecutionInfo .Cluster (REMOTE2_ALIAS , "mylogs1,mylogs2,logs*" , true ));
70
- assertIndexPattern (
71
- EsqlCCSUtils .createIndexExpressionFromAvailableClusters (executionInfo ),
72
- containsInAnyOrder ("logs*" , "remote1:*" , "remote2:mylogs1" , "remote2:mylogs2" , "remote2:logs*" )
73
- );
74
- }
75
-
76
- // one cluster marked as skipped, so not present in revised index expression
77
- {
78
- EsqlExecutionInfo executionInfo = new EsqlExecutionInfo (true );
79
- executionInfo .swapCluster (LOCAL_CLUSTER_ALIAS , (k , v ) -> new EsqlExecutionInfo .Cluster (LOCAL_CLUSTER_ALIAS , "logs*" , false ));
80
- executionInfo .swapCluster (REMOTE1_ALIAS , (k , v ) -> new EsqlExecutionInfo .Cluster (REMOTE1_ALIAS , "*,foo" , true ));
81
- executionInfo .swapCluster (
82
- REMOTE2_ALIAS ,
83
- (k , v ) -> new EsqlExecutionInfo .Cluster (REMOTE2_ALIAS , "mylogs1,mylogs2,logs*" , true , skipped )
84
- );
85
- assertIndexPattern (
86
- EsqlCCSUtils .createIndexExpressionFromAvailableClusters (executionInfo ),
87
- containsInAnyOrder ("logs*" , "remote1:*" , "remote1:foo" )
88
- );
89
- }
90
-
91
- // two clusters marked as skipped, so only local cluster present in revised index expression
92
- {
93
- EsqlExecutionInfo executionInfo = new EsqlExecutionInfo (true );
94
- executionInfo .swapCluster (LOCAL_CLUSTER_ALIAS , (k , v ) -> new EsqlExecutionInfo .Cluster (LOCAL_CLUSTER_ALIAS , "logs*" , false ));
95
- executionInfo .swapCluster (REMOTE1_ALIAS , (k , v ) -> new EsqlExecutionInfo .Cluster (REMOTE1_ALIAS , "*,foo" , true , skipped ));
96
- executionInfo .swapCluster (
97
- REMOTE2_ALIAS ,
98
- (k , v ) -> new EsqlExecutionInfo .Cluster (REMOTE2_ALIAS , "mylogs1,mylogs2,logs*" , true , skipped )
99
- );
100
- assertThat (EsqlCCSUtils .createIndexExpressionFromAvailableClusters (executionInfo ), equalTo ("logs*" ));
101
- }
102
-
103
- // only remotes present and all marked as skipped, so in revised index expression should be empty string
104
- {
105
- EsqlExecutionInfo executionInfo = new EsqlExecutionInfo (true );
106
- executionInfo .swapCluster (
107
- REMOTE1_ALIAS ,
108
- (k , v ) -> new EsqlExecutionInfo .Cluster (REMOTE1_ALIAS , "*,foo" , true , EsqlExecutionInfo .Cluster .Status .SKIPPED )
109
- );
110
- executionInfo .swapCluster (
111
- REMOTE2_ALIAS ,
112
- (k , v ) -> new EsqlExecutionInfo .Cluster (REMOTE2_ALIAS , "mylogs1,mylogs2,logs*" , true , skipped )
113
- );
114
- assertThat (EsqlCCSUtils .createIndexExpressionFromAvailableClusters (executionInfo ), equalTo ("" ));
115
- }
116
- }
117
-
118
62
public void testCreateQualifiedLookupIndexExpressionFromAvailableClusters () {
119
63
120
64
var skipped = EsqlExecutionInfo .Cluster .Status .SKIPPED ;
0 commit comments