You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by GitBox <gi...@apache.org> on 2020/02/25 09:23:10 UTC

[GitHub] [cassandra-in-jvm-dtest-api] ifesdjeen opened a new pull request #1: Introduce the extracted in-JVM DTest API

ifesdjeen opened a new pull request #1: Introduce the extracted in-JVM DTest API
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/1
 
 
   Patch by Alex Petrov; reviewed by David Capwell for CASSANDRA-15539.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cassandra.apache.org
For additional commands, e-mail: dev-help@cassandra.apache.org


[GitHub] [cassandra-in-jvm-dtest-api] dcapwell commented on a change in pull request #1: Introduce the extracted in-JVM DTest API

Posted by GitBox <gi...@apache.org>.
dcapwell commented on a change in pull request #1: Introduce the extracted in-JVM DTest API
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/1#discussion_r384689479
 
 

 ##########
 File path: src/main/java/org/apache/cassandra/distributed/shared/NetworkTopology.java
 ##########
 @@ -0,0 +1,216 @@
+/*
+ * 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.shared;
+
+import java.io.Serializable;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.IntFunction;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+public class NetworkTopology
+{
+    private final Map<AddressAndPort, DcAndRack> map;
+
+    public static class DcAndRack
+    {
+        private final String dc;
+        private final String rack;
+
+        private DcAndRack(String dc, String rack)
+        {
+            this.dc = dc;
+            this.rack = rack;
+        }
+
+        @Override
+        public String toString()
+        {
+            return "DcAndRack{" +
+                   "dc='" + dc + '\'' +
+                   ", rack='" + rack + '\'' +
+                   '}';
+        }
+
+        @Override
+        public boolean equals(Object o)
+        {
+            if (this == o) return true;
+            if (o == null || getClass() != o.getClass()) return false;
+            DcAndRack dcAndRack = (DcAndRack) o;
+            return Objects.equals(dc, dcAndRack.dc) &&
+                   Objects.equals(rack, dcAndRack.rack);
+        }
+
+        @Override
+        public int hashCode()
+        {
+            return Objects.hash(dc, rack);
+        }
+    }
+
+    public static class AddressAndPort implements Serializable
 
 Review comment:
   I feel this should be top level

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cassandra.apache.org
For additional commands, e-mail: dev-help@cassandra.apache.org


[GitHub] [cassandra-in-jvm-dtest-api] dcapwell commented on a change in pull request #1: Introduce the extracted in-JVM DTest API

Posted by GitBox <gi...@apache.org>.
dcapwell commented on a change in pull request #1: Introduce the extracted in-JVM DTest API
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/1#discussion_r384679660
 
 

 ##########
 File path: pom.xml
 ##########
 @@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
 
 Review comment:
   for first release I am ok with 1 jar, but there will be a need to split this into multiple jars:  for example https://issues.apache.org/jira/browse/CASSANDRA-15602

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cassandra.apache.org
For additional commands, e-mail: dev-help@cassandra.apache.org


[GitHub] [cassandra-in-jvm-dtest-api] ifesdjeen commented on a change in pull request #1: Introduce the extracted in-JVM DTest API

Posted by GitBox <gi...@apache.org>.
ifesdjeen commented on a change in pull request #1: Introduce the extracted in-JVM DTest API
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/1#discussion_r395479861
 
 

 ##########
 File path: src/main/java/org/apache/cassandra/distributed/shared/Versions.java
 ##########
 @@ -0,0 +1,201 @@
+/*
+ * 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.shared;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.nio.file.Paths;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+public class Versions
 
 Review comment:
   This patch doesn't (or maybe even shouoldn't) change any behaviours to make it easier to debug imo. Let's leave it as is for now?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


[GitHub] [cassandra-in-jvm-dtest-api] dcapwell commented on a change in pull request #1: Introduce the extracted in-JVM DTest API

Posted by GitBox <gi...@apache.org>.
dcapwell commented on a change in pull request #1: Introduce the extracted in-JVM DTest API
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/1#discussion_r384686278
 
 

 ##########
 File path: src/main/java/org/apache/cassandra/distributed/api/IListen.java
 ##########
 @@ -0,0 +1,28 @@
+/*
+ * 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.api;
+
+public interface IListen
+{
+    public interface Cancel { void cancel(); }
 
 Review comment:
   nit: since IListen is public Cancel is already public, so don't need `public` here

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cassandra.apache.org
For additional commands, e-mail: dev-help@cassandra.apache.org


[GitHub] [cassandra-in-jvm-dtest-api] dcapwell commented on a change in pull request #1: Introduce the extracted in-JVM DTest API

Posted by GitBox <gi...@apache.org>.
dcapwell commented on a change in pull request #1: Introduce the extracted in-JVM DTest API
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/1#discussion_r384688584
 
 

 ##########
 File path: src/main/java/org/apache/cassandra/distributed/shared/DistributedTestBase.java
 ##########
 @@ -0,0 +1,205 @@
+/*
+ * 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.shared;
+
+import org.apache.cassandra.distributed.api.ICluster;
+import org.apache.cassandra.distributed.api.IInstance;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+public abstract class DistributedTestBase
+{
+    @After
+    public void afterEach()
+    {
+        System.runFinalization();
+        System.gc();
+    }
+
+    public abstract <I extends IInstance, C extends ICluster> Builder<I, C> builder();
+
+    public static String KEYSPACE = "distributed_test_keyspace";
+
+    // TODO: move this to Cluster.java?
+    public static void nativeLibraryWorkaround()
+    {
+        // Disable the Netty tcnative library otherwise the io.netty.internal.tcnative.CertificateCallbackTask,
+        // CertificateVerifierTask, SSLPrivateKeyMethodDecryptTask, SSLPrivateKeyMethodSignTask,
+        // SSLPrivateKeyMethodTask, and SSLTask hold a gcroot against the InstanceClassLoader.
+        System.setProperty("cassandra.disable_tcactive_openssl", "true");
+        System.setProperty("io.netty.transport.noNative", "true");
+    }
+
+    public static void processReaperWorkaround() throws Throwable {
+        // Make sure the 'process reaper' thread is initially created under the main classloader,
+        // otherwise it gets created with the contextClassLoader pointing to an InstanceClassLoader
+        // which prevents it from being garbage collected.
+        new ProcessBuilder().command("true").start().waitFor();
+    }
+
+    public static void setupLogging()
+    {
+        try
+        {
+            File root = Files.createTempDirectory("in-jvm-dtest").toFile();
+            root.deleteOnExit();
+            String testConfPath = "test/conf/logback-dtest.xml";
+            Path logConfPath = Paths.get(root.getPath(), "/logback-dtest.xml");
+
+            if (!logConfPath.toFile().exists())
+            {
+                Files.copy(new File(testConfPath).toPath(),
+                           logConfPath);
+            }
+
+            System.setProperty("logback.configurationFile", "file://" + logConfPath);
+        }
+        catch (IOException e)
+        {
+            throw new RuntimeException(e);
+        }
+    }
+
+    @BeforeClass
+    public static void setup() throws Throwable {
+        setupLogging();
+        System.setProperty("cassandra.ring_delay_ms", Integer.toString(10 * 1000));
 
 Review comment:
   same, should move to cluster

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cassandra.apache.org
For additional commands, e-mail: dev-help@cassandra.apache.org


[GitHub] [cassandra-in-jvm-dtest-api] krummas commented on issue #1: Introduce the extracted in-JVM DTest API

Posted by GitBox <gi...@apache.org>.
krummas commented on issue #1: Introduce the extracted in-JVM DTest API
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/1#issuecomment-591812874
 
 
   test, ignore

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


[GitHub] [cassandra-in-jvm-dtest-api] ifesdjeen commented on a change in pull request #1: Introduce the extracted in-JVM DTest API

Posted by GitBox <gi...@apache.org>.
ifesdjeen commented on a change in pull request #1: Introduce the extracted in-JVM DTest API
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/1#discussion_r395479367
 
 

 ##########
 File path: pom.xml
 ##########
 @@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <groupId>org.apache</groupId>
+        <artifactId>apache</artifactId>
+        <version>10</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.cassandra</groupId>
+    <artifactId>dtest-api</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <name>In JVM Test API</name>
+    <description>In JVM Test API</description>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <licenses>
+        <license>
+            <name>Apache License, Version 2.0</name>
+            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+            <distribution>repo</distribution>
+        </license>
+    </licenses>
+
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
 
 Review comment:
   Removed dependency on junit

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


[GitHub] [cassandra-in-jvm-dtest-api] dcapwell commented on a change in pull request #1: Introduce the extracted in-JVM DTest API

Posted by GitBox <gi...@apache.org>.
dcapwell commented on a change in pull request #1: Introduce the extracted in-JVM DTest API
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/1#discussion_r384676411
 
 

 ##########
 File path: pom.xml
 ##########
 @@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <groupId>org.apache</groupId>
+        <artifactId>apache</artifactId>
+        <version>10</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.cassandra</groupId>
+    <artifactId>dtest-api</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <name>In JVM Test API</name>
+    <description>In JVM Test API</description>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    </properties>
+
+    <licenses>
+        <license>
+            <name>Apache License, Version 2.0</name>
+            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+            <distribution>repo</distribution>
+        </license>
+    </licenses>
+
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
 
 Review comment:
   *should* the API depend on Junit?  tests do, but don't think the API should

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cassandra.apache.org
For additional commands, e-mail: dev-help@cassandra.apache.org


[GitHub] [cassandra-in-jvm-dtest-api] dcapwell commented on a change in pull request #1: Introduce the extracted in-JVM DTest API

Posted by GitBox <gi...@apache.org>.
dcapwell commented on a change in pull request #1: Introduce the extracted in-JVM DTest API
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/1#discussion_r384684017
 
 

 ##########
 File path: src/main/java/org/apache/cassandra/distributed/api/ICluster.java
 ##########
 @@ -0,0 +1,41 @@
+/*
+ * 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.api;
+
+import org.apache.cassandra.distributed.shared.NetworkTopology;
+
+import java.util.stream.Stream;
+
+public interface ICluster<I extends IInstance> extends AutoCloseable
 
 Review comment:
   we really should rely on default methods to slim down the required interface; again, im ok with first release like this (since this is the same logic).

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cassandra.apache.org
For additional commands, e-mail: dev-help@cassandra.apache.org


[GitHub] [cassandra-in-jvm-dtest-api] dcapwell commented on a change in pull request #1: Introduce the extracted in-JVM DTest API

Posted by GitBox <gi...@apache.org>.
dcapwell commented on a change in pull request #1: Introduce the extracted in-JVM DTest API
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/1#discussion_r384688358
 
 

 ##########
 File path: src/main/java/org/apache/cassandra/distributed/shared/DistributedTestBase.java
 ##########
 @@ -0,0 +1,205 @@
+/*
+ * 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.shared;
+
+import org.apache.cassandra.distributed.api.ICluster;
+import org.apache.cassandra.distributed.api.IInstance;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+public abstract class DistributedTestBase
+{
+    @After
+    public void afterEach()
+    {
+        System.runFinalization();
+        System.gc();
+    }
+
+    public abstract <I extends IInstance, C extends ICluster> Builder<I, C> builder();
+
+    public static String KEYSPACE = "distributed_test_keyspace";
+
+    // TODO: move this to Cluster.java?
+    public static void nativeLibraryWorkaround()
+    {
+        // Disable the Netty tcnative library otherwise the io.netty.internal.tcnative.CertificateCallbackTask,
+        // CertificateVerifierTask, SSLPrivateKeyMethodDecryptTask, SSLPrivateKeyMethodSignTask,
+        // SSLPrivateKeyMethodTask, and SSLTask hold a gcroot against the InstanceClassLoader.
+        System.setProperty("cassandra.disable_tcactive_openssl", "true");
+        System.setProperty("io.netty.transport.noNative", "true");
+    }
+
+    public static void processReaperWorkaround() throws Throwable {
+        // Make sure the 'process reaper' thread is initially created under the main classloader,
+        // otherwise it gets created with the contextClassLoader pointing to an InstanceClassLoader
 
 Review comment:
   why not include it under shared then?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cassandra.apache.org
For additional commands, e-mail: dev-help@cassandra.apache.org


[GitHub] [cassandra-in-jvm-dtest-api] ifesdjeen commented on a change in pull request #1: Introduce the extracted in-JVM DTest API

Posted by GitBox <gi...@apache.org>.
ifesdjeen commented on a change in pull request #1: Introduce the extracted in-JVM DTest API
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/1#discussion_r395007023
 
 

 ##########
 File path: src/main/java/org/apache/cassandra/distributed/shared/NetworkTopology.java
 ##########
 @@ -0,0 +1,216 @@
+/*
+ * 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.shared;
+
+import java.io.Serializable;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Objects;
+import java.util.function.IntFunction;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+public class NetworkTopology
+{
+    private final Map<AddressAndPort, DcAndRack> map;
+
+    public static class DcAndRack
+    {
+        private final String dc;
+        private final String rack;
+
+        private DcAndRack(String dc, String rack)
+        {
+            this.dc = dc;
+            this.rack = rack;
+        }
+
+        @Override
+        public String toString()
+        {
+            return "DcAndRack{" +
+                   "dc='" + dc + '\'' +
+                   ", rack='" + rack + '\'' +
+                   '}';
+        }
+
+        @Override
+        public boolean equals(Object o)
+        {
+            if (this == o) return true;
+            if (o == null || getClass() != o.getClass()) return false;
+            DcAndRack dcAndRack = (DcAndRack) o;
+            return Objects.equals(dc, dcAndRack.dc) &&
+                   Objects.equals(rack, dcAndRack.rack);
+        }
+
+        @Override
+        public int hashCode()
+        {
+            return Objects.hash(dc, rack);
+        }
+    }
+
+    public static class AddressAndPort implements Serializable
 
 Review comment:
   Removed this class in favour of InetSocketAddress 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Re: Shouldn't GitHub emails go to some other mailing list?

Posted by Brandon Williams <dr...@gmail.com>.
https://issues.apache.org/jira/browse/INFRA-19893

On Wed, Feb 26, 2020 at 8:12 PM Murukesh Mohanan
<mu...@gmail.com> wrote:
>
> Don't we have a pr@ mailing list for these?
>
> Yours,
> Murukesh Mohanan
>
>
> On Thu, 27 Feb 2020 at 03:56, GitBox <gi...@apache.org> wrote:
>
> > dcapwell commented on a change in pull request #1: Introduce the extracted
> > in-JVM DTest API
> > URL:
> > https://github.com/apache/cassandra-in-jvm-dtest-api/pull/1#discussion_r384691389
> >
> >
> >
> >  ##########
> >  File path:
> > src/main/java/org/apache/cassandra/distributed/shared/Versions.java
> >  ##########
> >  @@ -0,0 +1,201 @@
> > +/*
> > + * 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.shared;
> > +
> > +import java.io.File;
> > +import java.net.MalformedURLException;
> > +import java.net.URL;
> > +import java.nio.file.Paths;
> > +import java.util.*;
> > +import java.util.regex.Matcher;
> > +import java.util.regex.Pattern;
> > +import java.util.stream.Collectors;
> > +
> > +public class Versions
> >
> >  Review comment:
> >    FYI one thing I have been seeing is that 2 distinct versions with the
> > same major.minor is unclear which one gets picked up (think current branch
> > is 3.0 and you pull in the 3.0 dtest for the previous release)
> >
> >    This should be improved, but will be so much easier once this JIRA is
> > completed!
> >
> > ----------------------------------------------------------------
> > 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.
> >
> > For queries about this service, please contact Infrastructure at:
> > users@infra.apache.org
> >
> >
> > With regards,
> > Apache Git Services
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@cassandra.apache.org
> > For additional commands, e-mail: dev-help@cassandra.apache.org
> >
> >

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cassandra.apache.org
For additional commands, e-mail: dev-help@cassandra.apache.org


Shouldn't GitHub emails go to some other mailing list?

Posted by Murukesh Mohanan <mu...@gmail.com>.
Don't we have a pr@ mailing list for these?

Yours,
Murukesh Mohanan


On Thu, 27 Feb 2020 at 03:56, GitBox <gi...@apache.org> wrote:

> dcapwell commented on a change in pull request #1: Introduce the extracted
> in-JVM DTest API
> URL:
> https://github.com/apache/cassandra-in-jvm-dtest-api/pull/1#discussion_r384691389
>
>
>
>  ##########
>  File path:
> src/main/java/org/apache/cassandra/distributed/shared/Versions.java
>  ##########
>  @@ -0,0 +1,201 @@
> +/*
> + * 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.shared;
> +
> +import java.io.File;
> +import java.net.MalformedURLException;
> +import java.net.URL;
> +import java.nio.file.Paths;
> +import java.util.*;
> +import java.util.regex.Matcher;
> +import java.util.regex.Pattern;
> +import java.util.stream.Collectors;
> +
> +public class Versions
>
>  Review comment:
>    FYI one thing I have been seeing is that 2 distinct versions with the
> same major.minor is unclear which one gets picked up (think current branch
> is 3.0 and you pull in the 3.0 dtest for the previous release)
>
>    This should be improved, but will be so much easier once this JIRA is
> completed!
>
> ----------------------------------------------------------------
> 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.
>
> For queries about this service, please contact Infrastructure at:
> users@infra.apache.org
>
>
> With regards,
> Apache Git Services
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cassandra.apache.org
> For additional commands, e-mail: dev-help@cassandra.apache.org
>
>

[GitHub] [cassandra-in-jvm-dtest-api] dcapwell commented on a change in pull request #1: Introduce the extracted in-JVM DTest API

Posted by GitBox <gi...@apache.org>.
dcapwell commented on a change in pull request #1: Introduce the extracted in-JVM DTest API
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/1#discussion_r384691389
 
 

 ##########
 File path: src/main/java/org/apache/cassandra/distributed/shared/Versions.java
 ##########
 @@ -0,0 +1,201 @@
+/*
+ * 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.shared;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.nio.file.Paths;
+import java.util.*;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+
+public class Versions
 
 Review comment:
   FYI one thing I have been seeing is that 2 distinct versions with the same major.minor is unclear which one gets picked up (think current branch is 3.0 and you pull in the 3.0 dtest for the previous release)
   
   This should be improved, but will be so much easier once this JIRA is completed!

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cassandra.apache.org
For additional commands, e-mail: dev-help@cassandra.apache.org


[GitHub] [cassandra-in-jvm-dtest-api] ifesdjeen closed pull request #1: Introduce the extracted in-JVM DTest API

Posted by GitBox <gi...@apache.org>.
ifesdjeen closed pull request #1: Introduce the extracted in-JVM DTest API
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/1
 
 
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


[GitHub] [cassandra-in-jvm-dtest-api] dcapwell commented on a change in pull request #1: Introduce the extracted in-JVM DTest API

Posted by GitBox <gi...@apache.org>.
dcapwell commented on a change in pull request #1: Introduce the extracted in-JVM DTest API
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/1#discussion_r384687941
 
 

 ##########
 File path: src/main/java/org/apache/cassandra/distributed/shared/DistributedTestBase.java
 ##########
 @@ -0,0 +1,205 @@
+/*
+ * 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.shared;
+
+import org.apache.cassandra.distributed.api.ICluster;
+import org.apache.cassandra.distributed.api.IInstance;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+public abstract class DistributedTestBase
+{
+    @After
+    public void afterEach()
+    {
+        System.runFinalization();
+        System.gc();
+    }
+
+    public abstract <I extends IInstance, C extends ICluster> Builder<I, C> builder();
+
+    public static String KEYSPACE = "distributed_test_keyspace";
+
+    // TODO: move this to Cluster.java?
+    public static void nativeLibraryWorkaround()
+    {
+        // Disable the Netty tcnative library otherwise the io.netty.internal.tcnative.CertificateCallbackTask,
+        // CertificateVerifierTask, SSLPrivateKeyMethodDecryptTask, SSLPrivateKeyMethodSignTask,
+        // SSLPrivateKeyMethodTask, and SSLTask hold a gcroot against the InstanceClassLoader.
+        System.setProperty("cassandra.disable_tcactive_openssl", "true");
 
 Review comment:
   don't have to fix here, but it would be good to move this to `Cluster`

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cassandra.apache.org
For additional commands, e-mail: dev-help@cassandra.apache.org


[GitHub] [cassandra-in-jvm-dtest-api] dcapwell commented on a change in pull request #1: Introduce the extracted in-JVM DTest API

Posted by GitBox <gi...@apache.org>.
dcapwell commented on a change in pull request #1: Introduce the extracted in-JVM DTest API
URL: https://github.com/apache/cassandra-in-jvm-dtest-api/pull/1#discussion_r384688663
 
 

 ##########
 File path: src/main/java/org/apache/cassandra/distributed/shared/DistributedTestBase.java
 ##########
 @@ -0,0 +1,205 @@
+/*
+ * 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.shared;
+
+import org.apache.cassandra.distributed.api.ICluster;
+import org.apache.cassandra.distributed.api.IInstance;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+public abstract class DistributedTestBase
+{
+    @After
+    public void afterEach()
+    {
+        System.runFinalization();
+        System.gc();
+    }
+
+    public abstract <I extends IInstance, C extends ICluster> Builder<I, C> builder();
+
+    public static String KEYSPACE = "distributed_test_keyspace";
+
+    // TODO: move this to Cluster.java?
+    public static void nativeLibraryWorkaround()
+    {
+        // Disable the Netty tcnative library otherwise the io.netty.internal.tcnative.CertificateCallbackTask,
+        // CertificateVerifierTask, SSLPrivateKeyMethodDecryptTask, SSLPrivateKeyMethodSignTask,
+        // SSLPrivateKeyMethodTask, and SSLTask hold a gcroot against the InstanceClassLoader.
+        System.setProperty("cassandra.disable_tcactive_openssl", "true");
+        System.setProperty("io.netty.transport.noNative", "true");
+    }
+
+    public static void processReaperWorkaround() throws Throwable {
+        // Make sure the 'process reaper' thread is initially created under the main classloader,
+        // otherwise it gets created with the contextClassLoader pointing to an InstanceClassLoader
+        // which prevents it from being garbage collected.
+        new ProcessBuilder().command("true").start().waitFor();
+    }
+
+    public static void setupLogging()
 
 Review comment:
   same, should move to cluster

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cassandra.apache.org
For additional commands, e-mail: dev-help@cassandra.apache.org