diff --git a/.github/workflows/ci-integration.yml b/.github/workflows/ci-integration.yml index 14b40ac3..c8ea4d8e 100644 --- a/.github/workflows/ci-integration.yml +++ b/.github/workflows/ci-integration.yml @@ -28,6 +28,10 @@ jobs: strategy: fail-fast: false matrix: + java: + - '11' + - '17' + - '21' cassandra: - cassandra_version: 3.0.27 ccm_version: 3.0.27 @@ -41,12 +45,13 @@ jobs: - cassandra_version: dse-5.1 ccm_version: 5.1.31 is_dse: true - - cassandra_version: dse-6.0 - ccm_version: 6.0.18 - is_dse: true - - cassandra_version: dse-6.7 - ccm_version: 6.7.17 - is_dse: true + # DSE 6.0 and 6.7 are commented out because they are EOL and no longer supported by DataStax/IBM + #- cassandra_version: dse-6.0 + # ccm_version: 6.0.18 + # is_dse: true + #- cassandra_version: dse-6.7 + # ccm_version: 6.7.17 + # is_dse: true - cassandra_version: dse-6.8 ccm_version: 6.8.24 is_dse: true @@ -62,10 +67,10 @@ jobs: run: | export JDK8_PATH=$JAVA_HOME echo "JDK8_PATH=$JDK8_PATH" >> $GITHUB_ENV - - name: Set up JDK 11 + - name: Set up JDK ${{ matrix.java }} uses: actions/setup-java@v2 with: - java-version: 11 + java-version: ${{ matrix.java }} distribution: 'temurin' - name: Pre set up Python run: | @@ -84,15 +89,24 @@ jobs: cache: 'pip' allow-build: info cache-build: true + - name: Generate installation token for CCM private + if: ${{ matrix.cassandra.is_dse }} + id: generate-token + uses: actions/create-github-app-token@v2 + with: + app-id: ${{ vars.RIPTANO_CCM_PRIVATE_APP_ID }} + private-key: ${{ secrets.RIPTANO_CCM_APP_PRIVATE_KEY }} + owner: riptano + repositories: ccm-private - name: Setup CCM private if: ${{ matrix.cassandra.is_dse }} env: - CLONE_RIPTANO_CCM_SECRET: ${{secrets.CLONE_RIPTANO_CCM_SECRET}} + CLONE_RIPTANO_CCM_SECRET: ${{ steps.generate-token.outputs.token }} run: | #!/bin/bash set -e echo "Cloning the repo" - git clone https://${CLONE_RIPTANO_CCM_SECRET}:x-oauth-basic@github.com/riptano/ccm-private.git + git clone https://x-access-token:${CLONE_RIPTANO_CCM_SECRET}@github.com/riptano/ccm-private.git cd ccm-private echo "pip install requirements" pip install -r requirements.txt @@ -103,6 +117,24 @@ jobs: run: | #!/bin/bash pip install ccm + - name: Configure CCM for DSE + if: ${{ matrix.cassandra.is_dse }} + env: + DSE_USERNAME: ${{ secrets.DSE_USERNAME }} + DSE_PASSWORD: ${{ secrets.DSE_PASSWORD }} + run: | + mkdir -p ~/.ccm + + cat < ~/.ccm/config + [repositories] + dse = https://na.artifactory.swg-devops.com/artifactory/datastax-team-dse-packages-release-generic-local/dse-%s-bin.tar.gz + EOF + + cat < ~/.ccm/.dse.ini + [dse_credentials] + dse_username = $DSE_USERNAME + dse_password = $DSE_PASSWORD + EOF - name: Cache local Maven repository uses: actions/cache@v4 with: @@ -111,7 +143,7 @@ jobs: restore-keys: | ${{ runner.os }}-maven- - - name: Build with JDK 11 + - name: Build with JDK ${{ matrix.java }} run: mvn -B clean install -DskipTests - name: Run integration tests diff --git a/.github/workflows/github-ci.yml b/.github/workflows/github-ci.yml index 3869735a..7fc7f9bc 100644 --- a/.github/workflows/github-ci.yml +++ b/.github/workflows/github-ci.yml @@ -16,6 +16,7 @@ jobs: matrix: java: - '11' + - '21' steps: - uses: actions/checkout@v2 diff --git a/dist/pom.xml b/dist/pom.xml index 56d48e04..1dd71f8e 100644 --- a/dist/pom.xml +++ b/dist/pom.xml @@ -88,7 +88,7 @@ META-INF/io.netty.versions.properties - + diff --git a/pom.xml b/pom.xml index bcaa1293..67ba7061 100644 --- a/pom.xml +++ b/pom.xml @@ -45,12 +45,12 @@ 2.6.2 3.25.6 4.16.0 - 1.10.0 + 1.11.1 1.0.4 25.1-jre 1.7.36 1.2.13 - 5.4.1 + 5.10.2 3.14.0 2.18.3 2.25.0 @@ -270,11 +270,6 @@ kafka-schema-registry-client-encryption-hcvault ${confluent.version} - - io.confluent - kafka-schema-registry-client-encryption-hcvault - ${confluent.version} - com.amazonaws aws-java-sdk-core @@ -464,7 +459,7 @@ limitations under the License.]]> org.jacoco jacoco-maven-plugin - 0.8.6 + 0.8.14 unit-tests-coverage @@ -659,10 +654,104 @@ limitations under the License.]]> + + jdk21 + + [21,) + + + + + + maven-compiler-plugin + 3.15.0 + + ${java.version} + ${java.version} + ${java.release.version} + true + false + true + + -XDcompilePolicy=simple + -Xplugin:ErrorProne + -XDshould-stop.ifError=FLOW + -XDaddTypeAnnotationsToSymbol=true + -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED + + + + com.google.errorprone + error_prone_core + 2.49.0 + + + + + + + + + + jdk17 + + [16,21) + + + + + + maven-compiler-plugin + 3.15.0 + + ${java.version} + ${java.version} + ${java.release.version} + true + false + true + + -XDcompilePolicy=simple + -Xplugin:ErrorProne + -XDshould-stop.ifError=FLOW + -J--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED + -J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED + -J--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED + + + + com.google.errorprone + error_prone_core + + 2.42.0 + + + + + + + + jdk11 - [9..) + [9,16) diff --git a/sink/pom.xml b/sink/pom.xml index cab96307..6f3caeb6 100644 --- a/sink/pom.xml +++ b/sink/pom.xml @@ -71,10 +71,6 @@ io.confluent kafka-schema-registry-client-encryption-hcvault - - io.confluent - kafka-schema-registry-client-encryption-hcvault - com.google.protobuf protobuf-java diff --git a/sink/src/it/java/com/datastax/oss/kafka/sink/state/LifeCycleManagerIT.java b/sink/src/it/java/com/datastax/oss/kafka/sink/state/LifeCycleManagerIT.java index 8e239e53..c71c6404 100644 --- a/sink/src/it/java/com/datastax/oss/kafka/sink/state/LifeCycleManagerIT.java +++ b/sink/src/it/java/com/datastax/oss/kafka/sink/state/LifeCycleManagerIT.java @@ -93,9 +93,10 @@ void should_build_dse_session_with_unresolved_contact_points_when_hostname_valid assertThat(set).isNotNull(); // and endPoint uses unresolved DNS address EndPoint endPoint = getEndPoint(session); - assertThat(endPoint.toString()) - .isEqualTo(String.format("%s:%d", contactPointDns, ccm.getBinaryPort())); - assertTrue(((InetSocketAddress) endPoint.resolve()).isUnresolved()); + InetSocketAddress address = (InetSocketAddress) endPoint.resolve(); + assertThat(address.getHostString()).isEqualTo(contactPointDns); + assertThat(address.getPort()).isEqualTo(ccm.getBinaryPort()); + assertTrue(address.isUnresolved()); } } @@ -127,9 +128,10 @@ void should_build_dse_session_with_unresolved_contact_points_when_hostname_valid assertThat(set).isNotNull(); // and endPoint uses unresolved IP address EndPoint endPoint = getEndPoint(session); - assertThat(endPoint.toString()) - .isEqualTo(String.format("%s:%d", contactPointIp, ccm.getBinaryPort())); - assertTrue(((InetSocketAddress) endPoint.resolve()).isUnresolved()); + InetSocketAddress address = (InetSocketAddress) endPoint.resolve(); + assertThat(address.getHostString()).isEqualTo(contactPointIp); + assertThat(address.getPort()).isEqualTo(ccm.getBinaryPort()); + assertTrue(address.isUnresolved()); } } diff --git a/sink/src/main/java/com/datastax/oss/kafka/sink/CassandraSinkTask.java b/sink/src/main/java/com/datastax/oss/kafka/sink/CassandraSinkTask.java index 34280268..4c765b74 100644 --- a/sink/src/main/java/com/datastax/oss/kafka/sink/CassandraSinkTask.java +++ b/sink/src/main/java/com/datastax/oss/kafka/sink/CassandraSinkTask.java @@ -105,7 +105,7 @@ private class SinkTaskProcessorImpl extends AbstractSinkTask { /** * Handle a failed record. * - * @param record the {@link SinkRecord} that failed to process + * @param abstractRecord the {@link SinkRecord} that failed to process * @param e the exception * @param cql the cql statement that failed to execute * @param failCounter the metric that keeps track of number of failures encountered