diff --git a/CHANGES.txt b/CHANGES.txt
index b4b1245881..ec88756517 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -43,6 +43,7 @@ Merged from 2.2:
* Fixing invalid CQL in security documentation (CASSANDRA-15020)
* Multi-version in-JVM dtests (CASSANDRA-14937)
* Allow instance class loaders to be garbage collected for inJVM dtest (CASSANDRA-15170)
+ * Add support for network topology and query tracing for inJVM dtest (CASSANDRA-15319)
3.11.4
diff --git a/build.xml b/build.xml
index 0b4e42327a..557cc076fe 100644
--- a/build.xml
+++ b/build.xml
@@ -1264,7 +1264,7 @@
algorithm to limit the metaspace size and clean up SoftReferences
more aggressively rather than waiting. See CASSANDRA-14922 for more details.
-->
-
+
diff --git a/ide/idea/workspace.xml b/ide/idea/workspace.xml
index 8d1b0fce1e..7e63f77f8c 100644
--- a/ide/idea/workspace.xml
+++ b/ide/idea/workspace.xml
@@ -167,7 +167,7 @@
-
+
diff --git a/src/java/org/apache/cassandra/service/StorageService.java b/src/java/org/apache/cassandra/service/StorageService.java
index 309be3d26b..f34e5c2b3f 100644
--- a/src/java/org/apache/cassandra/service/StorageService.java
+++ b/src/java/org/apache/cassandra/service/StorageService.java
@@ -1039,7 +1039,7 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
}
// if we don't have system_traces keyspace at this point, then create it manually
- maybeAddOrUpdateKeyspace(TraceKeyspace.metadata());
+ ensureTraceKeyspace();
maybeAddOrUpdateKeyspace(SystemDistributedKeyspace.metadata());
if (!isSurveyMode)
@@ -1070,6 +1070,12 @@ public class StorageService extends NotificationBroadcasterSupport implements IE
}
}
+ @VisibleForTesting
+ public void ensureTraceKeyspace()
+ {
+ maybeAddOrUpdateKeyspace(TraceKeyspace.metadata());
+ }
+
public static boolean isReplacingSameAddress()
{
InetAddress replaceAddress = DatabaseDescriptor.getReplaceAddress();
diff --git a/test/distributed/org/apache/cassandra/distributed/Cluster.java b/test/distributed/org/apache/cassandra/distributed/Cluster.java
index 95862b6a62..d3533d3fa9 100644
--- a/test/distributed/org/apache/cassandra/distributed/Cluster.java
+++ b/test/distributed/org/apache/cassandra/distributed/Cluster.java
@@ -45,9 +45,14 @@ public class Cluster extends AbstractCluster implements IClu
return new Wrapper(generation, version, config);
}
+ public static Builder build()
+ {
+ return new Builder<>(Cluster::new);
+ }
+
public static Builder build(int nodeCount)
{
- return new Builder<>(nodeCount, Cluster::new);
+ return build().withNodes(nodeCount);
}
public static Cluster create(int nodeCount, Consumer configUpdater) throws IOException
diff --git a/test/distributed/org/apache/cassandra/distributed/UpgradeableCluster.java b/test/distributed/org/apache/cassandra/distributed/UpgradeableCluster.java
index c77d72514b..1fe960a253 100644
--- a/test/distributed/org/apache/cassandra/distributed/UpgradeableCluster.java
+++ b/test/distributed/org/apache/cassandra/distributed/UpgradeableCluster.java
@@ -46,9 +46,14 @@ public class UpgradeableCluster extends AbstractCluster im
return new Wrapper(generation, version, config);
}
+ public static Builder build()
+ {
+ return new Builder<>(UpgradeableCluster::new);
+ }
+
public static Builder build(int nodeCount)
{
- return new Builder<>(nodeCount, UpgradeableCluster::new);
+ return build().withNodes(nodeCount);
}
public static UpgradeableCluster create(int nodeCount) throws Throwable
diff --git a/test/distributed/org/apache/cassandra/distributed/api/ICluster.java b/test/distributed/org/apache/cassandra/distributed/api/ICluster.java
index 91da61ed34..091e5f048a 100644
--- a/test/distributed/org/apache/cassandra/distributed/api/ICluster.java
+++ b/test/distributed/org/apache/cassandra/distributed/api/ICluster.java
@@ -29,6 +29,8 @@ public interface ICluster
IInstance get(InetAddressAndPort endpoint);
int size();
Stream extends IInstance> stream();
+ Stream extends IInstance> stream(String dcName);
+ Stream extends IInstance> stream(String dcName, String rackName);
IMessageFilters filters();
}
diff --git a/test/distributed/org/apache/cassandra/distributed/api/ICoordinator.java b/test/distributed/org/apache/cassandra/distributed/api/ICoordinator.java
index 59afd8bde6..ef4485318b 100644
--- a/test/distributed/org/apache/cassandra/distributed/api/ICoordinator.java
+++ b/test/distributed/org/apache/cassandra/distributed/api/ICoordinator.java
@@ -19,6 +19,8 @@
package org.apache.cassandra.distributed.api;
import java.util.Iterator;
+import java.util.UUID;
+import java.util.concurrent.Future;
// The cross-version API requires that a Coordinator can be constructed without any constructor arguments
public interface ICoordinator
@@ -28,4 +30,7 @@ public interface ICoordinator
Object[][] execute(String query, Enum> consistencyLevel, Object... boundValues);
Iterator