@@ -46,7 +46,7 @@ public class TestClustersPlugin implements Plugin<Project> {
4646
4747 @ Override
4848 public void apply (Project project ) {
49- NamedDomainObjectContainer <? extends ElasticsearchConfiguration > container = project .container (
49+ NamedDomainObjectContainer <? extends ElasticsearchNode > container = project .container (
5050 ElasticsearchNode .class ,
5151 (name ) -> new ElasticsearchNode (name , GradleServicesAdapter .getInstance (project ))
5252 );
@@ -56,12 +56,12 @@ public void apply(Project project) {
5656 listTask .setGroup ("ES cluster formation" );
5757 listTask .setDescription ("Lists all ES clusters configured for this project" );
5858 listTask .doLast ((Task task ) ->
59- container .forEach ((ElasticsearchConfiguration cluster ) ->
59+ container .forEach ((ElasticsearchNode cluster ) ->
6060 logger .lifecycle (" * {}: {}" , cluster .getName (), cluster .getDistribution ())
6161 )
6262 );
6363
64- Map <Task , List <ElasticsearchConfiguration >> taskToCluster = new HashMap <>();
64+ Map <Task , List <ElasticsearchNode >> taskToCluster = new HashMap <>();
6565
6666 // register an extension for all current and future tasks, so that any task can declare that it wants to use a
6767 // specific cluster.
@@ -70,7 +70,7 @@ public void apply(Project project) {
7070 .set (
7171 "useCluster" ,
7272 new Closure <Void >(this , this ) {
73- public void doCall (ElasticsearchConfiguration conf ) {
73+ public void doCall (ElasticsearchNode conf ) {
7474 taskToCluster .computeIfAbsent (task , k -> new ArrayList <>()).add (conf );
7575 }
7676 })
@@ -79,15 +79,15 @@ public void doCall(ElasticsearchConfiguration conf) {
7979 project .getGradle ().getTaskGraph ().whenReady (taskExecutionGraph ->
8080 taskExecutionGraph .getAllTasks ()
8181 .forEach (task ->
82- taskToCluster .getOrDefault (task , Collections .emptyList ()).forEach (ElasticsearchConfiguration ::claim )
82+ taskToCluster .getOrDefault (task , Collections .emptyList ()).forEach (ElasticsearchNode ::claim )
8383 )
8484 );
8585 project .getGradle ().addListener (
8686 new TaskActionListener () {
8787 @ Override
8888 public void beforeActions (Task task ) {
8989 // we only start the cluster before the actions, so we'll not start it if the task is up-to-date
90- taskToCluster .getOrDefault (task , new ArrayList <>()).forEach (ElasticsearchConfiguration ::start );
90+ taskToCluster .getOrDefault (task , new ArrayList <>()).forEach (ElasticsearchNode ::start );
9191 }
9292 @ Override
9393 public void afterActions (Task task ) {}
@@ -99,7 +99,7 @@ public void afterActions(Task task) {}
9999 public void afterExecute (Task task , TaskState state ) {
100100 // always un-claim the cluster, even if _this_ task is up-to-date, as others might not have been and caused the
101101 // cluster to start.
102- taskToCluster .getOrDefault (task , new ArrayList <>()).forEach (ElasticsearchConfiguration ::unClaimAndStop );
102+ taskToCluster .getOrDefault (task , new ArrayList <>()).forEach (ElasticsearchNode ::unClaimAndStop );
103103 }
104104 @ Override
105105 public void beforeExecute (Task task ) {}
0 commit comments