maedhroz commented on a change in pull request #1180:
URL: https://github.com/apache/cassandra/pull/1180#discussion_r700417603



##########
File path: 
test/distributed/org/apache/cassandra/distributed/test/trackwarnings/RowIndexEntryTooLargeWarningTest.java
##########
@@ -0,0 +1,118 @@
+/*
+ * 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.trackwarnings;
+
+import java.io.IOException;
+import java.net.UnknownHostException;
+import java.util.List;
+
+import org.junit.Assume;
+import org.junit.BeforeClass;
+
+import org.apache.cassandra.config.DatabaseDescriptor;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class RowIndexEntryTooLargeWarningTest extends AbstractClientSizeWarning
+{
+    @BeforeClass
+    public static void setupClass() throws IOException
+    {
+        AbstractClientSizeWarning.setupClass();
+
+        CLUSTER.stream().forEach(i -> i.runOnInstance(() -> {
+            DatabaseDescriptor.setRowIndexSizeWarningThresholdKb(1);
+            DatabaseDescriptor.setRowIndexSizeAbortThresholdKb(2);
+
+            // hack to force multiple index entries
+            DatabaseDescriptor.setColumnIndexCacheSize(1 << 20);
+            DatabaseDescriptor.setColumnIndexSize(0);
+        }));
+    }
+
+    @Override
+    protected boolean shouldFlush()
+    {
+        // need to flush as RowIndexEntry is at the SSTable level
+        return true;
+    }
+
+    @Override
+    protected int warnThresholdRowCount()
+    {
+        return 15;
+    }
+
+    @Override
+    protected int failThresholdRowCount()
+    {
+        // since the RowIndexEntry grows slower than a partition, need even 
more rows to trigger
+        return 40;
+    }
+
+    @Override
+    public void noWarningsScan()
+    {
+        Assume.assumeFalse("Ignore Scans", true);
+    }
+
+    @Override
+    public void warnThresholdScan()
+    {
+        Assume.assumeFalse("Ignore Scans", true);
+    }
+
+    @Override
+    public void failThresholdScan() throws UnknownHostException

Review comment:
       nit: The `UnknownHostException` and it's import don't look necessary.




-- 
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