diff --git a/.travis.yml b/.travis.yml
index 0292d381cdd..1ea0a30844e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
language: java
+dist: trusty
jdk:
- openjdk7
- oraclejdk8
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index c5450ce3cd4..703c5fa05b5 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,3 +1,22 @@
+
+
# Contributing guidelines
## Code formatting
diff --git a/Jenkinsfile-asf b/Jenkinsfile-asf
new file mode 100644
index 00000000000..2bc42bea379
--- /dev/null
+++ b/Jenkinsfile-asf
@@ -0,0 +1,78 @@
+#!groovy
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+pipeline {
+ agent {
+ label 'cassandra-small'
+ }
+
+ triggers {
+ // schedules only run against release branches (i.e. 3.x, 4.x, 4.5.x, etc.)
+ cron(branchPatternCron().matcher(env.BRANCH_NAME).matches() ? "@weekly" : "")
+ }
+
+ stages {
+ stage('Matrix') {
+ matrix {
+ axes {
+ axis {
+ name 'TEST_JAVA_VERSION'
+ values 'openjdk@1.8.0-292', 'openjdk@1.11.0-9'
+ }
+ axis {
+ name 'SERVER_VERSION'
+ values '2.1', '3.0', '3.11', '4.0'
+ }
+ }
+ stages {
+ stage('Tests') {
+ agent {
+ label 'cassandra-medium'
+ }
+ steps {
+ script {
+ executeTests()
+ junit testResults: '**/target/surefire-reports/TEST-*.xml', allowEmptyResults: true
+ junit testResults: '**/target/failsafe-reports/TEST-*.xml', allowEmptyResults: true
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+def executeTests() {
+ sh """
+ container_id=\$(docker run -td -e TEST_JAVA_VERSION=${TEST_JAVA_VERSION} -e SERVER_VERSION=${SERVER_VERSION} -v \$(pwd):/home/docker/cassandra-java-driver apache.jfrog.io/cassan-docker/apache/cassandra-java-driver-testing-ubuntu2204 'sleep 2h')
+ docker exec --user root \$container_id bash -c \"sudo bash /home/docker/cassandra-java-driver/ci/create-user.sh docker \$(id -u) \$(id -g) /home/docker/cassandra-java-driver\"
+ docker exec --user docker \$container_id './cassandra-java-driver/ci/run-tests.sh'
+ ( nohup docker stop \$container_id >/dev/null 2>/dev/null & )
+ """
+}
+
+// branch pattern for cron
+// should match 3.x, 4.x, 4.5.x, etc
+def branchPatternCron() {
+ ~"((\\d+(\\.[\\dx]+)+))"
+}
+
diff --git a/Jenkinsfile-datastax b/Jenkinsfile-datastax
new file mode 100644
index 00000000000..9e7b92bed4f
--- /dev/null
+++ b/Jenkinsfile-datastax
@@ -0,0 +1,569 @@
+#!groovy
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+def initializeEnvironment() {
+ env.DRIVER_DISPLAY_NAME = 'CassandraⓇ Java Driver 3.x'
+ env.DRIVER_METRIC_TYPE = 'oss'
+ if (env.GIT_URL.contains('riptano/java-driver')) {
+ env.DRIVER_DISPLAY_NAME = 'private ' + env.DRIVER_DISPLAY_NAME
+ env.DRIVER_METRIC_TYPE = 'oss-private'
+ } else if (env.GIT_URL.contains('java-dse-driver')) {
+ env.DRIVER_DISPLAY_NAME = 'DSE Java Driver 1.x'
+ env.DRIVER_METRIC_TYPE = 'dse'
+ }
+
+ env.GIT_SHA = "${env.GIT_COMMIT.take(7)}"
+ env.GITHUB_PROJECT_URL = "https://${GIT_URL.replaceFirst(/(git@|http:\/\/|https:\/\/)/, '').replace(':', '/').replace('.git', '')}"
+ env.GITHUB_BRANCH_URL = "${GITHUB_PROJECT_URL}/tree/${env.BRANCH_NAME}"
+ env.GITHUB_COMMIT_URL = "${GITHUB_PROJECT_URL}/commit/${env.GIT_COMMIT}"
+
+ env.MAVEN_HOME = "${env.HOME}/.mvn/apache-maven-3.2.5"
+ env.PATH = "${env.MAVEN_HOME}/bin:${env.PATH}"
+ env.JAVA_HOME = sh(label: 'Get JAVA_HOME',script: '''#!/bin/bash -le
+ . ${JABBA_SHELL}
+ jabba which ${JABBA_VERSION}''', returnStdout: true).trim()
+ env.JAVA8_HOME = sh(label: 'Get JAVA8_HOME',script: '''#!/bin/bash -le
+ . ${JABBA_SHELL}
+ jabba which 1.8''', returnStdout: true).trim()
+
+ sh label: 'Download Apache CassandraⓇ',script: '''#!/bin/bash -le
+ . ${JABBA_SHELL}
+ jabba use ${JABBA_VERSION}
+ . ${CCM_ENVIRONMENT_SHELL} ${SERVER_VERSION}
+ '''
+
+ sh label: 'Display Java and environment information',script: '''#!/bin/bash -le
+ # Load CCM environment variables
+ set -o allexport
+ . ${HOME}/environment.txt
+ set +o allexport
+
+ . ${JABBA_SHELL}
+ jabba use ${JABBA_VERSION}
+
+ java -version
+ mvn -v
+ printenv | sort
+ '''
+}
+
+def buildDriver(jabbaVersion) {
+ def buildDriverScript = '''#!/bin/bash -le
+
+ . ${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
+ # Load CCM environment variables
+ set -o allexport
+ . ${HOME}/environment.txt
+ set +o allexport
+
+ . ${JABBA_SHELL}
+ jabba use ${JABBA_VERSION}
+
+ printenv | sort
+
+ mvn -B -V verify \
+ -fail-never -P${TEST_PROFILE} \
+ -Dcom.datastax.driver.TEST_BASE_NODE_WAIT=120 \
+ -Dcom.datastax.driver.NEW_NODE_DELAY_SECONDS=100 \
+ -Dcassandra.version=${CCM_CASSANDRA_VERSION} \
+ -Ddse=${CCM_IS_DSE} \
+ -Dccm.java.home=${CCM_JAVA_HOME} \
+ -Dccm.path=${CCM_JAVA_HOME}/bin \
+ -Dccm.maxNumberOfNodes=3 \
+ -DfailIfNoTests=false \
+ -Dmaven.test.failure.ignore=true \
+ -Dmaven.javadoc.skip=true \
+ -Dproxy.path=${HOME}/proxy
+
+ # run isolated tests
+ mvn -B -V verify \
+ -fail-never -Pisolated \
+ -Dcom.datastax.driver.TEST_BASE_NODE_WAIT=120 \
+ -Dcom.datastax.driver.NEW_NODE_DELAY_SECONDS=100 \
+ -Dcassandra.version=${CCM_CASSANDRA_VERSION} \
+ -Ddse=${CCM_IS_DSE} \
+ -Dccm.java.home=${CCM_JAVA_HOME} \
+ -Dccm.path=${CCM_JAVA_HOME}/bin \
+ -Dccm.maxNumberOfNodes=3 \
+ -DfailIfNoTests=false \
+ -Dmaven.test.failure.ignore=true \
+ -Dmaven.javadoc.skip=true
+ '''
+}
+
+def executeCodeCoverage() {
+ jacoco(
+ execPattern: '**/target/jacoco.exec',
+ classPattern: '**/classes',
+ sourcePattern: '**/src/main/java'
+ )
+}
+
+def notifySlack(status = 'started') {
+ // Notify Slack channel for every build except adhoc executions
+ if (params.ADHOC_BUILD_TYPE != 'BUILD-AND-EXECUTE-TESTS') {
+ // Set the global pipeline scoped environment (this is above each matrix)
+ env.BUILD_STATED_SLACK_NOTIFIED = 'true'
+
+ def buildType = 'Commit'
+ if (params.CI_SCHEDULE != 'DO-NOT-CHANGE-THIS-SELECTION') {
+ buildType = "${params.CI_SCHEDULE.toLowerCase().capitalize()}"
+ }
+
+ def color = 'good' // Green
+ if (status.equalsIgnoreCase('aborted')) {
+ color = '808080' // Grey
+ } else if (status.equalsIgnoreCase('unstable')) {
+ color = 'warning' // Orange
+ } else if (status.equalsIgnoreCase('failed')) {
+ color = 'danger' // Red
+ }
+
+ def message = """Build ${status} for ${env.DRIVER_DISPLAY_NAME} [${buildType}]
+<${env.GITHUB_BRANCH_URL}|${env.BRANCH_NAME}> - <${env.RUN_DISPLAY_URL}|#${env.BUILD_NUMBER}> - <${env.GITHUB_COMMIT_URL}|${env.GIT_SHA}>"""
+ if (!status.equalsIgnoreCase('Started')) {
+ message += """
+${status} after ${currentBuild.durationString - ' and counting'}"""
+ }
+
+ slackSend color: "${color}",
+ channel: "#java-driver-dev-bots",
+ message: "${message}"
+ }
+}
+
+def describePerCommitStage() {
+ script {
+ currentBuild.displayName = "Per-Commit build"
+ currentBuild.description = 'Per-Commit build and testing of development Apache CassandraⓇ against Oracle JDK 8'
+ }
+}
+
+def describeAdhocAndScheduledTestingStage() {
+ script {
+ if (params.CI_SCHEDULE == 'DO-NOT-CHANGE-THIS-SELECTION') {
+ // Ad-hoc build
+ currentBuild.displayName = "Adhoc testing"
+ currentBuild.description = "Testing ${params.ADHOC_BUILD_AND_EXECUTE_TESTS_SERVER_VERSION} against JDK version ${params.ADHOC_BUILD_AND_EXECUTE_TESTS_JABBA_VERSION}"
+ } else {
+ // Scheduled build
+ currentBuild.displayName = "${params.CI_SCHEDULE.toLowerCase().replaceAll('_', ' ').capitalize()} schedule"
+ currentBuild.description = "Testing server versions [${params.CI_SCHEDULE_SERVER_VERSIONS}] against JDK version ${params.CI_SCHEDULE_JABBA_VERSION}"
+ }
+ }
+}
+
+// branch pattern for cron
+// should match 3.x, 4.x, 4.5.x, etc
+def branchPatternCron() {
+ ~"((\\d+(\\.[\\dx]+)+))"
+}
+
+pipeline {
+ agent none
+
+ // Global pipeline timeout
+ options {
+ timeout(time: 10, unit: 'HOURS')
+ buildDiscarder(logRotator(artifactNumToKeepStr: '10', // Keep only the last 10 artifacts
+ numToKeepStr: '50')) // Keep only the last 50 build records
+ }
+
+ parameters {
+ choice(
+ name: 'ADHOC_BUILD_TYPE',
+ choices: ['BUILD', 'BUILD-AND-EXECUTE-TESTS'],
+ description: '''
Perform a adhoc build operation
+
+
+
+
+
Choice
+
Description
+
+
+
BUILD
+
Performs a Per-Commit build
+
+
+
BUILD-AND-EXECUTE-TESTS
+
Performs a build and executes the integration and unit tests
+
+
''')
+ choice(
+ name: 'ADHOC_BUILD_AND_EXECUTE_TESTS_SERVER_VERSION',
+ 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Ⓡ
+ 'dse-5.1', // Legacy DataStax Enterprise
+ 'dse-6.0', // Previous DataStax Enterprise
+ 'dse-6.7', // Previous DataStax Enterprise
+ 'dse-6.8.0', // Current DataStax Enterprise
+ 'ALL'],
+ description: '''Apache Cassandra® or DataStax Enterprise server version to use for adhoc BUILD-AND-EXECUTE-TESTS builds
+
+
+
+
+
Choice
+
Description
+
+
+
2.1
+
Apache Cassandra® v2.1.x
+
+
+
2.2
+
Apache Cassandra® v2.2.x
+
+
+
3.0
+
Apache Cassandra® v3.0.x
+
+
+
3.11
+
Apache Cassandra® v3.11.x
+
+
+
4.0
+
Apache Cassandra® v4.x (CURRENTLY UNDER DEVELOPMENT)
+
+
+
dse-5.1
+
DataStax Enterprise v5.1.x
+
+
+
dse-6.0
+
DataStax Enterprise v6.0.x
+
+
+
dse-6.7
+
DataStax Enterprise v6.7.x
+
+
+
dse-6.8.0
+
DataStax Enterprise v6.8.0
+
+
''')
+ choice(
+ name: 'ADHOC_BUILD_AND_EXECUTE_TESTS_JABBA_VERSION',
+ choices: ['zulu@1.6', // Zulu JDK 1.6
+ 'zulu@1.7', // Zulu JDK 1.7
+ '1.8', // Oracle JDK version 1.8 (current default)
+ 'openjdk@1.11'], // OpenJDK version 11
+ description: '''JDK version to use for TESTING when running adhoc BUILD-AND-EXECUTE-TESTS builds. All builds will use JDK8 for building the driver
+
+
+
+
+
Choice
+
Description
+
+
+
zulu@1.6
+
Zulu JDK version 1.6
+
+
+
zulu@1.7
+
Zulu JDK version 1.7
+
+
+
1.8
+
Oracle JDK version 1.8 (Used for compiling regardless of choice)
+
+
+
openjdk@1.11
+
OpenJDK version 11
+
+
''')
+ choice(
+ name: 'ADHOC_BUILD_AND_EXECUTE_TESTS_TEST_PROFILE',
+ choices: ['short', 'long'],
+ description: 'Test profile to execute during test phase of the build')
+ choice(
+ name: 'CI_SCHEDULE',
+ choices: ['DO-NOT-CHANGE-THIS-SELECTION', 'WEEKNIGHTS', 'WEEKENDS', 'MONTHLY'],
+ description: 'CI testing schedule to execute periodically scheduled builds and tests of the driver (DO NOT CHANGE THIS SELECTION)')
+ string(
+ name: 'CI_SCHEDULE_SERVER_VERSIONS',
+ defaultValue: 'DO-NOT-CHANGE-THIS-SELECTION',
+ description: 'CI testing server version(s) to utilize for scheduled test runs of the driver (DO NOT CHANGE THIS SELECTION)')
+ string(
+ name: 'CI_SCHEDULE_JABBA_VERSION',
+ defaultValue: 'DO-NOT-CHANGE-THIS-SELECTION',
+ description: 'CI testing JDK version(s) to utilize for scheduled test runs of the driver (DO NOT CHANGE THIS SELECTION)')
+ string(
+ name: 'CI_SCHEDULE_TEST_PROFILE',
+ defaultValue: 'DO-NOT-CHANGE-THIS-SELECTION',
+ description: 'CI testing profile to execute (DO NOT CHANGE THIS SELECTION)')
+ }
+
+ triggers {
+ // schedules only run against release branches (i.e. 3.x, 4.x, 4.5.x, etc.)
+ parameterizedCron(branchPatternCron().matcher(env.BRANCH_NAME).matches() ? """
+ # Every weeknight (Monday - Friday) around 3:00 AM
+ ### JDK8 tests against 2.1, 3.0, 3.11 and 4.0
+ H 3 * * 1-5 %CI_SCHEDULE=WEEKNIGHTS;CI_SCHEDULE_SERVER_VERSIONS=2.1 3.0 3.11 4.0;CI_SCHEDULE_JABBA_VERSION=1.8;CI_SCHEDULE_TEST_PROFILE=long
+ # Every weekend (Sunday) around 2:00 PM
+ ### JDK11 tests against 2.1, 3.0, 3.11 and 4.0
+ H 14 * * 0 %CI_SCHEDULE=WEEKENDS;CI_SCHEDULE_SERVER_VERSIONS=2.1 3.0 3.11 4.0;CI_SCHEDULE_JABBA_VERSION=openjdk@1.11;CI_SCHEDULE_TEST_PROFILE=long
+ """ : "")
+ }
+
+ environment {
+ OS_VERSION = 'ubuntu/jammy64/java-driver'
+ JABBA_SHELL = '/usr/lib/jabba/jabba.sh'
+ CCM_ENVIRONMENT_SHELL = '/usr/local/bin/ccm_environment.sh'
+ }
+
+ stages {
+ stage ('Per-Commit') {
+ options {
+ timeout(time: 2, unit: 'HOURS')
+ }
+ when {
+ beforeAgent true
+ allOf {
+ expression { params.ADHOC_BUILD_TYPE == 'BUILD' }
+ expression { params.CI_SCHEDULE == 'DO-NOT-CHANGE-THIS-SELECTION' }
+ expression { params.CI_SCHEDULE_SERVER_VERSIONS == 'DO-NOT-CHANGE-THIS-SELECTION' }
+ expression { params.CI_SCHEDULE_JABBA_VERSION == 'DO-NOT-CHANGE-THIS-SELECTION' }
+ expression { params.CI_SCHEDULE_TEST_PROFILE == 'DO-NOT-CHANGE-THIS-SELECTION' }
+ not { buildingTag() }
+ }
+ }
+
+ matrix {
+ axes {
+ axis {
+ name 'SERVER_VERSION'
+ values '3.11', // Current Apache CassandraⓇ
+ '4.0' // Development Apache CassandraⓇ
+ }
+ }
+
+ agent {
+ label "${OS_VERSION}"
+ }
+ environment {
+ // Per-commit builds are only going to run against JDK8
+ JABBA_VERSION = '1.8'
+ TEST_PROFILE = 'short'
+ }
+
+ stages {
+ stage('Initialize-Environment') {
+ steps {
+ initializeEnvironment()
+ script {
+ if (env.BUILD_STATED_SLACK_NOTIFIED != 'true') {
+ notifySlack()
+ }
+ }
+ }
+ }
+ stage('Describe-Build') {
+ steps {
+ describePerCommitStage()
+ }
+ }
+ stage('Build-Driver') {
+ steps {
+ buildDriver('1.8')
+ }
+ }
+ stage('Execute-Tests') {
+ steps {
+ catchError {
+ // Use the matrix JDK for testing
+ executeTests()
+ }
+ }
+ post {
+ always {
+ /*
+ * Empty results are possible
+ *
+ * - Build failures during mvn verify may exist so report may not be available
+ */
+ junit testResults: '**/target/surefire-reports/TEST-*.xml', allowEmptyResults: true
+ junit testResults: '**/target/failsafe-reports/TEST-*.xml', allowEmptyResults: true
+ }
+ }
+ }
+ stage('Execute-Code-Coverage') {
+ // Ensure the code coverage is run only once per-commit
+ when { environment name: 'SERVER_VERSION', value: '4.0' }
+ steps {
+ executeCodeCoverage()
+ }
+ }
+ }
+ }
+ post {
+ aborted {
+ notifySlack('aborted')
+ }
+ success {
+ notifySlack('completed')
+ }
+ unstable {
+ notifySlack('unstable')
+ }
+ failure {
+ notifySlack('FAILED')
+ }
+ }
+ }
+
+ stage('Adhoc-And-Scheduled-Testing') {
+ when {
+ beforeAgent true
+ allOf {
+ expression { (params.ADHOC_BUILD_TYPE == 'BUILD' && params.CI_SCHEDULE != 'DO-NOT-CHANGE-THIS-SELECTION') ||
+ params.ADHOC_BUILD_TYPE == 'BUILD-AND-EXECUTE-TESTS' }
+ not { buildingTag() }
+ anyOf {
+ expression { params.ADHOC_BUILD_TYPE == 'BUILD-AND-EXECUTE-TESTS' }
+ allOf {
+ expression { params.ADHOC_BUILD_TYPE == 'BUILD' }
+ expression { params.CI_SCHEDULE != 'DO-NOT-CHANGE-THIS-SELECTION' }
+ expression { params.CI_SCHEDULE_SERVER_VERSIONS != 'DO-NOT-CHANGE-THIS-SELECTION' }
+ }
+ }
+ }
+ }
+
+ environment {
+ SERVER_VERSIONS = "${params.CI_SCHEDULE_SERVER_VERSIONS == 'DO-NOT-CHANGE-THIS-SELECTION' ? params.ADHOC_BUILD_AND_EXECUTE_TESTS_SERVER_VERSION : params.CI_SCHEDULE_SERVER_VERSIONS}"
+ JABBA_VERSION = "${params.CI_SCHEDULE_JABBA_VERSION == 'DO-NOT-CHANGE-THIS-SELECTION' ? params.ADHOC_BUILD_AND_EXECUTE_TESTS_JABBA_VERSION : params.CI_SCHEDULE_JABBA_VERSION}"
+ TEST_PROFILE = "${params.CI_SCHEDULE_TEST_PROFILE == 'DO-NOT-CHANGE-THIS-SELECTION' ? params.ADHOC_BUILD_AND_EXECUTE_TESTS_TEST_PROFILE : params.CI_SCHEDULE_TEST_PROFILE}"
+ }
+
+ matrix {
+ axes {
+ axis {
+ name 'SERVER_VERSION'
+ values '2.1', // Legacy Apache CassandraⓇ
+ '3.0', // Previous Apache CassandraⓇ
+ '3.11', // Current Apache CassandraⓇ
+ '4.0', // Development Apache CassandraⓇ
+ 'dse-5.1', // Legacy DataStax Enterprise
+ 'dse-6.0', // Previous DataStax Enterprise
+ 'dse-6.7', // Previous DataStax Enterprise
+ 'dse-6.8.0' // Current DataStax Enterprise
+ }
+ }
+ when {
+ beforeAgent true
+ allOf {
+ expression { return env.SERVER_VERSIONS.split(' ').any { it =~ /(ALL|${env.SERVER_VERSION})/ } }
+ }
+ }
+ agent {
+ label "${env.OS_VERSION}"
+ }
+
+ stages {
+ stage('Initialize-Environment') {
+ steps {
+ initializeEnvironment()
+ script {
+ if (env.BUILD_STATED_SLACK_NOTIFIED != 'true') {
+ notifySlack()
+ }
+ }
+ }
+ }
+ stage('Describe-Build') {
+ steps {
+ describeAdhocAndScheduledTestingStage()
+ }
+ }
+ stage('Build-Driver') {
+ steps {
+ // Jabba default should be a JDK8 for now
+ buildDriver('1.8')
+ }
+ }
+ stage('Execute-Tests') {
+ steps {
+ catchError {
+ // Use the matrix JDK for testing
+ executeTests()
+ }
+ }
+ post {
+ always {
+ /*
+ * Empty results are possible
+ *
+ * - Build failures during mvn verify may exist so report may not be available
+ * - With boolean parameters to skip tests a failsafe report may not be available
+ */
+ junit testResults: '**/target/surefire-reports/TEST-*.xml', allowEmptyResults: true
+ junit testResults: '**/target/failsafe-reports/TEST-*.xml', allowEmptyResults: true
+ }
+ }
+ }
+ stage('Execute-Code-Coverage') {
+ // Ensure the code coverage is run only once per-commit
+ when {
+ allOf {
+ environment name: 'SERVER_VERSION', value: '4.0'
+ environment name: 'JABBA_VERSION', value: '1.8'
+ }
+ }
+ steps {
+ executeCodeCoverage()
+ }
+ }
+ }
+ }
+ post {
+ aborted {
+ notifySlack('aborted')
+ }
+ success {
+ notifySlack('completed')
+ }
+ unstable {
+ notifySlack('unstable')
+ }
+ failure {
+ notifySlack('FAILED')
+ }
+ }
+ }
+ }
+}
diff --git a/LICENSE b/LICENSE
index d6456956733..38f06999ef6 100644
--- a/LICENSE
+++ b/LICENSE
@@ -200,3 +200,10 @@
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+
+Apache Cassandra Java Driver bundles code and files from the following projects:
+
+Protocol Buffers
+Copyright 2008 Google Inc.
+This product includes software developed as part of the Protocol Buffers project ( https://developers.google.com/protocol-buffers/ ).
+see driver-core/src/main/java/com/datastax/driver/core/VIntCoding.java
diff --git a/LICENSE_binary b/LICENSE_binary
new file mode 100644
index 00000000000..5232779c907
--- /dev/null
+++ b/LICENSE_binary
@@ -0,0 +1,229 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+Apache Cassandra Java Driver bundles code and files from the following projects:
+
+Protocol Buffers
+Copyright 2008 Google Inc.
+This product includes software developed as part of the Protocol Buffers project ( https://developers.google.com/protocol-buffers/ ).
+see driver-core/src/main/java/com/datastax/driver/core/VIntCoding.java
+
+This product bundles Java Native Runtime - POSIX 3.1.15,
+which is available under the Eclipse Public License version 2.0.
+see licenses/jnr-posix.txt
+
+This product bundles jnr-x86asm 1.0.2,
+which is available under the MIT License.
+see licenses/jnr-x86asm.txt
+
+This product bundles ASM 9.2: a very small and fast Java bytecode manipulation framework,
+which is available under the 3-Clause BSD License.
+see licenses/asm.txt
+
+This product bundles HdrHistogram 2.1.12: A High Dynamic Range (HDR) Histogram,
+which is available under the 2-Clause BSD License.
+see licenses/HdrHistogram.txt
+
+This product bundles The Simple Logging Facade for Java (SLF4J) API 1.7.26,
+which is available under the MIT License.
+see licenses/slf4j-api.txt
diff --git a/NOTICE.txt b/NOTICE.txt
new file mode 100644
index 00000000000..8e27ae3e52f
--- /dev/null
+++ b/NOTICE.txt
@@ -0,0 +1,5 @@
+Apache Cassandra Java Driver
+Copyright 2012- The Apache Software Foundation
+
+This product includes software developed at The Apache Software
+Foundation (http://www.apache.org/).
diff --git a/NOTICE_binary.txt b/NOTICE_binary.txt
new file mode 100644
index 00000000000..c60d8ceb245
--- /dev/null
+++ b/NOTICE_binary.txt
@@ -0,0 +1,249 @@
+Apache Cassandra Java Driver
+Copyright 2012- The Apache Software Foundation
+
+This product includes software developed at The Apache Software
+Foundation (http://www.apache.org/).
+
+This compiled product also includes Apache-licensed dependencies
+that contain the following NOTICE information:
+
+==================================================================
+io.netty:netty-handler NOTICE.txt
+==================================================================
+This product contains the extensions to Java Collections Framework which has
+been derived from the works by JSR-166 EG, Doug Lea, and Jason T. Greene:
+
+ * LICENSE:
+ * license/LICENSE.jsr166y.txt (Public Domain)
+ * HOMEPAGE:
+ * http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/
+ * http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbosscache/experimental/jsr166/
+
+This product contains a modified version of Robert Harder's Public Domain
+Base64 Encoder and Decoder, which can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.base64.txt (Public Domain)
+ * HOMEPAGE:
+ * http://iharder.sourceforge.net/current/java/base64/
+
+This product contains a modified portion of 'Webbit', an event based
+WebSocket and HTTP server, which can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.webbit.txt (BSD License)
+ * HOMEPAGE:
+ * https://github.com/joewalnes/webbit
+
+This product contains a modified portion of 'SLF4J', a simple logging
+facade for Java, which can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.slf4j.txt (MIT License)
+ * HOMEPAGE:
+ * https://www.slf4j.org/
+
+This product contains a modified portion of 'Apache Harmony', an open source
+Java SE, which can be obtained at:
+
+ * NOTICE:
+ * license/NOTICE.harmony.txt
+ * LICENSE:
+ * license/LICENSE.harmony.txt (Apache License 2.0)
+ * HOMEPAGE:
+ * https://archive.apache.org/dist/harmony/
+
+This product contains a modified portion of 'jbzip2', a Java bzip2 compression
+and decompression library written by Matthew J. Francis. It can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.jbzip2.txt (MIT License)
+ * HOMEPAGE:
+ * https://code.google.com/p/jbzip2/
+
+This product contains a modified portion of 'libdivsufsort', a C API library to construct
+the suffix array and the Burrows-Wheeler transformed string for any input string of
+a constant-size alphabet written by Yuta Mori. It can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.libdivsufsort.txt (MIT License)
+ * HOMEPAGE:
+ * https://github.com/y-256/libdivsufsort
+
+This product contains a modified portion of Nitsan Wakart's 'JCTools', Java Concurrency Tools for the JVM,
+ which can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.jctools.txt (ASL2 License)
+ * HOMEPAGE:
+ * https://github.com/JCTools/JCTools
+
+This product optionally depends on 'JZlib', a re-implementation of zlib in
+pure Java, which can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.jzlib.txt (BSD style License)
+ * HOMEPAGE:
+ * http://www.jcraft.com/jzlib/
+
+This product optionally depends on 'Compress-LZF', a Java library for encoding and
+decoding data in LZF format, written by Tatu Saloranta. It can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.compress-lzf.txt (Apache License 2.0)
+ * HOMEPAGE:
+ * https://github.com/ning/compress
+
+This product optionally depends on 'lz4', a LZ4 Java compression
+and decompression library written by Adrien Grand. It can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.lz4.txt (Apache License 2.0)
+ * HOMEPAGE:
+ * https://github.com/jpountz/lz4-java
+
+This product optionally depends on 'lzma-java', a LZMA Java compression
+and decompression library, which can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.lzma-java.txt (Apache License 2.0)
+ * HOMEPAGE:
+ * https://github.com/jponge/lzma-java
+
+This product optionally depends on 'zstd-jni', a zstd-jni Java compression
+and decompression library, which can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.zstd-jni.txt (Apache License 2.0)
+ * HOMEPAGE:
+ * https://github.com/luben/zstd-jni
+
+This product contains a modified portion of 'jfastlz', a Java port of FastLZ compression
+and decompression library written by William Kinney. It can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.jfastlz.txt (MIT License)
+ * HOMEPAGE:
+ * https://code.google.com/p/jfastlz/
+
+This product contains a modified portion of and optionally depends on 'Protocol Buffers', Google's data
+interchange format, which can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.protobuf.txt (New BSD License)
+ * HOMEPAGE:
+ * https://github.com/google/protobuf
+
+This product optionally depends on 'Bouncy Castle Crypto APIs' to generate
+a temporary self-signed X.509 certificate when the JVM does not provide the
+equivalent functionality. It can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.bouncycastle.txt (MIT License)
+ * HOMEPAGE:
+ * https://www.bouncycastle.org/
+
+This product optionally depends on 'Snappy', a compression library produced
+by Google Inc, which can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.snappy.txt (New BSD License)
+ * HOMEPAGE:
+ * https://github.com/google/snappy
+
+This product optionally depends on 'JBoss Marshalling', an alternative Java
+serialization API, which can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.jboss-marshalling.txt (Apache License 2.0)
+ * HOMEPAGE:
+ * https://github.com/jboss-remoting/jboss-marshalling
+
+This product optionally depends on 'Caliper', Google's micro-
+benchmarking framework, which can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.caliper.txt (Apache License 2.0)
+ * HOMEPAGE:
+ * https://github.com/google/caliper
+
+This product optionally depends on 'Apache Commons Logging', a logging
+framework, which can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.commons-logging.txt (Apache License 2.0)
+ * HOMEPAGE:
+ * https://commons.apache.org/logging/
+
+This product optionally depends on 'Apache Log4J', a logging framework, which
+can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.log4j.txt (Apache License 2.0)
+ * HOMEPAGE:
+ * https://logging.apache.org/log4j/
+
+This product optionally depends on 'Aalto XML', an ultra-high performance
+non-blocking XML processor, which can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.aalto-xml.txt (Apache License 2.0)
+ * HOMEPAGE:
+ * https://wiki.fasterxml.com/AaltoHome
+
+This product contains a modified version of 'HPACK', a Java implementation of
+the HTTP/2 HPACK algorithm written by Twitter. It can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.hpack.txt (Apache License 2.0)
+ * HOMEPAGE:
+ * https://github.com/twitter/hpack
+
+This product contains a modified version of 'HPACK', a Java implementation of
+the HTTP/2 HPACK algorithm written by Cory Benfield. It can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.hyper-hpack.txt (MIT License)
+ * HOMEPAGE:
+ * https://github.com/python-hyper/hpack/
+
+This product contains a modified version of 'HPACK', a Java implementation of
+the HTTP/2 HPACK algorithm written by Tatsuhiro Tsujikawa. It can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.nghttp2-hpack.txt (MIT License)
+ * HOMEPAGE:
+ * https://github.com/nghttp2/nghttp2/
+
+This product contains a modified portion of 'Apache Commons Lang', a Java library
+provides utilities for the java.lang API, which can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.commons-lang.txt (Apache License 2.0)
+ * HOMEPAGE:
+ * https://commons.apache.org/proper/commons-lang/
+
+
+This product contains the Maven wrapper scripts from 'Maven Wrapper', that provides an easy way to ensure a user has everything necessary to run the Maven build.
+
+ * LICENSE:
+ * license/LICENSE.mvn-wrapper.txt (Apache License 2.0)
+ * HOMEPAGE:
+ * https://github.com/takari/maven-wrapper
+
+This product contains the dnsinfo.h header file, that provides a way to retrieve the system DNS configuration on MacOS.
+This private header is also used by Apple's open source
+ mDNSResponder (https://opensource.apple.com/tarballs/mDNSResponder/).
+
+ * LICENSE:
+ * license/LICENSE.dnsinfo.txt (Apple Public Source License 2.0)
+ * HOMEPAGE:
+ * https://www.opensource.apple.com/source/configd/configd-453.19/dnsinfo/dnsinfo.h
+
+This product optionally depends on 'Brotli4j', Brotli compression and
+decompression for Java., which can be obtained at:
+
+ * LICENSE:
+ * license/LICENSE.brotli4j.txt (Apache License 2.0)
+ * HOMEPAGE:
+ * https://github.com/hyperxpro/Brotli4j
diff --git a/README.md b/README.md
index efb3a113cad..a56816e0767 100644
--- a/README.md
+++ b/README.md
@@ -1,21 +1,20 @@
-# Datastax Java Driver for Apache Cassandra®
+# Java Driver for Apache Cassandra®
-[](https://travis-ci.org/datastax/java-driver)
+:warning: The java-driver has recently been donated by Datastax to The Apache Software Foundation and the Apache Cassandra project. Bear with us as we move assets and coordinates.
+
+[](https://opensource.org/licenses/Apache-2.0)
+[](https://maven-badges.herokuapp.com/maven-central/org.apache.cassandra/cassandra-driver-core)
*If you're reading this on github.com, please note that this is the readme
for the development version and that some features described here might
not yet have been released. You can find the documentation for the latest
-version through the [Java driver
-docs](http://docs.datastax.com/en/developer/java-driver/latest/index.html) or via the release tags,
-[e.g.
-3.6.0](https://github.com/datastax/java-driver/tree/3.6.0).*
-
-_**Feeback requested!** Help us focus our efforts, provide your input on
-the [Platform and Runtime Survey](http://goo.gl/forms/qwUE6qnL7U) (we kept it short)._
+version through the [Java Driver
+docs](http://docs.datastax.com/en/developer/java-driver/3.11/index.html) or via the release tags,
+[e.g. 3.12.1](https://github.com/apache/cassandra-java-driver/tree/3.12.1).*
A modern, [feature-rich](manual/) and highly tunable Java client
library for Apache Cassandra (2.1+) and using exclusively Cassandra's binary protocol
-and Cassandra Query Language v3. _Use the [DataStax Enterprise Java driver][dse-driver]
+and Cassandra Query Language v3. _Use the [DataStax Enterprise Java Driver][dse-driver]
for better compatibility and support for DataStax Enterprise._
**Features:**
@@ -41,38 +40,32 @@ The driver contains the following modules:
- driver-core: the core layer.
- driver-mapping: the object mapper.
-- driver-extras: optional features for the Java driver.
+- driver-extras: optional features for the Java Driver.
- driver-examples: example applications using the other modules which are
only meant for demonstration purposes.
- driver-tests: tests for the java-driver.
**Useful links:**
-- JIRA (bug tracking): https://datastax-oss.atlassian.net/browse/JAVA
-- MAILING LIST: https://groups.google.com/a/lists.datastax.com/forum/#!forum/java-driver-user
-- DATASTAX ACADEMY SLACK: #datastax-drivers on https://academy.datastax.com/slack
-- TWITTER: [@dsJavaDriver](https://twitter.com/dsJavaDriver) tweets Java
- driver releases and important announcements (low frequency).
- [@DataStaxEng](https://twitter.com/datastaxeng) has more news including
- other drivers, Cassandra, and DSE.
-- DOCS: the [manual](http://docs.datastax.com/en/developer/java-driver/3.5/manual/) has quick
+- JIRA (bug tracking): https://issues.apache.org/jira/projects/CASSJAVA
+- MAILING LIST: https://cassandra.apache.org/_/community.html#discussions
+- DOCS: the [manual](http://docs.datastax.com/en/developer/java-driver/3.11/manual/) has quick
start material and technical details about the driver and its features.
-- API: http://www.datastax.com/drivers/java/3.5
-- GITHUB REPOSITORY: https://github.com/datastax/java-driver
+- API: https://docs.datastax.com/en/drivers/java/3.11
+- GITHUB REPOSITORY: https://github.com/apache/cassandra-java-driver
- [changelog](changelog/)
-- [binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.6.0.tar.gz)
## Getting the driver
The last release of the driver is available on Maven Central. You can install
it in your application using the following Maven dependency (_if
-using DataStax Enterprise, install the [DataStax Enterprise Java driver][dse-driver] instead_):
+using DataStax Enterprise, install the [DataStax Enterprise Java Driver][dse-driver] instead_):
```xml
- com.datastax.cassandra
+ org.apache.cassandracassandra-driver-core
- 3.6.0
+ 3.12.1
```
@@ -80,9 +73,9 @@ Note that the object mapper is published as a separate artifact:
```xml
- com.datastax.cassandra
+ org.apache.cassandracassandra-driver-mapping
- 3.6.0
+ 3.12.1
```
@@ -90,9 +83,9 @@ The 'extras' module is also published as a separate artifact:
```xml
- com.datastax.cassandra
+ org.apache.cassandracassandra-driver-extras
- 3.6.0
+ 3.12.1
```
@@ -101,53 +94,37 @@ We also provide a [shaded JAR](manual/shaded_jar/)
to avoid the explicit dependency to Netty.
If you can't use a dependency management tool, a
-[binary tarball](http://downloads.datastax.com/java-driver/cassandra-java-driver-3.6.0.tar.gz)
+[binary tarball](https://cassandra.apache.org/_/download.html)
is available for download.
## Compatibility
-The Java client driver 3.6.0 ([branch 3.x](https://github.com/datastax/java-driver/tree/3.x)) is compatible with Apache
-Cassandra 2.1, 2.2 and 3.0+ (see [this page](http://docs.datastax.com/en/developer/java-driver/latest/manual/native_protocol/) for
+The Java client driver 3.12.1 ([branch 3.x](https://github.com/apache/cassandra-java-driver/tree/3.x)) is compatible with Apache
+Cassandra 2.1, 2.2 and 3.0+ (see [this page](http://docs.datastax.com/en/developer/java-driver/3.11/manual/native_protocol/) for
the most up-to-date compatibility information).
UDT and tuple support is available only when using Apache Cassandra 2.1 or higher (see [CQL improvements in Cassandra 2.1](http://www.datastax.com/dev/blog/cql-in-2-1)).
Other features are available only when using Apache Cassandra 2.0 or higher (e.g. result set paging,
-[BatchStatement](https://github.com/datastax/java-driver/blob/3.x/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java),
+[BatchStatement](https://github.com/apache/cassandra-java-driver/blob/3.x/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java),
[lightweight transactions](http://www.datastax.com/documentation/cql/3.1/cql/cql_using/use_ltweight_transaction_t.html)
-- see [What's new in Cassandra 2.0](http://www.datastax.com/documentation/cassandra/2.0/cassandra/features/features_key_c.html)).
Trying to use these with a cluster running Cassandra 1.2 will result in
-an [UnsupportedFeatureException](https://github.com/datastax/java-driver/blob/3.x/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnsupportedFeatureException.java) being thrown.
+an [UnsupportedFeatureException](https://github.com/apache/cassandra-java-driver/blob/3.x/driver-core/src/main/java/com/datastax/driver/core/exceptions/UnsupportedFeatureException.java) being thrown.
The java driver supports Java JDK versions 6 and above.
-If using _DataStax Enterprise_, the [DataStax Enterprise Java driver][dse-driver] provides
-more features and better compatibility.
-
-__Disclaimer__: Some _DataStax/DataStax Enterprise_ products might partially work on
-big-endian systems, but _DataStax_ does not officially support these systems.
-
## Upgrading from previous versions
If you are upgrading from a previous version of the driver, be sure to have a look at
the [upgrade guide](/upgrade_guide/).
-If you are upgrading to _DataStax Enterprise_, use the [DataStax Enterprise Java driver][dse-driver] for more
-features and better compatibility.
-
-## License
-Copyright 2012-2018, DataStax
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
+----
-http://www.apache.org/licenses/LICENSE-2.0
+Apache Cassandra, Apache, Tomcat, Lucene, Solr, Hadoop, Spark, TinkerPop, and Cassandra are
+trademarks of the [Apache Software Foundation](http://www.apache.org/) or its subsidiaries in
+Canada, the United States and/or other countries.
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-[dse-driver]: http://docs.datastax.com/en/developer/java-driver-dse/latest
+Binary artifacts of this product bundle Java Native Runtime libraries, which is available under the Eclipse Public License version 2.0.
diff --git a/build.yaml b/build.yaml
deleted file mode 100644
index 58442c8321d..00000000000
--- a/build.yaml
+++ /dev/null
@@ -1,95 +0,0 @@
-schedules:
- commit:
- # Run short suite on commit with enough C* versions to get full protocol version coverage.
- schedule: per_commit
- matrix:
- exclude:
- # Exclude all builds on old jdk versions
- - java: ['openjdk6','openjdk7']
- # Exclude java8 with all versions except latest
- - java: openjdk8
- cassandra: ['2.2', '3.0']
- # Exclude java11 with all versions except latest
- - java: openjdk11
- cassandra: ['2.1', '2.2', '3.0']
- env_vars: |
- TEST_GROUP="short"
- disable_commit_status: true
- disable_pull_requests: true
- notify:
- slack: java-driver-dev-bots
- nightly:
- # Run full suite nightly on change for all primary branches if they have changes.
- schedule: nightly
- branches:
- # regex matches primary branch format (2.1, 3.x, 3.0.x, 3.1.x, etc).
- include: ["/\\d+(\\.[\\dx]+)+/"]
- env_vars: |
- TEST_GROUP="long"
- disable_commit_status: true
- disable_pull_requests: true
- notify:
- slack: java-driver-dev-bots
- adhoc:
- # Adhoc job for non-primary braches that doesn't have a schedule but may be used to run all configs.
- schedule: adhoc
- branches:
- # regex matches primary branch format (2.1, 3.x, 3.0.x, 3.1.x, etc).
- exclude: ["/\\d+(\\.[\\dx]+)+/"]
- env_vars: |
- TEST_GROUP="long"
- disable_commit_status: true
- disable_pull_requests: true
- notify:
- slack: java-driver-dev-bots
-java:
- - openjdk6
- - openjdk7
- - openjdk8
- - openjdk11
-os:
- - ubuntu/bionic64/java-driver
-cassandra:
- - '2.1'
- - '2.2'
- - '3.0'
- - '3.11'
-build:
- - script: |
- . /usr/local/bin/jdk_switcher.sh
- jdk_switcher use openjdk8
- export MAVEN_HOME=/home/jenkins/.mvn/apache-maven-3.2.5
- export PATH=$MAVEN_HOME/bin:$PATH
- mvn -B -V install -DskipTests
- - script: |
- . /usr/local/bin/jdk_switcher.sh
- jdk_switcher use $JAVA_VERSION
- - type: maven
- version: 3.2.5
- goals: verify --fail-never -P$TEST_GROUP
- properties: |
- com.datastax.driver.TEST_BASE_NODE_WAIT=120
- com.datastax.driver.NEW_NODE_DELAY_SECONDS=100
- cassandra.version=$CCM_CASSANDRA_VERSION
- ccm.java.home=$CCM_JAVA_HOME
- ccm.path=$CCM_JAVA_HOME/bin
- ccm.maxNumberOfNodes=3
- failIfNoTests=false
- maven.test.failure.ignore=true
- maven.javadoc.skip=true
- - type: maven
- version: 3.2.5
- goals: verify --fail-never -Pisolated
- properties: |
- com.datastax.driver.TEST_BASE_NODE_WAIT=120
- com.datastax.driver.NEW_NODE_DELAY_SECONDS=100
- cassandra.version=$CCM_CASSANDRA_VERSION
- ccm.java.home=$CCM_JAVA_HOME
- ccm.path=$CCM_JAVA_HOME/bin
- ccm.maxNumberOfNodes=3
- failIfNoTests=false
- maven.test.failure.ignore=true
- maven.javadoc.skip=true
- - xunit:
- - "**/target/surefire-reports/TEST-*.xml"
- - "**/target/failsafe-reports/TEST-*.xml"
diff --git a/changelog/README.md b/changelog/README.md
index 1f00268b898..c8c12cffdbf 100644
--- a/changelog/README.md
+++ b/changelog/README.md
@@ -1,14 +1,137 @@
+
+
## Changelog
-### 3.7.0 (In progress)
+
+
+## 3.12.1
+- [improvement] CASSJAVA-55: Remove setting "Host" header for metadata requests.
+- [bug] JAVA-3125: Match broadcast RPC for control connection and Astra events
+
+## 3.12.0
+- [improvement] CASSANDRA-18971: Switch all archs to netty-tcnative-boringssl-static
+- [improvement] CASSJAVA-58: Update 3.x DRIVER_NAME to match 4.x Java driver
+
+## 3.11.5
+- [improvement] JAVA-3114: Shade io.dropwizard.metrics:metrics-core in shaded driver
+- [improvement] JAVA-3115: SchemaChangeListener#onKeyspaceChanged can fire when keyspace has not changed if using SimpleStrategy replication
+
+## 3.11.4
+- [improvement] JAVA-3079: Upgrade Netty to 4.1.94, 3.x edition
+- [improvement] JAVA-3082: Fix maven build for Apple-silicon
+- [improvement] PR 1671: Fix LatencyAwarePolicy scale docstring
+
+## 3.11.3
+- [improvement] JAVA-3023: Upgrade Netty to 4.1.77, 3.x edition
+
+
+## 3.11.2
+- [improvement] JAVA-3008: Upgrade Netty to 4.1.75, 3.x edition
+- [improvement] JAVA-2984: Upgrade Jackson to resolve high-priority CVEs
+
+
+## 3.11.1
+- [bug] JAVA-2967: Support native transport peer information for DSE 6.8.
+- [bug] JAVA-2976: Support missing protocol v5 error codes CAS_WRITE_UNKNOWN, CDC_WRITE_FAILURE.
+
+
+## 3.11.0
+
+- [improvement] JAVA-2705: Remove protocol v5 beta status, add v6-beta.
+- [bug] JAVA-2923: Detect and use Guava's new HostAndPort.getHost method.
+- [bug] JAVA-2922: Switch to modern framing format inside a channel handler.
+- [bug] JAVA-2924: Consider protocol version unsupported when server requires USE_BETA flag for it.
+
+
+## 3.10.2
+
+- [bug] JAVA-2860: Avoid NPE if channel initialization crashes.
+
+
+## 3.10.1
+
+- [bug] JAVA-2857: Fix NPE when built statements without parameters are logged at TRACE level.
+- [bug] JAVA-2843: Successfully parse DSE table schema in OSS driver.
+
+
+## 3.10.0
+
+- [improvement] JAVA-2676: Don't reschedule flusher after empty runs.
+- [new feature] JAVA-2772: Support new protocol v5 message format.
+
+
+## 3.9.0
+
+- [bug] JAVA-2627: Avoid logging error message including stack trace in request handler.
+- [new feature] JAVA-2706: Add now_in_seconds to protocol v5 query messages.
+- [improvement] JAVA-2730: Add support for Cassandra® 4.0 table options
+- [improvement] JAVA-2702: Transient Replication Support for Cassandra® 4.0
+
+
+## 3.8.0
+
+- [new feature] JAVA-2356: Support for DataStax Cloud API.
+- [improvement] JAVA-2483: Allow to provide secure bundle via URL.
+- [improvement] JAVA-2499: Allow to read the secure bundle from an InputStream.
+- [improvement] JAVA-2457: Detect CaaS and change default consistency.
+- [improvement] JAVA-2485: Add errors for Cloud misconfiguration.
+- [documentation] JAVA-2504: Migrate Cloud "getting started" page to driver manual.
+- [improvement] JAVA-2516: Enable hostname validation with Cloud
+- [bug] JAVA-2515: NEW_NODE and REMOVED_NODE events should trigger ADDED and REMOVED.
+
+
+### 3.7.2
+
+- [bug] JAVA-2249: Stop stripping trailing zeros in ByteOrderedTokens.
+- [bug] JAVA-1492: Don't immediately reuse busy connections for another request.
+- [bug] JAVA-2198: Handle UDTs with names that clash with collection types.
+- [bug] JAVA-2204: Avoid memory leak when client holds onto a stale TableMetadata instance.
+
+
+### 3.7.1
+
+- [bug] JAVA-2174: Metadata.needsQuote should accept empty strings.
+- [bug] JAVA-2193: Fix flaky tests in WarningsTest.
+
+
+### 3.7.0
-- [improvement] JAVA-2025: Include exception message in Abstract*Codec.accepts(null).
- [improvement] JAVA-2025: Include exception message in Abstract\*Codec.accepts(null).
- [improvement] JAVA-1980: Use covariant return types in RemoteEndpointAwareJdkSSLOptions.Builder methods.
- [documentation] JAVA-2062: Document frozen collection preference with Mapper.
- [bug] JAVA-2071: Fix NPE in ArrayBackedRow.toString().
- [bug] JAVA-2070: Call onRemove instead of onDown when rack and/or DC information changes for a host.
- [improvement] JAVA-1256: Log parameters of BuiltStatement in QueryLogger.
+- [documentation] JAVA-2074: Document preference for LZ4 over Snappy.
+- [bug] JAVA-1612: Include netty-common jar in binary tarball.
+- [improvement] JAVA-2003: Simplify CBUtil internal API to improve performance.
+- [improvement] JAVA-2002: Reimplement TypeCodec.accepts to improve performance.
+- [documentation] JAVA-2041: Deprecate cross-DC failover in DCAwareRoundRobinPolicy.
+- [documentation] JAVA-1159: Document workaround for using tuple with udt field in Mapper.
+- [documentation] JAVA-1964: Complete remaining "Coming Soon" sections in docs.
+- [improvement] JAVA-1950: Log server side warnings returned from a query.
+- [improvement] JAVA-2123: Allow to use QueryBuilder for building queries against Materialized Views.
+- [bug] JAVA-2082: Avoid race condition during cluster close and schema refresh.
### 3.6.0
diff --git a/ci/appveyor.ps1 b/ci/appveyor.ps1
index bc1d95b69f7..c0db375e05c 100644
--- a/ci/appveyor.ps1
+++ b/ci/appveyor.ps1
@@ -1,3 +1,22 @@
+<#
+ # Licensed to the Apache Software Foundation (ASF) under one
+ # or more contributor license agreements. See the NOTICE file
+ # distributed with this work for additional information
+ # regarding copyright ownership. The ASF licenses this file
+ # to you under the Apache License, Version 2.0 (the
+ # "License"); you may not use this file except in compliance
+ # with the License. You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing,
+ # software distributed under the License is distributed on an
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ # KIND, either express or implied. See the License for the
+ # specific language governing permissions and limitations
+ # under the License.
+ #>
+
Add-Type -AssemblyName System.IO.Compression.FileSystem
$dep_dir="C:\Users\appveyor\deps"
diff --git a/ci/appveyor.yml b/ci/appveyor.yml
index 81dd5b01958..bd621defb76 100644
--- a/ci/appveyor.yml
+++ b/ci/appveyor.yml
@@ -1,3 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
environment:
test_profile: default
matrix:
diff --git a/ci/create-user.sh b/ci/create-user.sh
new file mode 100644
index 00000000000..fb193df9a00
--- /dev/null
+++ b/ci/create-user.sh
@@ -0,0 +1,60 @@
+#!/bin/bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+################################
+#
+# Prep
+#
+################################
+
+if [ "$1" == "-h" ]; then
+ echo "$0 [-h] "
+ echo " this script is used internally by other scripts in the same directory to create a user with the running host user's same uid and gid"
+ exit 1
+fi
+
+# arguments
+username=$1
+uid=$2
+gid=$3
+BUILD_HOME=$4
+
+################################
+#
+# Main
+#
+################################
+
+# disable git directory ownership checks
+su ${username} -c "git config --global safe.directory '*'"
+
+if grep "^ID=" /etc/os-release | grep -q 'debian\|ubuntu' ; then
+ deluser docker
+ adduser --quiet --disabled-login --no-create-home --uid $uid --gecos ${username} ${username}
+ groupmod --non-unique -g $gid $username
+ gpasswd -a ${username} sudo >/dev/null
+else
+ adduser --no-create-home --uid $uid ${username}
+fi
+
+# sudo priviledges
+echo "${username} ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/${username}
+chmod 0440 /etc/sudoers.d/${username}
+
+# proper permissions
+chown -R ${username}:${username} /home/docker
+chmod og+wx ${BUILD_HOME}
\ No newline at end of file
diff --git a/ci/run-tests.sh b/ci/run-tests.sh
new file mode 100755
index 00000000000..b1bf201442b
--- /dev/null
+++ b/ci/run-tests.sh
@@ -0,0 +1,9 @@
+#!/bin/bash -x
+
+. ~/env.txt
+printenv | sort
+cd $(dirname "$(readlink -f "$0")")/..
+mvn -B -V install -DskipTests -Dmaven.javadoc.skip=true
+jabba use ${TEST_JAVA_VERSION}
+printenv | sort
+mvn -B -V verify -T 1 -Dcassandra.version=${SERVER_VERSION} -Ddse=false -Dmaven.test.failure.ignore=true -Dmaven.javadoc.skip=true;
diff --git a/ci/uploadtests.ps1 b/ci/uploadtests.ps1
index cf88b16229c..aaf7279ed46 100644
--- a/ci/uploadtests.ps1
+++ b/ci/uploadtests.ps1
@@ -1,3 +1,22 @@
+<#
+ # Licensed to the Apache Software Foundation (ASF) under one
+ # or more contributor license agreements. See the NOTICE file
+ # distributed with this work for additional information
+ # regarding copyright ownership. The ASF licenses this file
+ # to you under the Apache License, Version 2.0 (the
+ # "License"); you may not use this file except in compliance
+ # with the License. You may obtain a copy of the License at
+ #
+ # http://www.apache.org/licenses/LICENSE-2.0
+ #
+ # Unless required by applicable law or agreed to in writing,
+ # software distributed under the License is distributed on an
+ # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ # KIND, either express or implied. See the License for the
+ # specific language governing permissions and limitations
+ # under the License.
+ #>
+
$testResults=Get-ChildItem TEST-TestSuite.xml -Recurse
Write-Host "Uploading test results."
diff --git a/clirr-ignores.xml b/clirr-ignores.xml
index e7c34ac458c..271bd6f7773 100644
--- a/clirr-ignores.xml
+++ b/clirr-ignores.xml
@@ -1,3 +1,23 @@
+
+
+
com/datastax/driver/core/FrameCompressor$LZ4Compressor
@@ -158,5 +177,198 @@
*Relaxed parameters from List to Iterable for in, lt, lte, eq, gt, and gte
-
+
+ 7005
+ com/datastax/driver/core/exceptions/AlreadyExistsException
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/AuthenticationException
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/BootstrappingException
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/BusyConnectionException
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/BusyPoolException
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 6001
+ com/datastax/driver/core/exceptions/ConnectionException
+ address
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/ConnectionException
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7012
+ com/datastax/driver/core/exceptions/CoordinatorException
+ com.datastax.driver.core.EndPoint getEndPoint()
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/FunctionExecutionException
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/InvalidConfigurationInQueryException
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/InvalidQueryException
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/OperationTimedOutException
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/OperationTimedOutException
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/OverloadedException
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/ProtocolError
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/QueryConsistencyException
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/ReadFailureException
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/ReadTimeoutException
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/ServerError
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/SyntaxError
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/TransportException
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/TruncateException
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/UnauthorizedException
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/UnavailableException
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/UnpreparedException
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/UnsupportedProtocolVersionException
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/WriteFailureException
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
+
+ 7005
+ com/datastax/driver/core/exceptions/WriteTimeoutException
+ *java.net.InetSocketAddress*
+ *com.datastax.driver.core.EndPoint*
+ JAVA-2355: Abstract connection information into new EndPoint type for sni support
+
diff --git a/docs.yaml b/docs.yaml
index b38b86397d7..4b30dcd5813 100644
--- a/docs.yaml
+++ b/docs.yaml
@@ -1,3 +1,20 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
title: Java Driver for Apache Cassandra
summary: High performance Java client for Apache Cassandra
homepage: http://datastax.github.io/java-driver/
@@ -33,7 +50,7 @@ sections:
files: 'faq/**/*.md'
links:
- title: Code
- href: https://github.com/datastax/java-driver/
+ href: https://github.com/apache/cassandra-java-driver/
- title: Docs
href: http://docs.datastax.com/en/developer/java-driver/
- title: Issues
diff --git a/doxyfile b/doxyfile
index 414bdbd7ec4..d64c6fe1d82 100644
--- a/doxyfile
+++ b/doxyfile
@@ -1,10 +1,30 @@
+
+
+
# Doxyfile 1.8.10
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
-PROJECT_NAME = "DataStax Java Driver"
+PROJECT_NAME = "Java Driver"
PROJECT_NUMBER =
PROJECT_BRIEF =
PROJECT_LOGO =
@@ -333,4 +353,4 @@ MAX_DOT_GRAPH_DEPTH = 0
DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
-DOT_CLEANUP = YES
\ No newline at end of file
+DOT_CLEANUP = YES
diff --git a/driver-core/pom.xml b/driver-core/pom.xml
index c2bf48fbe17..45aff62c17d 100644
--- a/driver-core/pom.xml
+++ b/driver-core/pom.xml
@@ -1,12 +1,14 @@
-
+ com.datastax.shaded.*
+ com.datastax.shaded.metrics;*
@@ -261,6 +284,7 @@
io.netty:*
+ io.dropwizard.metrics:metrics-coreio.netty:netty-transport-native-epoll
@@ -271,6 +295,10 @@
io.nettycom.datastax.shaded.netty
+
+ com.codahale.metrics
+ com.datastax.shaded.metrics
+
@@ -287,6 +315,8 @@
META-INF/maven/io.netty/netty-handler/pom.xmlMETA-INF/maven/io.netty/netty-transport/pom.propertiesMETA-INF/maven/io.netty/netty-transport/pom.xml
+ META-INF/maven/io.dropwizard.metrics/metrics-core/pom.properties
+ META-INF/maven/io.dropwizard.metrics/metrics-core/pom.xml
diff --git a/driver-core/src/main/java/com/datastax/driver/core/AbstractAddressableByIndexData.java b/driver-core/src/main/java/com/datastax/driver/core/AbstractAddressableByIndexData.java
index ea05bf92f2e..689b41d0b25 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/AbstractAddressableByIndexData.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/AbstractAddressableByIndexData.java
@@ -1,11 +1,13 @@
/*
- * Copyright DataStax, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/driver-core/src/main/java/com/datastax/driver/core/AbstractData.java b/driver-core/src/main/java/com/datastax/driver/core/AbstractData.java
index 8013729f65d..8de0ad00037 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/AbstractData.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/AbstractData.java
@@ -1,11 +1,13 @@
/*
- * Copyright DataStax, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/driver-core/src/main/java/com/datastax/driver/core/AbstractGettableByIndexData.java b/driver-core/src/main/java/com/datastax/driver/core/AbstractGettableByIndexData.java
index 9d46e7c09f5..389aeea33e7 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/AbstractGettableByIndexData.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/AbstractGettableByIndexData.java
@@ -1,11 +1,13 @@
/*
- * Copyright DataStax, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/driver-core/src/main/java/com/datastax/driver/core/AbstractGettableData.java b/driver-core/src/main/java/com/datastax/driver/core/AbstractGettableData.java
index ec29ed7a17d..f6c32a34fb6 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/AbstractGettableData.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/AbstractGettableData.java
@@ -1,11 +1,13 @@
/*
- * Copyright DataStax, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/driver-core/src/main/java/com/datastax/driver/core/AbstractMonotonicTimestampGenerator.java b/driver-core/src/main/java/com/datastax/driver/core/AbstractMonotonicTimestampGenerator.java
index 4c84113526c..5c5548a748b 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/AbstractMonotonicTimestampGenerator.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/AbstractMonotonicTimestampGenerator.java
@@ -1,11 +1,13 @@
/*
- * Copyright DataStax, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/driver-core/src/main/java/com/datastax/driver/core/AbstractReconnectionHandler.java b/driver-core/src/main/java/com/datastax/driver/core/AbstractReconnectionHandler.java
index ec109b6f308..c559af07632 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/AbstractReconnectionHandler.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/AbstractReconnectionHandler.java
@@ -1,11 +1,13 @@
/*
- * Copyright DataStax, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -171,7 +173,7 @@ public void run() {
} else {
logger.error(
"Retries against {} have been suspended. It won't be retried unless the node is restarted.",
- e.getHost());
+ e.getEndPoint());
currentAttempt.compareAndSet(handlerFuture, null);
}
} catch (InterruptedException e) {
@@ -184,7 +186,7 @@ public void run() {
} else {
logger.error(
"Retries against {} have been suspended. It won't be retried unless the node is restarted.",
- e.getHost());
+ e.getEndPoint());
currentAttempt.compareAndSet(handlerFuture, null);
}
} catch (ClusterNameMismatchException e) {
@@ -195,7 +197,7 @@ public void run() {
} else {
logger.error(
"Retries against {} have been suspended. It won't be retried unless the node is restarted.",
- e.address.getAddress());
+ e.endPoint);
currentAttempt.compareAndSet(handlerFuture, null);
}
} catch (Exception e) {
diff --git a/driver-core/src/main/java/com/datastax/driver/core/AbstractSession.java b/driver-core/src/main/java/com/datastax/driver/core/AbstractSession.java
index 61de3414fd2..b99b1981c18 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/AbstractSession.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/AbstractSession.java
@@ -1,11 +1,13 @@
/*
- * Copyright DataStax, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/driver-core/src/main/java/com/datastax/driver/core/AbstractTableMetadata.java b/driver-core/src/main/java/com/datastax/driver/core/AbstractTableMetadata.java
index 5a375e2d958..2cdb9c52e46 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/AbstractTableMetadata.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/AbstractTableMetadata.java
@@ -1,11 +1,13 @@
/*
- * Copyright DataStax, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -258,14 +260,22 @@ protected StringBuilder appendOptions(StringBuilder sb, boolean formatted) {
sb.append("WITH ");
if (options.isCompactStorage()) and(sb.append("COMPACT STORAGE"), formatted);
if (!clusteringOrder.isEmpty()) and(appendClusteringOrder(sb), formatted);
- sb.append("read_repair_chance = ").append(options.getReadRepairChance());
- and(sb, formatted)
- .append("dclocal_read_repair_chance = ")
- .append(options.getLocalReadRepairChance());
+ if (cassandraVersion.getMajor() < 4)
+ sb.append("read_repair_chance = ").append(options.getReadRepairChance());
+ else sb.append("read_repair = '").append(options.getReadRepair()).append('\'');
+ if (cassandraVersion.getMajor() < 4)
+ and(sb, formatted)
+ .append("dclocal_read_repair_chance = ")
+ .append(options.getLocalReadRepairChance());
if (cassandraVersion.getMajor() < 2
|| (cassandraVersion.getMajor() == 2 && cassandraVersion.getMinor() == 0))
and(sb, formatted).append("replicate_on_write = ").append(options.getReplicateOnWrite());
and(sb, formatted).append("gc_grace_seconds = ").append(options.getGcGraceInSeconds());
+ if (cassandraVersion.getMajor() > 3)
+ and(sb, formatted)
+ .append("additional_write_policy = '")
+ .append(options.getAdditionalWritePolicy())
+ .append('\'');
and(sb, formatted)
.append("bloom_filter_fp_chance = ")
.append(options.getBloomFilterFalsePositiveChance());
diff --git a/driver-core/src/main/java/com/datastax/driver/core/AggregateMetadata.java b/driver-core/src/main/java/com/datastax/driver/core/AggregateMetadata.java
index 65b149e7542..15b95122d74 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/AggregateMetadata.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/AggregateMetadata.java
@@ -1,11 +1,13 @@
/*
- * Copyright DataStax, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ArrayBackedResultSet.java b/driver-core/src/main/java/com/datastax/driver/core/ArrayBackedResultSet.java
index 224dc252266..6728bc8d089 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ArrayBackedResultSet.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ArrayBackedResultSet.java
@@ -1,11 +1,13 @@
/*
- * Copyright DataStax, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -467,13 +469,13 @@ public void onSet(
// This mean we have probably have a bad node, so defunct the connection
connection.defunct(
new ConnectionException(
- connection.address,
+ connection.endPoint,
String.format("Got unexpected %s result response", rm.kind)));
future.setException(
new DriverInternalError(
String.format(
"Got unexpected %s result response from %s",
- rm.kind, connection.address)));
+ rm.kind, connection.endPoint)));
return;
}
@@ -482,26 +484,26 @@ public void onSet(
break;
case ERROR:
future.setException(
- ((Responses.Error) response).asException(connection.address));
+ ((Responses.Error) response).asException(connection.endPoint));
break;
default:
// This mean we have probably have a bad node, so defunct the connection
connection.defunct(
new ConnectionException(
- connection.address,
+ connection.endPoint,
String.format("Got unexpected %s response", response.type)));
future.setException(
new DriverInternalError(
String.format(
"Got unexpected %s response from %s",
- response.type, connection.address)));
+ response.type, connection.endPoint)));
break;
}
} catch (RuntimeException e) {
// If we get a bug here, the client will not get it, so better forwarding the error
future.setException(
new DriverInternalError(
- "Unexpected error while processing response from " + connection.address,
+ "Unexpected error while processing response from " + connection.endPoint,
e));
}
}
diff --git a/driver-core/src/main/java/com/datastax/driver/core/ArrayBackedRow.java b/driver-core/src/main/java/com/datastax/driver/core/ArrayBackedRow.java
index 8e7028035ed..22aa4fdca62 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/ArrayBackedRow.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/ArrayBackedRow.java
@@ -1,11 +1,13 @@
/*
- * Copyright DataStax, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/driver-core/src/main/java/com/datastax/driver/core/AtomicMonotonicTimestampGenerator.java b/driver-core/src/main/java/com/datastax/driver/core/AtomicMonotonicTimestampGenerator.java
index f20b34e5451..804b991ead4 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/AtomicMonotonicTimestampGenerator.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/AtomicMonotonicTimestampGenerator.java
@@ -1,11 +1,13 @@
/*
- * Copyright DataStax, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/driver-core/src/main/java/com/datastax/driver/core/AuthProvider.java b/driver-core/src/main/java/com/datastax/driver/core/AuthProvider.java
index 5a47debf1cd..b623f901468 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/AuthProvider.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/AuthProvider.java
@@ -1,11 +1,13 @@
/*
- * Copyright DataStax, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -31,17 +33,7 @@ public interface AuthProvider {
*
*
This is only useful as a placeholder when no authentication is to be used.
*/
- public static final AuthProvider NONE =
- new AuthProvider() {
- @Override
- public Authenticator newAuthenticator(InetSocketAddress host, String authenticator) {
- throw new AuthenticationException(
- host,
- String.format(
- "Host %s requires authentication, but no authenticator found in Cluster configuration",
- host));
- }
- };
+ AuthProvider NONE = new ExtendedAuthProvider.NoAuthProvider();
/**
* The {@code Authenticator} to use when connecting to {@code host}
@@ -52,4 +44,19 @@ public Authenticator newAuthenticator(InetSocketAddress host, String authenticat
*/
public Authenticator newAuthenticator(InetSocketAddress host, String authenticator)
throws AuthenticationException;
+
+ /**
+ * Dummy Authenticator that accounts for DSE authentication configured with transitional mode.
+ *
+ *
In this situation, the client is allowed to connect without authentication, but DSE would
+ * still send an AUTHENTICATE response. This Authenticator handles this situation by sending back
+ * a dummy credential.
+ */
+ class TransitionalModePlainTextAuthenticator
+ extends PlainTextAuthProvider.PlainTextAuthenticator {
+
+ public TransitionalModePlainTextAuthenticator() {
+ super("", "");
+ }
+ }
}
diff --git a/driver-core/src/main/java/com/datastax/driver/core/Authenticator.java b/driver-core/src/main/java/com/datastax/driver/core/Authenticator.java
index 00e2a48279a..29d85b2386c 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/Authenticator.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/Authenticator.java
@@ -1,11 +1,13 @@
/*
- * Copyright DataStax, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java b/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java
index ef8cd34800f..22ff7594e91 100644
--- a/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java
+++ b/driver-core/src/main/java/com/datastax/driver/core/BatchStatement.java
@@ -1,11 +1,13 @@
/*
- * Copyright DataStax, Inc.
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -21,9 +23,7 @@
import com.google.common.collect.ImmutableList;
import java.nio.ByteBuffer;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Collection;
-import java.util.Collections;
import java.util.List;
/**
@@ -82,22 +82,23 @@ public BatchStatement(Type batchType) {
IdAndValues getIdAndValues(ProtocolVersion protocolVersion, CodecRegistry codecRegistry) {
IdAndValues idAndVals = new IdAndValues(statements.size());
- for (Statement statement : statements) {
- if (statement instanceof StatementWrapper)
+ for (int i = 0; i < statements.size(); i++) {
+ Statement statement = statements.get(i);
+ if (statement instanceof StatementWrapper) {
statement = ((StatementWrapper) statement).getWrappedStatement();
+ }
if (statement instanceof RegularStatement) {
RegularStatement st = (RegularStatement) statement;
ByteBuffer[] vals = st.getValues(protocolVersion, codecRegistry);
String query = st.getQueryString(codecRegistry);
idAndVals.ids.add(query);
- idAndVals.values.add(
- vals == null ? Collections.emptyList() : Arrays.asList(vals));
+ idAndVals.values[i] = vals == null ? Requests.EMPTY_BB_ARRAY : vals;
} else {
// We handle BatchStatement in add() so ...
assert statement instanceof BoundStatement;
BoundStatement st = (BoundStatement) statement;
idAndVals.ids.add(st.statement.getPreparedId().boundValuesMetadata.id);
- idAndVals.values.add(Arrays.asList(st.wrapper.values));
+ idAndVals.values[i] = st.wrapper.values;
}
}
return idAndVals;
@@ -212,7 +213,7 @@ public int requestSizeInBytes(ProtocolVersion protocolVersion, CodecRegistry cod
+ (q instanceof String
? CBUtil.sizeOfLongString((String) q)
: CBUtil.sizeOfShortBytes(((MD5Digest) q).bytes));
- size += CBUtil.sizeOfValueList(idAndVals.values.get(i));
+ size += CBUtil.sizeOfValueList(idAndVals.values[i]);
}
switch (protocolVersion) {
case V2:
@@ -221,6 +222,7 @@ public int requestSizeInBytes(ProtocolVersion protocolVersion, CodecRegistry cod
case V3:
case V4:
case V5:
+ case V6:
size += CBUtil.sizeOfConsistencyLevel(getConsistencyLevel());
size += QueryFlag.serializedSize(protocolVersion);
// Serial CL and default timestamp also depend on session-level defaults (QueryOptions).
@@ -301,11 +303,11 @@ void ensureAllSet() {
static class IdAndValues {
public final List