Skip to content

Commit

Permalink
Revert "Better support for multi cluster for run task (elastic#89442)"
Browse files Browse the repository at this point in the history
This reverts commit 20ed7e3.
  • Loading branch information
jakelandis committed Aug 24, 2022
1 parent a7da2a2 commit 293e463
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 100 deletions.
60 changes: 0 additions & 60 deletions build-tools-internal/src/main/groovy/elasticsearch.run-ccs.gradle

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,12 @@ public class RunTask extends DefaultTestClustersTask {

private Boolean debug = false;

private Boolean initOnly = false;

private Boolean preserveData = false;

private Path dataDir = null;

private String keystorePassword = "";

private Integer offset = 0;

@Option(option = "debug-jvm", description = "Enable debugging configuration, to allow attaching a debugger to elasticsearch.")
public void setDebug(boolean enabled) {
this.debug = enabled;
Expand Down Expand Up @@ -90,36 +86,10 @@ public String getDataDir() {
return dataDir.toString();
}

@Input
@Optional
Boolean getInitOnly() {
return initOnly;
}

/**
* Only initialize, but don't actually run. This is useful for multi-cluster run tasks.
*/
public void setInitOnly(Boolean initOnly) {
this.initOnly = initOnly;
}

@Input
@Optional
public Integer getPortOffset() {
return offset;
}

/**
* Manually increase the port offset. This is useful for multi-cluster run tasks.
*/
public void setPortOffset(Integer offset) {
this.offset = offset;
}

@Override
public void beforeStart() {
int httpPort = 9200 + offset;
int transportPort = 9300 + offset;
int httpPort = 9200;
int transportPort = 9300;
Map<String, String> additionalSettings = System.getProperties()
.entrySet()
.stream()
Expand Down Expand Up @@ -153,15 +123,12 @@ public void beforeStart() {
}
}
if (debug) {
enableDebug(getPortOffset());
enableDebug();
}
}

@TaskAction
public void runAndWait() throws IOException {
if (initOnly) {
return;
}
getClusters().forEach(ElasticsearchCluster::waitForAllConditions);
List<BufferedReader> toRead = new ArrayList<>();
List<BooleanSupplier> aliveChecks = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public WorkResult delete(Object... objects) {
@Override
public void beforeStart() {
if (debugServer) {
enableDebug(0);
enableDebug();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ default void useCluster(Provider<ElasticsearchCluster> cluster) {

default void beforeStart() {}

default void enableDebug(int portOffset) {
int debugPort = 5007 + portOffset;
default void enableDebug() {
int debugPort = 5007;
for (ElasticsearchCluster cluster : getClusters()) {
for (ElasticsearchNode node : cluster.getNodes()) {
getLogger().lifecycle("Running elasticsearch in debug mode, {} expecting running debug server on port {}", node, debugPort);
Expand Down
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ plugins {
id 'elasticsearch.fips'
id 'elasticsearch.internal-testclusters'
id 'elasticsearch.run'
id 'elasticsearch.run-ccs'
id 'elasticsearch.release-tools'
id 'elasticsearch.versions'
}
Expand Down

0 comments on commit 293e463

Please sign in to comment.