11
11
import org .elasticsearch .cluster .ClusterState ;
12
12
import org .elasticsearch .cluster .metadata .IndexMetadata ;
13
13
import org .elasticsearch .cluster .metadata .Metadata ;
14
- import org .elasticsearch .common .TriConsumer ;
15
14
import org .elasticsearch .index .IndexVersion ;
16
15
import org .elasticsearch .xpack .core .ilm .Step .StepKey ;
17
16
18
17
import java .util .concurrent .CountDownLatch ;
19
18
import java .util .concurrent .TimeUnit ;
19
+ import java .util .function .BiConsumer ;
20
20
21
21
import static org .hamcrest .Matchers .equalTo ;
22
22
@@ -34,15 +34,15 @@ public void testPredicateNextStepChange() throws InterruptedException {
34
34
StepKey nextStepKey = new StepKey (randomAlphaOfLength (6 ), randomAlphaOfLength (6 ), BranchingStep .NAME );
35
35
StepKey nextSkipKey = new StepKey (randomAlphaOfLength (7 ), randomAlphaOfLength (7 ), BranchingStep .NAME );
36
36
{
37
- AsyncBranchingStep step = new AsyncBranchingStep (stepKey , nextStepKey , nextSkipKey , (i , c , l ) -> l .onResponse (true ), client );
37
+ AsyncBranchingStep step = new AsyncBranchingStep (stepKey , nextStepKey , nextSkipKey , (i , l ) -> l .onResponse (true ), client );
38
38
expectThrows (IllegalStateException .class , step ::getNextStepKey );
39
39
CountDownLatch latch = new CountDownLatch (1 );
40
40
step .performAction (state .metadata ().getProject ().index (indexName ), state , null , new Listener (latch ));
41
41
assertTrue (latch .await (5 , TimeUnit .SECONDS ));
42
42
assertThat (step .getNextStepKey (), equalTo (step .getNextStepKeyOnTrue ()));
43
43
}
44
44
{
45
- AsyncBranchingStep step = new AsyncBranchingStep (stepKey , nextStepKey , nextSkipKey , (i , c , l ) -> l .onResponse (false ), client );
45
+ AsyncBranchingStep step = new AsyncBranchingStep (stepKey , nextStepKey , nextSkipKey , (i , l ) -> l .onResponse (false ), client );
46
46
expectThrows (IllegalStateException .class , step ::getNextStepKey );
47
47
CountDownLatch latch = new CountDownLatch (1 );
48
48
step .performAction (state .metadata ().getProject ().index (indexName ), state , null , new Listener (latch ));
@@ -56,15 +56,15 @@ public AsyncBranchingStep createRandomInstance() {
56
56
StepKey stepKey = new StepKey (randomAlphaOfLength (5 ), randomAlphaOfLength (5 ), BranchingStep .NAME );
57
57
StepKey nextStepKey = new StepKey (randomAlphaOfLength (6 ), randomAlphaOfLength (6 ), BranchingStep .NAME );
58
58
StepKey nextSkipKey = new StepKey (randomAlphaOfLength (7 ), randomAlphaOfLength (7 ), BranchingStep .NAME );
59
- return new AsyncBranchingStep (stepKey , nextStepKey , nextSkipKey , (i , c , l ) -> l .onResponse (randomBoolean ()), client );
59
+ return new AsyncBranchingStep (stepKey , nextStepKey , nextSkipKey , (i , l ) -> l .onResponse (randomBoolean ()), client );
60
60
}
61
61
62
62
@ Override
63
63
public AsyncBranchingStep mutateInstance (AsyncBranchingStep instance ) {
64
64
StepKey key = instance .getKey ();
65
65
StepKey nextStepKey = instance .getNextStepKeyOnFalse ();
66
66
StepKey nextSkipStepKey = instance .getNextStepKeyOnTrue ();
67
- TriConsumer <IndexMetadata , ClusterState , ActionListener <Boolean >> asyncPredicate = instance .getAsyncPredicate ();
67
+ BiConsumer <IndexMetadata , ActionListener <Boolean >> asyncPredicate = instance .getAsyncPredicate ();
68
68
69
69
switch (between (0 , 2 )) {
70
70
case 0 -> key = new StepKey (key .phase (), key .action (), key .name () + randomAlphaOfLength (5 ));
0 commit comments