@@ -37,12 +37,26 @@ private[mode] trait DefaultExecutor extends ClusterModeExecutor {
37
37
throw new IllegalStateException (s " Unable to complete function in $timeoutInSeconds: $hint" )
38
38
}
39
39
40
+ /**
41
+ * Remove this once C* 4.0.0 is released.
42
+ *
43
+ * This is a workaround that allows running it:test against 4.0.0-beta1. This version of C* is published as
44
+ * 4.0-beta1 which breaks versioning convention used in integration tests.
45
+ */
46
+ private def adjustCassandraBetaVersion (version : String ): String = {
47
+ val beta = " 4.0.0-beta(\\ d+)" .r
48
+ version match {
49
+ case beta(betaNo) => s " 4.0-beta $betaNo"
50
+ case other => other
51
+ }
52
+ }
53
+
40
54
override def create (clusterName : String ): Unit = {
41
55
if (created.compareAndSet(false , true )) {
42
56
val options = config.installDirectory
43
57
.map(dir => config.createOptions :+ s " --install-dir= ${new File (dir).getAbsolutePath}" )
44
58
.orElse(config.installBranch.map(branch => config.createOptions :+ s " -v git: ${branch.trim().replaceAll(" \" " , " " )}" ))
45
- .getOrElse(config.createOptions :+ s " -v ${config.version}" )
59
+ .getOrElse(config.createOptions :+ s " -v ${adjustCassandraBetaVersion( config.version.toString) }" )
46
60
47
61
val dseFlag = if (config.dseEnabled) Some (" --dse" ) else None
48
62
@@ -53,7 +67,7 @@ private[mode] trait DefaultExecutor extends ClusterModeExecutor {
53
67
sys.props.get(" user.home" ).get,
54
68
" .ccm" ,
55
69
" repository" ,
56
- config.getDseVersion.getOrElse(config.getCassandraVersion).toString)
70
+ adjustCassandraBetaVersion( config.getDseVersion.getOrElse(config.getCassandraVersion).toString) )
57
71
58
72
if (Files .exists(repositoryDir)) {
59
73
logger.info(s " Found cached repository dir: $repositoryDir" )
@@ -95,6 +109,11 @@ private[mode] trait DefaultExecutor extends ClusterModeExecutor {
95
109
if (config.dseWorkloads.nonEmpty) {
96
110
execute(" setworkload" , config.dseWorkloads.mkString(" ," ))
97
111
}
112
+ } else {
113
+ // C* 4.0.0 has materialized views disabled by default
114
+ if (config.getCassandraVersion.compareTo(Version .parse(" 4.0-beta1" )) >= 0 ) {
115
+ execute(" updateconf" , " enable_materialized_views:true" )
116
+ }
98
117
}
99
118
}
100
119
}
0 commit comments