@@ -368,6 +368,8 @@ private static VersionNumber parseScyllaInputVersion(String versionString) {
368
368
369
369
private final VersionNumber dseVersion ;
370
370
371
+ private final VersionNumber scyllaVersion ;
372
+
371
373
private final int storagePort ;
372
374
373
375
private final int thriftPort ;
@@ -402,6 +404,7 @@ protected CCMBridge(
402
404
String clusterName ,
403
405
VersionNumber cassandraVersion ,
404
406
VersionNumber dseVersion ,
407
+ VersionNumber scyllaVersion ,
405
408
String ipPrefix ,
406
409
int storagePort ,
407
410
int thriftPort ,
@@ -415,6 +418,7 @@ protected CCMBridge(
415
418
this .clusterName = clusterName ;
416
419
this .cassandraVersion = cassandraVersion ;
417
420
this .dseVersion = dseVersion ;
421
+ this .scyllaVersion = scyllaVersion ;
418
422
this .ipPrefix = ipPrefix ;
419
423
this .storagePort = storagePort ;
420
424
this .thriftPort = thriftPort ;
@@ -489,6 +493,11 @@ public VersionNumber getDSEVersion() {
489
493
return dseVersion ;
490
494
}
491
495
496
+ @ Override
497
+ public VersionNumber getScyllaVersion () {
498
+ return scyllaVersion ;
499
+ }
500
+
492
501
@ Override
493
502
public File getCcmDir () {
494
503
return ccmDir ;
@@ -1000,6 +1009,7 @@ public static class Builder {
1000
1009
private int [] jmxPorts = {};
1001
1010
private boolean start = true ;
1002
1011
private boolean dse = isDse ();
1012
+ private boolean scylla = GLOBAL_SCYLLA_VERSION_NUMBER != null ;
1003
1013
private boolean startSniProxy = false ;
1004
1014
private VersionNumber version = null ;
1005
1015
private final Set <String > createOptions = new LinkedHashSet <String >();
@@ -1091,8 +1101,8 @@ public Builder notStarted() {
1091
1101
}
1092
1102
1093
1103
/**
1094
- * The Cassandra or DSE version to use. If not specified the globally configured version is used
1095
- * instead.
1104
+ * The Cassandra or DSE or Scylla version to use. If not specified the globally configured
1105
+ * version is used instead.
1096
1106
*/
1097
1107
public Builder withVersion (VersionNumber version ) {
1098
1108
this .version = version ;
@@ -1105,6 +1115,12 @@ public Builder withDSE(boolean dse) {
1105
1115
return this ;
1106
1116
}
1107
1117
1118
+ /** Indicates whether or not this cluster is meant to be a Scylla cluster. */
1119
+ public Builder withScylla (boolean scylla ) {
1120
+ this .scylla = scylla ;
1121
+ return this ;
1122
+ }
1123
+
1108
1124
/**
1109
1125
* Free-form options that will be added at the end of the {@code ccm create} command (defaults
1110
1126
* to {@link #CASSANDRA_INSTALL_ARGS} if this is never called).
@@ -1175,17 +1191,26 @@ public CCMBridge build() {
1175
1191
1176
1192
VersionNumber dseVersion ;
1177
1193
VersionNumber cassandraVersion ;
1194
+ VersionNumber scyllaVersion ;
1178
1195
boolean versionConfigured = this .version != null ;
1179
1196
// No version was explicitly provided, fallback on global config.
1180
1197
if (!versionConfigured ) {
1198
+ scyllaVersion = GLOBAL_SCYLLA_VERSION_NUMBER ;
1181
1199
dseVersion = GLOBAL_DSE_VERSION_NUMBER ;
1182
1200
cassandraVersion = GLOBAL_CASSANDRA_VERSION_NUMBER ;
1183
1201
} else if (dse ) {
1184
1202
// given version is the DSE version, base cassandra version on DSE version.
1203
+ scyllaVersion = null ;
1185
1204
dseVersion = this .version ;
1186
1205
cassandraVersion = getCassandraVersion (dseVersion );
1206
+ } else if (scylla ) {
1207
+ scyllaVersion = this .version ;
1208
+ dseVersion = null ;
1209
+ // Versions from 5.1 to 6.2.0 seem to report release_version 3.0.8 in system_local
1210
+ cassandraVersion = VersionNumber .parse ("3.0.8" );
1187
1211
} else {
1188
1212
// given version is cassandra version.
1213
+ scyllaVersion = null ;
1189
1214
dseVersion = null ;
1190
1215
cassandraVersion = this .version ;
1191
1216
}
@@ -1240,6 +1265,7 @@ public CCMBridge build() {
1240
1265
clusterName ,
1241
1266
cassandraVersion ,
1242
1267
dseVersion ,
1268
+ scyllaVersion ,
1243
1269
ipPrefix ,
1244
1270
storagePort ,
1245
1271
thriftPort ,
@@ -1449,6 +1475,7 @@ public boolean equals(Object o) {
1449
1475
1450
1476
if (ipPrefix != builder .ipPrefix ) return false ;
1451
1477
if (dse != builder .dse ) return false ;
1478
+ if (scylla != builder .scylla ) return false ;
1452
1479
if (!Arrays .equals (nodes , builder .nodes )) return false ;
1453
1480
if (version != null ? !version .equals (builder .version ) : builder .version != null )
1454
1481
return false ;
0 commit comments