dcapwell commented on a change in pull request #1324:
URL: https://github.com/apache/cassandra/pull/1324#discussion_r751470471



##########
File path: 
test/distributed/org/apache/cassandra/distributed/test/TopPartitionsTest.java
##########
@@ -0,0 +1,274 @@
+/*
+ * 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.test;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import org.apache.cassandra.config.DatabaseDescriptor;
+import org.apache.cassandra.db.ColumnFamilyStore;
+import org.apache.cassandra.db.Keyspace;
+import org.apache.cassandra.distributed.Cluster;
+import org.apache.cassandra.distributed.api.ConsistencyLevel;
+import org.assertj.core.api.Assertions;
+
+import static org.apache.cassandra.distributed.api.Feature.GOSSIP;
+import static org.apache.cassandra.distributed.api.Feature.NETWORK;
+import static org.junit.Assert.assertEquals;
+import static org.psjava.util.AssertStatus.assertTrue;
+
+@RunWith(Parameterized.class)
+public class TopPartitionsTest extends TestBaseImpl
+{
+    public enum Repair
+    {
+        Incremental, Full, FullPreview
+    }
+
+    private static AtomicInteger COUNTER = new AtomicInteger(0);
+    private static Cluster CLUSTER;
+
+    private final Repair repair;
+
+    public TopPartitionsTest(Repair repair)
+    {
+        this.repair = repair;
+    }
+
+    @Parameterized.Parameters(name = "{0}")
+    public static Collection<Object[]> messages()
+    {
+        return Stream.of(Repair.values())
+                     .map(a -> new Object[]{ a })
+                     .collect(Collectors.toList());
+    }
+
+    @BeforeClass
+    public static void setup() throws IOException
+    {
+        CLUSTER = init(Cluster.build(2).withConfig(config ->
+                                                   
config.set("min_tracked_partition_size_bytes", 0)
+                                                         
.set("min_tracked_partition_tombstone_count", 0)
+                                                         .with(GOSSIP, 
NETWORK))
+                              .start());
+    }
+
+    @AfterClass
+    public static void cleanup()
+    {
+        if (CLUSTER != null)
+            CLUSTER.close();
+    }
+
+    @Before
+    public void before()
+    {
+        setCount(10, 10);
+    }
+
+    @Test
+    public void basicPartitionSizeTest()

Review comment:
       looked into this and choosing not to.  tablestats uses a lot of raw JMX, 
which our nodetool shim layer doesn't support.  After getting to 
`org.apache.cassandra.tools.NodeProbe#getColumnFamilyMetric` I hit the road 
block where wasn't clear how to add to the shim.
   
   Our metric stuff is maybe able to leverage 
`org.apache.cassandra.distributed.test.metric.TableMetricTest.MapMBeanWrapper` 
some day, but right now we rely on no-op implementation




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to