Skip to content

Commit 9157e48

Browse files
authored
SPARKC-657 Bump DSE & OSS C* versions to current patch/RC releases (#1321)
Allow for DSE 5.1 series to be considered as DSE version Protocol v5 only support LZ4 compression Co-authored-by: Madhavan Sridharan <[email protected]>
1 parent a4e1648 commit 9157e48

File tree

4 files changed

+25
-10
lines changed

4 files changed

+25
-10
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
matrix:
1717
scala: [2.11.12]
18-
db-version: [6.8.9, 3.11.9, 4.0-beta4]
18+
db-version: [6.8.13, 5.1.24, 3.11.10, 4.0-rc2]
1919

2020
steps:
2121
- uses: actions/checkout@v2
@@ -35,4 +35,4 @@ jobs:
3535
TEST_PARALLEL_TASKS: 1
3636
CCM_CASSANDRA_VERSION: ${{ matrix.db-version }}
3737
PUBLISH_VERSION: test
38-
run: sbt/sbt ++${{ matrix.scala }} test it:test
38+
run: sbt/sbt ++${{ matrix.scala }} test it:test

connector/src/it/scala/com/datastax/spark/connector/cql/CassandraConnectorSpec.scala

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import java.io.IOException
44

55
import com.datastax.oss.driver.api.core.config.DefaultDriverOption
66
import com.datastax.oss.driver.api.core.cql.SimpleStatement
7+
import com.datastax.oss.driver.api.core.{ProtocolVersion, Version}
78
import com.datastax.spark.connector.cluster.DefaultCluster
89
import com.datastax.spark.connector.{SparkCassandraITFlatSpecBase, _}
910
import org.scalatest.BeforeAndAfterEach
@@ -165,7 +166,7 @@ class CassandraConnectorSpec extends SparkCassandraITFlatSpecBase with DefaultCl
165166
conn2.withSessionDo { session => }
166167
}
167168

168-
it should "use compression when configured" in {
169+
it should "use SNAPPY compression when configured" in skipIfProtocolVersionGTE(ProtocolVersion.V5) {
169170
val conf = sc.getConf
170171
.set(CassandraConnectorConf.CompressionParam.name, "SNAPPY")
171172

@@ -174,7 +175,21 @@ class CassandraConnectorSpec extends SparkCassandraITFlatSpecBase with DefaultCl
174175
session
175176
.getContext
176177
.getConfig
177-
.getDefaultProfile.getString(DefaultDriverOption.PROTOCOL_COMPRESSION) shouldBe "snappy"
178+
.getDefaultProfile.getString(DefaultDriverOption.PROTOCOL_COMPRESSION) shouldBe "snappy"
179+
}
180+
}
181+
182+
// https://github.com/apache/cassandra/blob/cassandra-4.0.0/doc/native_protocol_v5.spec#L194-L195
183+
it should "use LZ4 compression when configured" in skipIfProtocolVersionLT(ProtocolVersion.V5) {
184+
val conf = sc.getConf
185+
.set(CassandraConnectorConf.CompressionParam.name, "LZ4")
186+
187+
val conn = CassandraConnector(conf)
188+
conn.withSessionDo { session =>
189+
session
190+
.getContext
191+
.getConfig
192+
.getDefaultProfile.getString(DefaultDriverOption.PROTOCOL_COMPRESSION) shouldBe "lz4"
178193
}
179194
}
180195

doc/developers.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The most common commands to use when developing the connector are
2222
1. `test` - Runs the the unit tests for the project.
2323
2. `it:test` - Runs the integration tests with Cassandra (started by CCM) and Spark
2424
3. `package` - Builds the project and produces a runtime jar
25-
4. `publishM2` - Publishes a snapshot of the project to your local maven repository allowing for usage with --packages in the spark-shell
25+
4. `publishM2` - Publishes a snapshot of the project to your local maven repository allowing for usage with `--packages` in the spark-shell
2626

2727
The integration tests located in `connector/src/it` should
2828
probably be the first place to look for anyone considering adding code.
@@ -39,7 +39,7 @@ b2.5 feature branch to b3.0 feature branch. Repeat for master.
3939

4040
Example for imaginary SPARKC-9999.
4141

42-
Let's assume that `datastax` is [email protected]:datastax/spark-cassandra-connector.git remote
42+
Let's assume that `datastax` is `[email protected]:datastax/spark-cassandra-connector.git` remote
4343
and origin is your personal clone.
4444
```shell
4545
$ git remote -v
@@ -95,11 +95,11 @@ run and the parallelization used while running tests.
9595
### Test Parallelization
9696

9797
In order to limit the number of test groups running simultaneously use the
98-
`TEST_PARALLEL_TASKS` environment variable. Only applies to sbt test tasks.
98+
`TEST_PARALLEL_TASKS` environment variable. Only applies to `sbt test` tasks.
9999

100100
### Set Cassandra Test Target
101101
Our CI Build runs through the Datastax Infrastructure and tests on all the builds
102-
listed in build.yaml. In addition the test-support module supports Cassandra
102+
listed in build.yaml. In addition the _test-support_ module supports Cassandra
103103
or other CCM Compatible installations.
104104

105105
If using SBT you can set

project/Testing.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,11 @@ object Testing {
4545

4646
/**
4747
* Guesses if the given version is DSE or not.
48-
* Internally it checks if the major version component is ge 6 which should suffice for a long time.
48+
* Internally it checks if the major version component is ge 5 which should suffice for a long time.
4949
* CCM_IS_DSE env setting takes precedence over this guess.
5050
*/
5151
private def isDse(version: Option[String]): Boolean = {
52-
version.flatMap(v => Try(v.split('.').head.toInt >= 6).toOption).getOrElse(false)
52+
version.flatMap(v => Try(v.split('.').head.toInt >= 5).toOption).getOrElse(false)
5353
}
5454

5555
def getCCMJvmOptions = {

0 commit comments

Comments
 (0)