4040import static org .elasticsearch .xpack .TimeSeriesRestDriver .createNewSingletonPolicy ;
4141import static org .elasticsearch .xpack .TimeSeriesRestDriver .createSnapshotRepo ;
4242import static org .elasticsearch .xpack .TimeSeriesRestDriver .explainIndex ;
43- import static org .elasticsearch .xpack .TimeSeriesRestDriver .getBackingIndices ;
4443import static org .elasticsearch .xpack .TimeSeriesRestDriver .getOnlyIndexSettings ;
4544import static org .elasticsearch .xpack .TimeSeriesRestDriver .getStepKeyForIndex ;
4645import static org .elasticsearch .xpack .TimeSeriesRestDriver .getTemplate ;
@@ -81,12 +80,12 @@ public void testRolloverAction() throws Exception {
8180 indexDocument (client (), dataStream , true );
8281
8382 assertBusy (() -> {
84- final var backingIndices = getBackingIndices ( client (), dataStream );
83+ final var backingIndices = getDataStreamBackingIndexNames ( dataStream );
8584 assertEquals (2 , backingIndices .size ());
8685 assertTrue (Boolean .parseBoolean ((String ) getIndexSettingsAsMap (backingIndices .getLast ()).get ("index.hidden" )));
8786 });
8887 assertBusy (() -> {
89- final var backingIndices = getBackingIndices ( client (), dataStream );
88+ final var backingIndices = getDataStreamBackingIndexNames ( dataStream );
9089 assertEquals (PhaseCompleteStep .finalStep ("hot" ).getKey (), getStepKeyForIndex (client (), backingIndices .getFirst ()));
9190 });
9291 }
@@ -98,7 +97,7 @@ public void testRolloverIsSkippedOnManualDataStreamRollover() throws Exception {
9897
9998 indexDocument (client (), dataStream , true );
10099
101- String firstGenerationIndex = getBackingIndices ( client (), dataStream ).getFirst ();
100+ String firstGenerationIndex = getDataStreamBackingIndexNames ( dataStream ).getFirst ();
102101 assertBusy (
103102 () -> assertThat (getStepKeyForIndex (client (), firstGenerationIndex ).name (), equalTo (WaitForRolloverReadyStep .NAME )),
104103 30 ,
@@ -107,7 +106,7 @@ public void testRolloverIsSkippedOnManualDataStreamRollover() throws Exception {
107106
108107 rolloverMaxOneDocCondition (client (), dataStream );
109108 assertBusy (() -> {
110- final var backingIndices = getBackingIndices ( client (), dataStream );
109+ final var backingIndices = getDataStreamBackingIndexNames ( dataStream );
111110 assertEquals (2 , backingIndices .size ());
112111 }, 30 , TimeUnit .SECONDS );
113112
@@ -125,7 +124,7 @@ public void testShrinkActionInPolicyWithoutHotPhase() throws Exception {
125124 createComposableTemplate (client (), template , dataStream + "*" , getTemplate (policyName ));
126125 indexDocument (client (), dataStream , true );
127126
128- String backingIndexName = getBackingIndices ( client (), dataStream ).getFirst ();
127+ String backingIndexName = getDataStreamBackingIndexNames ( dataStream ).getFirst ();
129128 assertBusy (
130129 () -> assertThat (
131130 "original index must wait in the " + CheckNotDataStreamWriteIndexStep .NAME + " until it is not the write index anymore" ,
@@ -140,7 +139,7 @@ public void testShrinkActionInPolicyWithoutHotPhase() throws Exception {
140139 rolloverMaxOneDocCondition (client (), dataStream );
141140 // Wait for rollover to happen
142141 assertBusy (
143- () -> assertEquals ("the rollover action created the rollover index" , 2 , getBackingIndices ( client (), dataStream ).size ()),
142+ () -> assertEquals ("the rollover action created the rollover index" , 2 , getDataStreamBackingIndexNames ( dataStream ).size ()),
144143 30 ,
145144 TimeUnit .SECONDS
146145 );
@@ -159,7 +158,7 @@ public void testSearchableSnapshotAction() throws Exception {
159158 createComposableTemplate (client (), template , dataStream + "*" , getTemplate (policyName ));
160159 indexDocument (client (), dataStream , true );
161160
162- String backingIndexName = getBackingIndices ( client (), dataStream ).getFirst ();
161+ String backingIndexName = getDataStreamBackingIndexNames ( dataStream ).getFirst ();
163162 String restoredIndexName = SearchableSnapshotAction .FULL_RESTORED_INDEX_PREFIX + backingIndexName ;
164163
165164 assertBusy (
@@ -190,7 +189,7 @@ public void testReadOnlyAction() throws Exception {
190189 createComposableTemplate (client (), template , dataStream + "*" , getTemplate (policyName ));
191190 indexDocument (client (), dataStream , true );
192191
193- String backingIndexName = getBackingIndices ( client (), dataStream ).getFirst ();
192+ String backingIndexName = getDataStreamBackingIndexNames ( dataStream ).getFirst ();
194193 assertBusy (
195194 () -> assertThat (
196195 "index must wait in the " + CheckNotDataStreamWriteIndexStep .NAME + " until it is not the write index anymore" ,
@@ -225,7 +224,7 @@ public void testFreezeAction() throws Exception {
225224 indexDocument (client (), dataStream , true );
226225
227226 // The freeze action is a noop action with only noop steps and should pass through to complete the phase asap.
228- String backingIndexName = getBackingIndices ( client (), dataStream ).getFirst ();
227+ String backingIndexName = getDataStreamBackingIndexNames ( dataStream ).getFirst ();
229228 assertBusy (() -> {
230229 try {
231230 assertThat (explainIndex (client (), backingIndexName ).get ("step" ), is (PhaseCompleteStep .NAME ));
@@ -247,7 +246,7 @@ public void checkForceMergeAction(String codec) throws Exception {
247246 createComposableTemplate (client (), template , dataStream + "*" , getTemplate (policyName ));
248247 indexDocument (client (), dataStream , true );
249248
250- String backingIndexName = getBackingIndices ( client (), dataStream ).getFirst ();
249+ String backingIndexName = getDataStreamBackingIndexNames ( dataStream ).getFirst ();
251250 assertBusy (
252251 () -> assertThat (
253252 "index must wait in the " + CheckNotDataStreamWriteIndexStep .NAME + " until it is not the write index anymore" ,
@@ -321,7 +320,7 @@ public void testDataStreamWithMultipleIndicesAndWriteIndexInDeletePhase() throws
321320 client ().performRequest (new Request ("POST" , dataStream + "/_rollover" ));
322321 indexDocument (client (), dataStream , true );
323322
324- String secondGenerationIndex = getBackingIndices ( client (), dataStream ).get (1 );
323+ String secondGenerationIndex = getDataStreamBackingIndexNames ( dataStream ).get (1 );
325324 assertBusy (() -> {
326325 Request explainRequest = new Request ("GET" , "/_data_stream/" + dataStream );
327326 Response response = client ().performRequest (explainRequest );
0 commit comments