You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "frankgh (via GitHub)" <gi...@apache.org> on 2024/04/04 17:56:17 UTC
[PR] CASSANDRA-19528: Use a classloader to isolate in-jvm dtest classes in… [cassandra-analytics]
frankgh opened a new pull request, #50:
URL: https://github.com/apache/cassandra-analytics/pull/50
… integration test
Patch by Francisco Guerrero; Reviewed by TBD for CASSANDRA-19528
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org
Re: [PR] CASSANDRA-19528: Use a classloader to isolate in-jvm dtest classes in… [cassandra-analytics]
Posted by "frankgh (via GitHub)" <gi...@apache.org>.
frankgh commented on code in PR #50:
URL: https://github.com/apache/cassandra-analytics/pull/50#discussion_r1552180876
##########
cassandra-analytics-integration-framework/build.gradle:
##########
@@ -17,76 +17,87 @@
* under the License.
*/
-project(':cassandra-analytics-integration-framework') {
- apply(plugin: 'java-library')
- apply(plugin: 'com.github.johnrengelman.shadow')
-
- ext.dtestJar = System.getenv("DTEST_JAR") ?: "dtest-4.1.4.jar" // latest supported Cassandra build is 4.1
- def dtestJarFullPath = "${dependencyLocation}${ext.dtestJar}"
+plugins {
+ id('java-library')
+ id('maven-publish')
+}
- test {
- useJUnitPlatform()
- }
+java {
+ withJavadocJar()
+ withSourcesJar()
+}
- configurations {
- configureEach {
- resolutionStrategy {
- // Force set the vertx versions that do not depend on a newer jackson version
- force("io.vertx:vertx-web:${vertxVersion}")
- force("io.vertx:vertx-core:${vertxVersion}")
- force("io.vertx:vertx-auth-common:${vertxVersion}")
- force("io.vertx:vertx-dropwizard-metrics:${vertxVersion}")
- force("io.vertx:vertx-web-client:${vertxVersion}")
- }
+publishing {
+ publications {
+ maven(MavenPublication) {
+ from components.java
+ groupId project.group
+ artifactId "${archivesBaseName}"
+ version System.getenv("CODE_VERSION") ?: "${version}"
}
}
+}
+
+ext.dtestJar = System.getenv("DTEST_JAR") ?: "dtest-4.1.4.jar" // latest supported Cassandra build is 4.1
+def dtestJarFullPath = "${dependencyLocation}${ext.dtestJar}"
- dependencies {
+test {
+ useJUnitPlatform()
+}
- // These dependencies (sidecar + dtest jars) must be built by running `scripts/build-dependencies.sh`
- implementation(group: 'org.apache.cassandra.sidecar', name: 'common', version: "${sidecarVersion}")
- implementation(group: 'org.apache.cassandra.sidecar', name: 'adapters-base', version: "${sidecarVersion}")
- // The server itself
- implementation (group: "org.apache.cassandra", name: "cassandra-sidecar", version: "${sidecarVersion}") {
- exclude(group: 'org.apache.logging.log4j')
- exclude(group: 'org.slf4j')
- exclude(group: 'ch.qos.logback')
+configurations {
+ configureEach {
+ resolutionStrategy {
+ // Force set the vertx versions that do not depend on a newer jackson version
+ force("io.vertx:vertx-web:${vertxVersion}")
+ force("io.vertx:vertx-core:${vertxVersion}")
+ force("io.vertx:vertx-auth-common:${vertxVersion}")
+ force("io.vertx:vertx-dropwizard-metrics:${vertxVersion}")
+ force("io.vertx:vertx-web-client:${vertxVersion}")
}
+ }
+}
- File dtestJarFile = new File(dtestJarFullPath)
- assert dtestJarFile.exists()
- println("Using DTest jar: " + dtestJarFullPath)
- shadow(files("${dtestJarFullPath}"))
- shadow("org.apache.cassandra:dtest-api:0.0.16")
- // Needed by the Cassandra dtest framework
- // JUnit
- implementation("org.junit.jupiter:junit-jupiter-api:${project.junitVersion}")
- implementation("org.junit.jupiter:junit-jupiter-params:${project.junitVersion}")
- implementation("org.junit.jupiter:junit-jupiter-engine:${project.junitVersion}")
+dependencies {
+ // These dependencies (sidecar + dtest jars) must be built by running `scripts/build-dependencies.sh`
+ implementation(group: 'org.apache.cassandra.sidecar', name: 'adapters-base', version: "${sidecarVersion}")
+ implementation(group: 'org.apache.cassandra.sidecar', name: 'adapters-cassandra41', version: "${sidecarVersion}")
- implementation("org.junit.vintage:junit-vintage-engine:${junitVersion}")
- implementation('org.mockito:mockito-inline:4.10.0')
- implementation("org.assertj:assertj-core:3.24.2")
+ File dtestJarFile = new File(dtestJarFullPath)
+ println("Using DTest jar: " + dtestJarFullPath + "; present? " + dtestJarFile.exists())
+ compileOnly(files("${dtestJarFullPath}"))
Review Comment:
The dtest jar must be a compile-only dependency
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org
Re: [PR] CASSANDRA-19528: Use a classloader to isolate in-jvm dtest classes in… [cassandra-analytics]
Posted by "frankgh (via GitHub)" <gi...@apache.org>.
frankgh commented on code in PR #50:
URL: https://github.com/apache/cassandra-analytics/pull/50#discussion_r1552180157
##########
cassandra-analytics-integration-framework/src/main/java/org/apache/cassandra/distributed/impl/CassandraCluster.java:
##########
@@ -0,0 +1,339 @@
+/*
+ * 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.
+ */
+
+package org.apache.cassandra.distributed.impl;
+
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.Spliterator;
+import java.util.function.BiPredicate;
+import java.util.function.Consumer;
+import java.util.function.Predicate;
+import java.util.stream.Stream;
+
+import com.google.common.base.Preconditions;
+
+import com.vdurmont.semver4j.Semver;
+import org.apache.cassandra.distributed.UpgradeableCluster;
+import org.apache.cassandra.distributed.api.ICluster;
+import org.apache.cassandra.distributed.api.ICoordinator;
+import org.apache.cassandra.distributed.api.IInstance;
+import org.apache.cassandra.distributed.api.IInstanceConfig;
+import org.apache.cassandra.distributed.api.IMessage;
+import org.apache.cassandra.distributed.api.IMessageFilters;
+import org.apache.cassandra.distributed.api.IMessageSink;
+import org.apache.cassandra.distributed.api.TokenSupplier;
+import org.apache.cassandra.distributed.shared.ClusterUtils;
+import org.apache.cassandra.distributed.shared.Versions;
+import org.apache.cassandra.testing.ClusterBuilderConfiguration;
+import org.apache.cassandra.testing.IClusterExtension;
+import org.apache.cassandra.testing.TestTokenSupplier;
+import org.jetbrains.annotations.NotNull;
+
+import static org.apache.cassandra.distributed.shared.NetworkTopology.dcAndRack;
+import static org.apache.cassandra.distributed.shared.NetworkTopology.networkTopology;
+
+/**
+ * Implements the {@link IClusterExtension} interface, delegating the functionality to the
+ * {@link AbstractCluster delegate}. This class is meant to be loaded in a different classloader.
+ *
+ * @param <I> the type of the cluster instance
+ */
+public class CassandraCluster<I extends IInstance> implements IClusterExtension<I>
Review Comment:
all the interactions with the in-jvm classes are done through the CassandraCluster class.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org
Re: [PR] CASSANDRA-19528: Use a classloader to isolate in-jvm dtest classes in… [cassandra-analytics]
Posted by "frankgh (via GitHub)" <gi...@apache.org>.
frankgh merged PR #50:
URL: https://github.com/apache/cassandra-analytics/pull/50
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org
Re: [PR] CASSANDRA-19528: Use a classloader to isolate in-jvm dtest classes in… [cassandra-analytics]
Posted by "frankgh (via GitHub)" <gi...@apache.org>.
frankgh commented on code in PR #50:
URL: https://github.com/apache/cassandra-analytics/pull/50#discussion_r1552181382
##########
cassandra-analytics-integration-framework/src/main/java/org/apache/cassandra/sidecar/testing/QualifiedName.java:
##########
@@ -20,20 +20,28 @@
import java.util.Objects;
-import org.apache.cassandra.cql3.ColumnIdentifier;
Review Comment:
this is no longer available for us to use
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org