nikhilkumawat03 commented on code in PR #4228:
URL: https://github.com/apache/cassandra/pull/4228#discussion_r2191406633


##########
test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java:
##########
@@ -969,6 +969,36 @@ public void testReduceScopeL0L1() throws IOException
         }
     }
 
+    @Test()
+    public void testInvalidFanoutAndSSTableSize() {
+        try {
+            Map<String, String> options = new HashMap<>();
+            options.put("class", "LeveledCompactionStrategy");
+            options.put("fanout_size", "90");
+            options.put("sstable_size_in_mb", "1089");
+            LeveledCompactionStrategy.validateOptions(options);
+        }
+        catch (ConfigurationException e) {
+            assertTrue(e.getMessage().contains("your maxSSTableSize must be 
absurdly high to compute"));
+            return;
+        }
+        Assert.fail("fanout_sizeed and sstable_size_in_mb are invalid, but did 
not throw ConfigurationException");
+    }
+
+    @Test
+    public void testValidOptions() {
+        try {

Review Comment:
   Done



##########
test/unit/org/apache/cassandra/db/compaction/LeveledCompactionStrategyTest.java:
##########
@@ -969,6 +969,36 @@ public void testReduceScopeL0L1() throws IOException
         }
     }
 
+    @Test()
+    public void testInvalidFanoutAndSSTableSize() {
+        try {
+            Map<String, String> options = new HashMap<>();
+            options.put("class", "LeveledCompactionStrategy");
+            options.put("fanout_size", "90");
+            options.put("sstable_size_in_mb", "1089");
+            LeveledCompactionStrategy.validateOptions(options);
+        }
+        catch (ConfigurationException e) {
+            assertTrue(e.getMessage().contains("your maxSSTableSize must be 
absurdly high to compute"));
+            return;
+        }
+        Assert.fail("fanout_sizeed and sstable_size_in_mb are invalid, but did 
not throw ConfigurationException");
+    }
+
+    @Test
+    public void testValidOptions() {
+        try {
+            Map<String, String> options = new HashMap<>();
+            options.put("class", "LeveledCompactionStrategy");
+            options.put("fanout_size", "10");
+            options.put("sstable_size_in_mb", "160");
+            LeveledCompactionStrategy.validateOptions(options);
+        }
+        catch (Exception e) {

Review Comment:
   Done



-- 
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: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to