Skip to content

Commit 0c262f8

Browse files
committed
Support Scylla Enterprise in CCMBridge
Add support for detecting Scylla Enterprise in CCMBridge. When a Scylla Enterprise version is detected (starts with 4-digit year), SCYLLA_PRODUCT is correctly set for scylla-ccm to start Scylla Enterprise.
1 parent 17e7374 commit 0c262f8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

driver-core/src/test/java/com/datastax/driver/core/CCMBridge.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ public class CCMBridge implements CCMAccess {
185185

186186
String installDirectory = System.getProperty("cassandra.directory");
187187
String branch = System.getProperty("cassandra.branch");
188-
188+
// Inherit the current environment.
189+
Map<String, String> envMap = Maps.newHashMap(new ProcessBuilder().environment());
189190
ImmutableSet.Builder<String> installArgs = ImmutableSet.builder();
190191
if (installDirectory != null && !installDirectory.trim().isEmpty()) {
191192
installArgs.add("--install-dir=" + new File(installDirectory).getAbsolutePath());
@@ -194,6 +195,12 @@ public class CCMBridge implements CCMAccess {
194195
} else if (inputScyllaVersion != null && !inputScyllaVersion.trim().isEmpty()) {
195196
installArgs.add(" --scylla ");
196197
installArgs.add("-v release:" + inputScyllaVersion);
198+
199+
// Detect Scylla Enterprise - it should start with
200+
// a 4-digit year.
201+
if (inputScyllaVersion.matches("\\d{4}\\..*")) {
202+
envMap.put("SCYLLA_PRODUCT", "enterprise");
203+
}
197204
} else if (inputCassandraVersion != null && !inputCassandraVersion.trim().isEmpty()) {
198205
installArgs.add("-v " + inputCassandraVersion);
199206
}
@@ -204,8 +211,6 @@ public class CCMBridge implements CCMAccess {
204211

205212
CASSANDRA_INSTALL_ARGS = installArgs.build();
206213

207-
// Inherit the current environment.
208-
Map<String, String> envMap = Maps.newHashMap(new ProcessBuilder().environment());
209214
// If ccm.path is set, override the PATH variable with it.
210215
String ccmPath = System.getProperty("ccm.path");
211216
if (ccmPath != null) {

0 commit comments

Comments
 (0)