Fix jvm options handling in testclusters < 6.2

This commit is contained in:
Rene Groeschke 2020-08-27 16:03:57 +02:00
parent c4773a4949
commit 4540610b62
No known key found for this signature in database
GPG Key ID: B1782D97CBC64567
1 changed files with 6 additions and 5 deletions

View File

@ -1214,14 +1214,15 @@ public class ElasticsearchNode implements TestClusterConfiguration {
}
private Map<String, String> jvmOptionExpansions() {
String heapDumpOrigin = getVersion().onOrAfter("6.3.0") ? "-XX:HeapDumpPath=data" : "-XX:HeapDumpPath=/heap/dump/path";
Map<String, String> expansions = new HashMap<>();
expansions.putAll(
Map.of(heapDumpOrigin, "-XX:HeapDumpPath=" + confPathLogs.toString(), "logs/gc.log", confPathLogs.resolve("gc.log").toString())
);
Version version = getVersion();
String heapDumpOrigin = getVersion().onOrAfter("6.3.0") ? "-XX:HeapDumpPath=data" : "-XX:HeapDumpPath=/heap/dump/path";
expansions.put(heapDumpOrigin, "-XX:HeapDumpPath=" + confPathLogs.toString());
if (version.onOrAfter("6.2.0")) {
expansions.put("logs/gc.log", confPathLogs.resolve("gc.log").toString());
}
if (getVersion().getMajor() >= 7) {
expansions.put("-XX:ErrorFile=logs/hs_err_pid%p.log", "-XX:ErrorFile=" + confPathLogs.resolve("hs_err_pid%p.log").toString());
}
return expansions;
}