Skip to content

Commit dbf4224

Browse files
committed
Merge tag '4.18.1' of https://github.com/apache/cassandra-java-driver into scylla-4.x-merge-4.18.1
Changes skipped as part of conflict resolution: - We do not set `<jvm>${testing.jvm}/bin/java</jvm>` in surefire configuration, - CCMBridge: We do not override java version for specific DSE workloads - CCMBridge: Generally resolved a lot of sections in favor of our changes. Translation of old Cassandra configs into newer Cassandra configs was skipped. It seems it was needed for testing upstream against Cassandra 4.1.x. Our CI seems not to report any issues when running against those versions. Other changes: - Set the version to 4.18.1.0-SNAPSHOT - Changed our usages of `AttributeKey.newInstance(String)` to `.valueOf(String)` Same as in upstream's 4c7133c
2 parents 663064f + cbdde28 commit dbf4224

File tree

51 files changed

+1328
-159
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1328
-159
lines changed

Jenkinsfile

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@ def initializeEnvironment() {
6161
. ${JABBA_SHELL}
6262
jabba which 1.8''', returnStdout: true).trim()
6363

64-
env.TEST_JAVA_HOME = sh(label: 'Get TEST_JAVA_HOME',script: '''#!/bin/bash -le
65-
. ${JABBA_SHELL}
66-
jabba which ${JABBA_VERSION}''', returnStdout: true).trim()
67-
env.TEST_JAVA_VERSION = sh(label: 'Get TEST_JAVA_VERSION',script: '''#!/bin/bash -le
68-
echo "${JABBA_VERSION##*.}"''', returnStdout: true).trim()
69-
7064
sh label: 'Download Apache CassandraⓇ or DataStax Enterprise',script: '''#!/bin/bash -le
7165
. ${JABBA_SHELL}
7266
jabba use 1.8
@@ -104,18 +98,25 @@ ENVIRONMENT_EOF
10498
}
10599

106100
def buildDriver(jabbaVersion) {
107-
withEnv(["BUILD_JABBA_VERSION=${jabbaVersion}"]) {
108-
sh label: 'Build driver', script: '''#!/bin/bash -le
109-
. ${JABBA_SHELL}
110-
jabba use ${BUILD_JABBA_VERSION}
101+
def buildDriverScript = '''#!/bin/bash -le
111102
112-
mvn -B -V install -DskipTests -Dmaven.javadoc.skip=true
113-
'''
114-
}
103+
. ${JABBA_SHELL}
104+
jabba use '''+jabbaVersion+'''
105+
106+
echo "Building with Java version '''+jabbaVersion+'''"
107+
108+
mvn -B -V install -DskipTests -Dmaven.javadoc.skip=true
109+
'''
110+
sh label: 'Build driver', script: buildDriverScript
115111
}
116112

117113
def executeTests() {
118-
sh label: 'Execute tests', script: '''#!/bin/bash -le
114+
def testJavaHome = sh(label: 'Get TEST_JAVA_HOME',script: '''#!/bin/bash -le
115+
. ${JABBA_SHELL}
116+
jabba which ${JABBA_VERSION}''', returnStdout: true).trim()
117+
def testJavaVersion = (JABBA_VERSION =~ /.*\.(\d+)/)[0][1]
118+
119+
def executeTestScript = '''#!/bin/bash -le
119120
# Load CCM environment variables
120121
set -o allexport
121122
. ${HOME}/environment.txt
@@ -137,8 +138,8 @@ def executeTests() {
137138
printenv | sort
138139
139140
mvn -B -V ${INTEGRATION_TESTS_FILTER_ARGUMENT} -T 1 verify \
140-
-Ptest-jdk-${TEST_JAVA_VERSION} \
141-
-DtestJavaHome=${TEST_JAVA_HOME} \
141+
-Ptest-jdk-'''+testJavaVersion+''' \
142+
-DtestJavaHome='''+testJavaHome+''' \
142143
-DfailIfNoTests=false \
143144
-Dmaven.test.failure.ignore=true \
144145
-Dmaven.javadoc.skip=${SKIP_JAVADOCS} \
@@ -149,6 +150,8 @@ def executeTests() {
149150
${ISOLATED_ITS_ARGUMENT} \
150151
${PARALLELIZABLE_ITS_ARGUMENT}
151152
'''
153+
echo "Invoking Maven with parameters test-jdk-${testJavaVersion} and testJavaHome = ${testJavaHome}"
154+
sh label: 'Execute tests', script: executeTestScript
152155
}
153156

154157
def executeCodeCoverage() {
@@ -255,8 +258,10 @@ pipeline {
255258
choices: ['2.1', // Legacy Apache CassandraⓇ
256259
'2.2', // Legacy Apache CassandraⓇ
257260
'3.0', // Previous Apache CassandraⓇ
258-
'3.11', // Current Apache CassandraⓇ
259-
'4.0', // Development Apache CassandraⓇ
261+
'3.11', // Previous Apache CassandraⓇ
262+
'4.0', // Previous Apache CassandraⓇ
263+
'4.1', // Current Apache CassandraⓇ
264+
'5.0', // Development Apache CassandraⓇ
260265
'dse-4.8.16', // Previous EOSL DataStax Enterprise
261266
'dse-5.0.15', // Long Term Support DataStax Enterprise
262267
'dse-5.1.35', // Legacy DataStax Enterprise
@@ -290,7 +295,11 @@ pipeline {
290295
</tr>
291296
<tr>
292297
<td><strong>4.0</strong></td>
293-
<td>Apache Cassandra&reg; v4.x (<b>CURRENTLY UNDER DEVELOPMENT</b>)</td>
298+
<td>Apache Cassandra&reg; v4.0.x</td>
299+
</tr>
300+
<tr>
301+
<td><strong>4.1</strong></td>
302+
<td>Apache Cassandra&reg; v4.1.x</td>
294303
</tr>
295304
<tr>
296305
<td><strong>dse-4.8.16</strong></td>
@@ -444,7 +453,7 @@ pipeline {
444453
axis {
445454
name 'SERVER_VERSION'
446455
values '3.11', // Latest stable Apache CassandraⓇ
447-
'4.0', // Development Apache CassandraⓇ
456+
'4.1', // Development Apache CassandraⓇ
448457
'dse-6.8.30' // Current DataStax Enterprise
449458
}
450459
axis {
@@ -477,7 +486,7 @@ pipeline {
477486
}
478487
stage('Build-Driver') {
479488
steps {
480-
buildDriver('default')
489+
buildDriver('1.8')
481490
}
482491
}
483492
stage('Execute-Tests') {
@@ -553,8 +562,10 @@ pipeline {
553562
name 'SERVER_VERSION'
554563
values '2.1', // Legacy Apache CassandraⓇ
555564
'3.0', // Previous Apache CassandraⓇ
556-
'3.11', // Current Apache CassandraⓇ
557-
'4.0', // Development Apache CassandraⓇ
565+
'3.11', // Previous Apache CassandraⓇ
566+
'4.0', // Previous Apache CassandraⓇ
567+
'4.1', // Current Apache CassandraⓇ
568+
'5.0', // Development Apache CassandraⓇ
558569
'dse-4.8.16', // Previous EOSL DataStax Enterprise
559570
'dse-5.0.15', // Last EOSL DataStax Enterprise
560571
'dse-5.1.35', // Legacy DataStax Enterprise
@@ -591,8 +602,7 @@ pipeline {
591602
}
592603
stage('Build-Driver') {
593604
steps {
594-
// Jabba default should be a JDK8 for now
595-
buildDriver('default')
605+
buildDriver('1.8')
596606
}
597607
}
598608
stage('Execute-Tests') {

bom/pom.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<parent>
2929
<groupId>com.scylladb</groupId>
3030
<artifactId>java-driver-parent</artifactId>
31-
<version>4.18.0.3-SNAPSHOT</version>
31+
<version>4.18.1.0-SNAPSHOT</version>
3232
</parent>
3333
<artifactId>java-driver-bom</artifactId>
3434
<packaging>pom</packaging>
@@ -38,42 +38,42 @@
3838
<dependency>
3939
<groupId>com.scylladb</groupId>
4040
<artifactId>java-driver-core</artifactId>
41-
<version>4.18.0.3-SNAPSHOT</version>
41+
<version>4.18.1.0-SNAPSHOT</version>
4242
</dependency>
4343
<dependency>
4444
<groupId>com.scylladb</groupId>
4545
<artifactId>java-driver-core-shaded</artifactId>
46-
<version>4.18.0.3-SNAPSHOT</version>
46+
<version>4.18.1.0-SNAPSHOT</version>
4747
</dependency>
4848
<dependency>
4949
<groupId>com.scylladb</groupId>
5050
<artifactId>java-driver-mapper-processor</artifactId>
51-
<version>4.18.0.3-SNAPSHOT</version>
51+
<version>4.18.1.0-SNAPSHOT</version>
5252
</dependency>
5353
<dependency>
5454
<groupId>com.scylladb</groupId>
5555
<artifactId>java-driver-mapper-runtime</artifactId>
56-
<version>4.18.0.3-SNAPSHOT</version>
56+
<version>4.18.1.0-SNAPSHOT</version>
5757
</dependency>
5858
<dependency>
5959
<groupId>com.scylladb</groupId>
6060
<artifactId>java-driver-query-builder</artifactId>
61-
<version>4.18.0.3-SNAPSHOT</version>
61+
<version>4.18.1.0-SNAPSHOT</version>
6262
</dependency>
6363
<dependency>
6464
<groupId>com.scylladb</groupId>
6565
<artifactId>java-driver-test-infra</artifactId>
66-
<version>4.18.0.3-SNAPSHOT</version>
66+
<version>4.18.1.0-SNAPSHOT</version>
6767
</dependency>
6868
<dependency>
6969
<groupId>com.scylladb</groupId>
7070
<artifactId>java-driver-metrics-micrometer</artifactId>
71-
<version>4.18.0.3-SNAPSHOT</version>
71+
<version>4.18.1.0-SNAPSHOT</version>
7272
</dependency>
7373
<dependency>
7474
<groupId>com.scylladb</groupId>
7575
<artifactId>java-driver-metrics-microprofile</artifactId>
76-
<version>4.18.0.3-SNAPSHOT</version>
76+
<version>4.18.1.0-SNAPSHOT</version>
7777
</dependency>
7878
<dependency>
7979
<groupId>com.datastax.oss</groupId>

changelog/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,26 @@ under the License.
2121

2222
<!-- Note: contrary to 3.x, insert new entries *first* in their section -->
2323

24+
### 4.18.1
25+
26+
- [improvement] JAVA-3142: Ability to specify ordering of remote local dc's via new configuration for graceful automatic failovers
27+
- [bug] CASSANDRA-19457: Object reference in Micrometer metrics prevent GC from reclaiming Session instances
28+
- [improvement] CASSANDRA-19468: Don't swallow exception during metadata refresh
29+
- [bug] CASSANDRA-19333: Fix data corruption in VectorCodec when using heap buffers
30+
- [improvement] CASSANDRA-19290: Replace uses of AttributeKey.newInstance
31+
- [improvement] CASSANDRA-19352: Support native_transport_(address|port) + native_transport_port_ssl for DSE 6.8 (4.x edition)
32+
- [improvement] CASSANDRA-19180: Support reloading keystore in cassandra-java-driver
33+
34+
### 4.18.0
35+
36+
- [improvement] PR 1689: Add support for publishing percentile time series for the histogram metrics (nparaddi-walmart)
37+
- [improvement] JAVA-3104: Do not eagerly pre-allocate array when deserializing CqlVector
38+
- [improvement] JAVA-3111: upgrade jackson-databind to 2.13.4.2 to address gradle dependency issue
39+
- [improvement] PR 1617: Improve ByteBufPrimitiveCodec readBytes (chibenwa)
40+
- [improvement] JAVA-3095: Fix CREATE keyword in vector search example in upgrade guide
41+
- [improvement] JAVA-3100: Update jackson-databind to 2.13.4.1 and jackson-jaxrs-json-provider to 2.13.4 to address recent CVEs
42+
- [improvement] JAVA-3089: Forbid wildcard imports
43+
2444
### 4.17.0
2545

2646
- [improvement] JAVA-3070: Make CqlVector and CqlDuration serializable

core-shaded/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<parent>
2929
<groupId>com.scylladb</groupId>
3030
<artifactId>java-driver-parent</artifactId>
31-
<version>4.18.0.3-SNAPSHOT</version>
31+
<version>4.18.1.0-SNAPSHOT</version>
3232
</parent>
3333
<artifactId>java-driver-core-shaded</artifactId>
3434
<name>Java driver for Scylla and Apache Cassandra(R) - core with shaded deps</name>

core/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<parent>
2929
<groupId>com.scylladb</groupId>
3030
<artifactId>java-driver-parent</artifactId>
31-
<version>4.18.0.3-SNAPSHOT</version>
31+
<version>4.18.1.0-SNAPSHOT</version>
3232
</parent>
3333
<artifactId>java-driver-core</artifactId>
3434
<packaging>bundle</packaging>

core/src/main/java/com/datastax/oss/driver/api/core/config/DefaultDriverOption.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,19 @@ public enum DefaultDriverOption implements DriverOption {
997997
* <p>Value-type: boolean
998998
*/
999999
METRICS_GENERATE_AGGREGABLE_HISTOGRAMS("advanced.metrics.histograms.generate-aggregable"),
1000-
;
1000+
/**
1001+
* The duration between attempts to reload the keystore.
1002+
*
1003+
* <p>Value-type: {@link java.time.Duration}
1004+
*/
1005+
SSL_KEYSTORE_RELOAD_INTERVAL("advanced.ssl-engine-factory.keystore-reload-interval"),
1006+
/**
1007+
* Ordered preference list of remote dcs optionally supplied for automatic failover.
1008+
*
1009+
* <p>Value type: {@link java.util.List List}&#60;{@link String}&#62;
1010+
*/
1011+
LOAD_BALANCING_DC_FAILOVER_PREFERRED_REMOTE_DCS(
1012+
"advanced.load-balancing-policy.dc-failover.preferred-remote-dcs");
10011013

10021014
private final String path;
10031015

core/src/main/java/com/datastax/oss/driver/api/core/config/OptionsMap.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,8 @@ protected static void fillWithDriverDefaults(OptionsMap map) {
383383
map.put(TypedDriverOption.LOAD_BALANCING_DC_FAILOVER_MAX_NODES_PER_REMOTE_DC, 0);
384384
map.put(TypedDriverOption.LOAD_BALANCING_DC_FAILOVER_ALLOW_FOR_LOCAL_CONSISTENCY_LEVELS, false);
385385
map.put(TypedDriverOption.METRICS_GENERATE_AGGREGABLE_HISTOGRAMS, true);
386+
map.put(
387+
TypedDriverOption.LOAD_BALANCING_DC_FAILOVER_PREFERRED_REMOTE_DCS, ImmutableList.of(""));
386388
}
387389

388390
@Immutable

core/src/main/java/com/datastax/oss/driver/api/core/config/TypedDriverOption.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,12 @@ public String toString() {
238238
/** The keystore password. */
239239
public static final TypedDriverOption<String> SSL_KEYSTORE_PASSWORD =
240240
new TypedDriverOption<>(DefaultDriverOption.SSL_KEYSTORE_PASSWORD, GenericType.STRING);
241+
242+
/** The duration between attempts to reload the keystore. */
243+
public static final TypedDriverOption<Duration> SSL_KEYSTORE_RELOAD_INTERVAL =
244+
new TypedDriverOption<>(
245+
DefaultDriverOption.SSL_KEYSTORE_RELOAD_INTERVAL, GenericType.DURATION);
246+
241247
/** The location of the truststore file. */
242248
public static final TypedDriverOption<String> SSL_TRUSTSTORE_PATH =
243249
new TypedDriverOption<>(DefaultDriverOption.SSL_TRUSTSTORE_PATH, GenericType.STRING);
@@ -897,6 +903,16 @@ public String toString() {
897903
DefaultDriverOption.LOAD_BALANCING_DC_FAILOVER_ALLOW_FOR_LOCAL_CONSISTENCY_LEVELS,
898904
GenericType.BOOLEAN);
899905

906+
/**
907+
* Ordered preference list of remote dcs optionally supplied for automatic failover and included
908+
* in query plan. This feature is enabled only when max-nodes-per-remote-dc is greater than 0.
909+
*/
910+
public static final TypedDriverOption<List<String>>
911+
LOAD_BALANCING_DC_FAILOVER_PREFERRED_REMOTE_DCS =
912+
new TypedDriverOption<>(
913+
DefaultDriverOption.LOAD_BALANCING_DC_FAILOVER_PREFERRED_REMOTE_DCS,
914+
GenericType.listOf(String.class));
915+
900916
private static Iterable<TypedDriverOption<?>> introspectBuiltInValues() {
901917
try {
902918
ImmutableList.Builder<TypedDriverOption<?>> result = ImmutableList.builder();

core/src/main/java/com/datastax/oss/driver/internal/core/channel/DriverChannel.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@
5858
@ThreadSafe
5959
public class DriverChannel {
6060

61-
static final AttributeKey<String> CLUSTER_NAME_KEY = AttributeKey.newInstance("cluster_name");
61+
static final AttributeKey<String> CLUSTER_NAME_KEY = AttributeKey.valueOf("cluster_name");
6262
static final AttributeKey<Map<String, List<String>>> OPTIONS_KEY =
63-
AttributeKey.newInstance("options");
63+
AttributeKey.valueOf("options");
6464
static final AttributeKey<ConnectionShardingInfo> SHARDING_INFO_KEY =
65-
AttributeKey.newInstance("sharding_info");
66-
static final AttributeKey<LwtInfo> LWT_INFO_KEY = AttributeKey.newInstance("lwt_info");
65+
AttributeKey.valueOf("sharding_info");
66+
static final AttributeKey<LwtInfo> LWT_INFO_KEY = AttributeKey.valueOf("lwt_info");
6767

6868
@SuppressWarnings("RedundantStringConstructorCall")
6969
static final Object GRACEFUL_CLOSE_MESSAGE = new String("GRACEFUL_CLOSE_MESSAGE");

0 commit comments

Comments
 (0)