@@ -368,6 +368,8 @@ private static VersionNumber parseScyllaInputVersion(String versionString) {
368368
369369 private final VersionNumber dseVersion ;
370370
371+ private final VersionNumber scyllaVersion ;
372+
371373 private final int storagePort ;
372374
373375 private final int thriftPort ;
@@ -402,6 +404,7 @@ protected CCMBridge(
402404 String clusterName ,
403405 VersionNumber cassandraVersion ,
404406 VersionNumber dseVersion ,
407+ VersionNumber scyllaVersion ,
405408 String ipPrefix ,
406409 int storagePort ,
407410 int thriftPort ,
@@ -415,6 +418,7 @@ protected CCMBridge(
415418 this .clusterName = clusterName ;
416419 this .cassandraVersion = cassandraVersion ;
417420 this .dseVersion = dseVersion ;
421+ this .scyllaVersion = scyllaVersion ;
418422 this .ipPrefix = ipPrefix ;
419423 this .storagePort = storagePort ;
420424 this .thriftPort = thriftPort ;
@@ -489,6 +493,11 @@ public VersionNumber getDSEVersion() {
489493 return dseVersion ;
490494 }
491495
496+ @ Override
497+ public VersionNumber getScyllaVersion () {
498+ return scyllaVersion ;
499+ }
500+
492501 @ Override
493502 public File getCcmDir () {
494503 return ccmDir ;
@@ -1000,6 +1009,7 @@ public static class Builder {
10001009 private int [] jmxPorts = {};
10011010 private boolean start = true ;
10021011 private boolean dse = isDse ();
1012+ private boolean scylla = GLOBAL_SCYLLA_VERSION_NUMBER != null ;
10031013 private boolean startSniProxy = false ;
10041014 private VersionNumber version = null ;
10051015 private final Set <String > createOptions = new LinkedHashSet <String >();
@@ -1091,8 +1101,8 @@ public Builder notStarted() {
10911101 }
10921102
10931103 /**
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.
10961106 */
10971107 public Builder withVersion (VersionNumber version ) {
10981108 this .version = version ;
@@ -1105,6 +1115,12 @@ public Builder withDSE(boolean dse) {
11051115 return this ;
11061116 }
11071117
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+
11081124 /**
11091125 * Free-form options that will be added at the end of the {@code ccm create} command (defaults
11101126 * to {@link #CASSANDRA_INSTALL_ARGS} if this is never called).
@@ -1175,17 +1191,26 @@ public CCMBridge build() {
11751191
11761192 VersionNumber dseVersion ;
11771193 VersionNumber cassandraVersion ;
1194+ VersionNumber scyllaVersion ;
11781195 boolean versionConfigured = this .version != null ;
11791196 // No version was explicitly provided, fallback on global config.
11801197 if (!versionConfigured ) {
1198+ scyllaVersion = GLOBAL_SCYLLA_VERSION_NUMBER ;
11811199 dseVersion = GLOBAL_DSE_VERSION_NUMBER ;
11821200 cassandraVersion = GLOBAL_CASSANDRA_VERSION_NUMBER ;
11831201 } else if (dse ) {
11841202 // given version is the DSE version, base cassandra version on DSE version.
1203+ scyllaVersion = null ;
11851204 dseVersion = this .version ;
11861205 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" );
11871211 } else {
11881212 // given version is cassandra version.
1213+ scyllaVersion = null ;
11891214 dseVersion = null ;
11901215 cassandraVersion = this .version ;
11911216 }
@@ -1240,6 +1265,7 @@ public CCMBridge build() {
12401265 clusterName ,
12411266 cassandraVersion ,
12421267 dseVersion ,
1268+ scyllaVersion ,
12431269 ipPrefix ,
12441270 storagePort ,
12451271 thriftPort ,
@@ -1449,6 +1475,7 @@ public boolean equals(Object o) {
14491475
14501476 if (ipPrefix != builder .ipPrefix ) return false ;
14511477 if (dse != builder .dse ) return false ;
1478+ if (scylla != builder .scylla ) return false ;
14521479 if (!Arrays .equals (nodes , builder .nodes )) return false ;
14531480 if (version != null ? !version .equals (builder .version ) : builder .version != null )
14541481 return false ;
0 commit comments