Skip to content

Commit

Permalink
Merge commit 'db4c8075e11d6dc020552d711c2a2e96dc651ad4' of https://gi…
Browse files Browse the repository at this point in the history
…thub.com/apache/cassandra-java-driver into scylla-4.x-merge-4.18.1

Following conflict resolutions and additional changes were made:
- Version was changed to 4.18.1.0-SNAPSHOT
- deep-lic-scan.yaml was removed. Likewise we don't have a fossa subscription.
- added with modifications previously skipped distribution-source module.
  Changed groupId, versions and names.
- added with modifications previously skipped distribution-tests module.
  Changed groupId, versions and names.
- Skipped license-maven-plugin which was checking for ASF license headers.
- removed `<oldArtifacts>` section of revapi plugin configuration pointing to
  datastax.
- Skipped addition of maven-remote-resources-plugin (pom.xml).
- Skipped removal of distributionManagement section (pom.xml). We are not using
  `org.apache` parent pom to define that part.
- Switched Scylla specific uses of `AttributeKey.newInstance` to `.valueOf` too
- Added `WHERE key='local'` to `system.local` queries in `DefaultTopologyMonitorTest`
- Removed irrelevant to Scylla version of the driver parts of the documentation
- Merged in translation between older and newer variations of config keys
  and values.
- Discarded some adjustments for upstream's Jenkins setup which conflicted
  with adjustments for our CI.
- Added extra stubs in BasicLoadBalancingPolicyPreferredRemoteDcsTest
  to match Scylla's modifications.
  • Loading branch information
Bouncheck committed Mar 4, 2025
2 parents 663064f + db4c807 commit 5df628a
Show file tree
Hide file tree
Showing 57 changed files with 1,791 additions and 208 deletions.
39 changes: 0 additions & 39 deletions .github/workflows/dep-lic-scan.yaml

This file was deleted.

60 changes: 35 additions & 25 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,6 @@ def initializeEnvironment() {
. ${JABBA_SHELL}
jabba which 1.8''', returnStdout: true).trim()

env.TEST_JAVA_HOME = sh(label: 'Get TEST_JAVA_HOME',script: '''#!/bin/bash -le
. ${JABBA_SHELL}
jabba which ${JABBA_VERSION}''', returnStdout: true).trim()
env.TEST_JAVA_VERSION = sh(label: 'Get TEST_JAVA_VERSION',script: '''#!/bin/bash -le
echo "${JABBA_VERSION##*.}"''', returnStdout: true).trim()

sh label: 'Download Apache CassandraⓇ or DataStax Enterprise',script: '''#!/bin/bash -le
. ${JABBA_SHELL}
jabba use 1.8
Expand Down Expand Up @@ -104,18 +98,25 @@ ENVIRONMENT_EOF
}

def buildDriver(jabbaVersion) {
withEnv(["BUILD_JABBA_VERSION=${jabbaVersion}"]) {
sh label: 'Build driver', script: '''#!/bin/bash -le
. ${JABBA_SHELL}
jabba use ${BUILD_JABBA_VERSION}
def buildDriverScript = '''#!/bin/bash -le
mvn -B -V install -DskipTests -Dmaven.javadoc.skip=true
'''
}
. ${JABBA_SHELL}
jabba use '''+jabbaVersion+'''
echo "Building with Java version '''+jabbaVersion+'''"
mvn -B -V install -DskipTests -Dmaven.javadoc.skip=true
'''
sh label: 'Build driver', script: buildDriverScript
}

def executeTests() {
sh label: 'Execute tests', script: '''#!/bin/bash -le
def testJavaHome = sh(label: 'Get TEST_JAVA_HOME',script: '''#!/bin/bash -le
. ${JABBA_SHELL}
jabba which ${JABBA_VERSION}''', returnStdout: true).trim()
def testJavaVersion = (JABBA_VERSION =~ /.*\.(\d+)/)[0][1]

def executeTestScript = '''#!/bin/bash -le
# Load CCM environment variables
set -o allexport
. ${HOME}/environment.txt
Expand All @@ -137,8 +138,8 @@ def executeTests() {
printenv | sort
mvn -B -V ${INTEGRATION_TESTS_FILTER_ARGUMENT} -T 1 verify \
-Ptest-jdk-${TEST_JAVA_VERSION} \
-DtestJavaHome=${TEST_JAVA_HOME} \
-Ptest-jdk-'''+testJavaVersion+''' \
-DtestJavaHome='''+testJavaHome+''' \
-DfailIfNoTests=false \
-Dmaven.test.failure.ignore=true \
-Dmaven.javadoc.skip=${SKIP_JAVADOCS} \
Expand All @@ -149,6 +150,8 @@ def executeTests() {
${ISOLATED_ITS_ARGUMENT} \
${PARALLELIZABLE_ITS_ARGUMENT}
'''
echo "Invoking Maven with parameters test-jdk-${testJavaVersion} and testJavaHome = ${testJavaHome}"
sh label: 'Execute tests', script: executeTestScript
}

def executeCodeCoverage() {
Expand Down Expand Up @@ -255,8 +258,10 @@ pipeline {
choices: ['2.1', // Legacy Apache CassandraⓇ
'2.2', // Legacy Apache CassandraⓇ
'3.0', // Previous Apache CassandraⓇ
'3.11', // Current Apache CassandraⓇ
'4.0', // Development Apache CassandraⓇ
'3.11', // Previous Apache CassandraⓇ
'4.0', // Previous Apache CassandraⓇ
'4.1', // Current Apache CassandraⓇ
'5.0', // Development Apache CassandraⓇ
'dse-4.8.16', // Previous EOSL DataStax Enterprise
'dse-5.0.15', // Long Term Support DataStax Enterprise
'dse-5.1.35', // Legacy DataStax Enterprise
Expand Down Expand Up @@ -290,7 +295,11 @@ pipeline {
</tr>
<tr>
<td><strong>4.0</strong></td>
<td>Apache Cassandra&reg; v4.x (<b>CURRENTLY UNDER DEVELOPMENT</b>)</td>
<td>Apache Cassandra&reg; v4.0.x</td>
</tr>
<tr>
<td><strong>4.1</strong></td>
<td>Apache Cassandra&reg; v4.1.x</td>
</tr>
<tr>
<td><strong>dse-4.8.16</strong></td>
Expand Down Expand Up @@ -444,7 +453,7 @@ pipeline {
axis {
name 'SERVER_VERSION'
values '3.11', // Latest stable Apache CassandraⓇ
'4.0', // Development Apache CassandraⓇ
'4.1', // Development Apache CassandraⓇ
'dse-6.8.30' // Current DataStax Enterprise
}
axis {
Expand Down Expand Up @@ -477,7 +486,7 @@ pipeline {
}
stage('Build-Driver') {
steps {
buildDriver('default')
buildDriver('1.8')
}
}
stage('Execute-Tests') {
Expand Down Expand Up @@ -553,8 +562,10 @@ pipeline {
name 'SERVER_VERSION'
values '2.1', // Legacy Apache CassandraⓇ
'3.0', // Previous Apache CassandraⓇ
'3.11', // Current Apache CassandraⓇ
'4.0', // Development Apache CassandraⓇ
'3.11', // Previous Apache CassandraⓇ
'4.0', // Previous Apache CassandraⓇ
'4.1', // Current Apache CassandraⓇ
'5.0', // Development Apache CassandraⓇ
'dse-4.8.16', // Previous EOSL DataStax Enterprise
'dse-5.0.15', // Last EOSL DataStax Enterprise
'dse-5.1.35', // Legacy DataStax Enterprise
Expand Down Expand Up @@ -591,8 +602,7 @@ pipeline {
}
stage('Build-Driver') {
steps {
// Jabba default should be a JDK8 for now
buildDriver('default')
buildDriver('1.8')
}
}
stage('Execute-Tests') {
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ See the [upgrade guide](upgrade_guide/) for details.

* [Manual](manual/)
* [API docs]
* Bug tracking: [JIRA]
* [Mailing list]
* Training: [Scylla University]
* [Changelog]
* [FAQ]
Expand Down
18 changes: 9 additions & 9 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>com.scylladb</groupId>
<artifactId>java-driver-parent</artifactId>
<version>4.18.0.3-SNAPSHOT</version>
<version>4.18.1.0-SNAPSHOT</version>
</parent>
<artifactId>java-driver-bom</artifactId>
<packaging>pom</packaging>
Expand All @@ -38,42 +38,42 @@
<dependency>
<groupId>com.scylladb</groupId>
<artifactId>java-driver-core</artifactId>
<version>4.18.0.3-SNAPSHOT</version>
<version>4.18.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.scylladb</groupId>
<artifactId>java-driver-core-shaded</artifactId>
<version>4.18.0.3-SNAPSHOT</version>
<version>4.18.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.scylladb</groupId>
<artifactId>java-driver-mapper-processor</artifactId>
<version>4.18.0.3-SNAPSHOT</version>
<version>4.18.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.scylladb</groupId>
<artifactId>java-driver-mapper-runtime</artifactId>
<version>4.18.0.3-SNAPSHOT</version>
<version>4.18.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.scylladb</groupId>
<artifactId>java-driver-query-builder</artifactId>
<version>4.18.0.3-SNAPSHOT</version>
<version>4.18.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.scylladb</groupId>
<artifactId>java-driver-test-infra</artifactId>
<version>4.18.0.3-SNAPSHOT</version>
<version>4.18.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.scylladb</groupId>
<artifactId>java-driver-metrics-micrometer</artifactId>
<version>4.18.0.3-SNAPSHOT</version>
<version>4.18.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.scylladb</groupId>
<artifactId>java-driver-metrics-microprofile</artifactId>
<version>4.18.0.3-SNAPSHOT</version>
<version>4.18.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.datastax.oss</groupId>
Expand Down
20 changes: 20 additions & 0 deletions changelog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,26 @@ under the License.

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

### 4.18.1

- [improvement] JAVA-3142: Ability to specify ordering of remote local dc's via new configuration for graceful automatic failovers
- [bug] CASSANDRA-19457: Object reference in Micrometer metrics prevent GC from reclaiming Session instances
- [improvement] CASSANDRA-19468: Don't swallow exception during metadata refresh
- [bug] CASSANDRA-19333: Fix data corruption in VectorCodec when using heap buffers
- [improvement] CASSANDRA-19290: Replace uses of AttributeKey.newInstance
- [improvement] CASSANDRA-19352: Support native_transport_(address|port) + native_transport_port_ssl for DSE 6.8 (4.x edition)
- [improvement] CASSANDRA-19180: Support reloading keystore in cassandra-java-driver

### 4.18.0

- [improvement] PR 1689: Add support for publishing percentile time series for the histogram metrics (nparaddi-walmart)
- [improvement] JAVA-3104: Do not eagerly pre-allocate array when deserializing CqlVector
- [improvement] JAVA-3111: upgrade jackson-databind to 2.13.4.2 to address gradle dependency issue
- [improvement] PR 1617: Improve ByteBufPrimitiveCodec readBytes (chibenwa)
- [improvement] JAVA-3095: Fix CREATE keyword in vector search example in upgrade guide
- [improvement] JAVA-3100: Update jackson-databind to 2.13.4.1 and jackson-jaxrs-json-provider to 2.13.4 to address recent CVEs
- [improvement] JAVA-3089: Forbid wildcard imports

### 4.17.0

- [improvement] JAVA-3070: Make CqlVector and CqlDuration serializable
Expand Down
2 changes: 1 addition & 1 deletion core-shaded/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>com.scylladb</groupId>
<artifactId>java-driver-parent</artifactId>
<version>4.18.0.3-SNAPSHOT</version>
<version>4.18.1.0-SNAPSHOT</version>
</parent>
<artifactId>java-driver-core-shaded</artifactId>
<name>Java driver for Scylla and Apache Cassandra(R) - core with shaded deps</name>
Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<parent>
<groupId>com.scylladb</groupId>
<artifactId>java-driver-parent</artifactId>
<version>4.18.0.3-SNAPSHOT</version>
<version>4.18.1.0-SNAPSHOT</version>
</parent>
<artifactId>java-driver-core</artifactId>
<packaging>bundle</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,19 @@ public enum DefaultDriverOption implements DriverOption {
* <p>Value-type: boolean
*/
METRICS_GENERATE_AGGREGABLE_HISTOGRAMS("advanced.metrics.histograms.generate-aggregable"),
;
/**
* The duration between attempts to reload the keystore.
*
* <p>Value-type: {@link java.time.Duration}
*/
SSL_KEYSTORE_RELOAD_INTERVAL("advanced.ssl-engine-factory.keystore-reload-interval"),
/**
* Ordered preference list of remote dcs optionally supplied for automatic failover.
*
* <p>Value type: {@link java.util.List List}&#60;{@link String}&#62;
*/
LOAD_BALANCING_DC_FAILOVER_PREFERRED_REMOTE_DCS(
"advanced.load-balancing-policy.dc-failover.preferred-remote-dcs");

private final String path;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ protected static void fillWithDriverDefaults(OptionsMap map) {
map.put(TypedDriverOption.LOAD_BALANCING_DC_FAILOVER_MAX_NODES_PER_REMOTE_DC, 0);
map.put(TypedDriverOption.LOAD_BALANCING_DC_FAILOVER_ALLOW_FOR_LOCAL_CONSISTENCY_LEVELS, false);
map.put(TypedDriverOption.METRICS_GENERATE_AGGREGABLE_HISTOGRAMS, true);
map.put(
TypedDriverOption.LOAD_BALANCING_DC_FAILOVER_PREFERRED_REMOTE_DCS, ImmutableList.of(""));
}

@Immutable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,12 @@ public String toString() {
/** The keystore password. */
public static final TypedDriverOption<String> SSL_KEYSTORE_PASSWORD =
new TypedDriverOption<>(DefaultDriverOption.SSL_KEYSTORE_PASSWORD, GenericType.STRING);

/** The duration between attempts to reload the keystore. */
public static final TypedDriverOption<Duration> SSL_KEYSTORE_RELOAD_INTERVAL =
new TypedDriverOption<>(
DefaultDriverOption.SSL_KEYSTORE_RELOAD_INTERVAL, GenericType.DURATION);

/** The location of the truststore file. */
public static final TypedDriverOption<String> SSL_TRUSTSTORE_PATH =
new TypedDriverOption<>(DefaultDriverOption.SSL_TRUSTSTORE_PATH, GenericType.STRING);
Expand Down Expand Up @@ -897,6 +903,16 @@ public String toString() {
DefaultDriverOption.LOAD_BALANCING_DC_FAILOVER_ALLOW_FOR_LOCAL_CONSISTENCY_LEVELS,
GenericType.BOOLEAN);

/**
* Ordered preference list of remote dcs optionally supplied for automatic failover and included
* in query plan. This feature is enabled only when max-nodes-per-remote-dc is greater than 0.
*/
public static final TypedDriverOption<List<String>>
LOAD_BALANCING_DC_FAILOVER_PREFERRED_REMOTE_DCS =
new TypedDriverOption<>(
DefaultDriverOption.LOAD_BALANCING_DC_FAILOVER_PREFERRED_REMOTE_DCS,
GenericType.listOf(String.class));

private static Iterable<TypedDriverOption<?>> introspectBuiltInValues() {
try {
ImmutableList.Builder<TypedDriverOption<?>> result = ImmutableList.builder();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@
@ThreadSafe
public class DriverChannel {

static final AttributeKey<String> CLUSTER_NAME_KEY = AttributeKey.newInstance("cluster_name");
static final AttributeKey<String> CLUSTER_NAME_KEY = AttributeKey.valueOf("cluster_name");
static final AttributeKey<Map<String, List<String>>> OPTIONS_KEY =
AttributeKey.newInstance("options");
AttributeKey.valueOf("options");
static final AttributeKey<ConnectionShardingInfo> SHARDING_INFO_KEY =
AttributeKey.newInstance("sharding_info");
static final AttributeKey<LwtInfo> LWT_INFO_KEY = AttributeKey.newInstance("lwt_info");
AttributeKey.valueOf("sharding_info");
static final AttributeKey<LwtInfo> LWT_INFO_KEY = AttributeKey.valueOf("lwt_info");

@SuppressWarnings("RedundantStringConstructorCall")
static final Object GRACEFUL_CLOSE_MESSAGE = new String("GRACEFUL_CLOSE_MESSAGE");
Expand Down
Loading

0 comments on commit 5df628a

Please sign in to comment.