pranavshenoy commented on code in PR #4087:
URL: https://github.com/apache/cassandra/pull/4087#discussion_r2051252004


##########
src/java/org/apache/cassandra/db/compaction/unified/Controller.java:
##########
@@ -518,14 +518,20 @@ public static Map<String, String> 
validateOptions(Map<String, String> options) t
         {
             try
             {
-                targetSSTableSize = FBUtilities.parseHumanReadableBytes(s);
-                if (targetSSTableSize < MIN_TARGET_SSTABLE_SIZE)
+                Double targetSize = FBUtilities.parseHumanReadable(s, null, 
"B");

Review Comment:
   done



##########
test/unit/org/apache/cassandra/db/compaction/unified/ControllerTest.java:
##########
@@ -121,6 +121,50 @@ public void testValidateOptionsIntegers()
         testValidateOptions(true);
     }
 
+    @Test
+    public void testValidateOptionsInvalidTargetSSTableSize()

Review Comment:
   I have made the changes. Thanks



##########
src/java/org/apache/cassandra/db/compaction/unified/Controller.java:
##########
@@ -622,9 +628,9 @@ public static Map<String, String> 
validateOptions(Map<String, String> options) t
                 if (sizeInBytes < 0)
                     throw new ConfigurationException(String.format("Invalid 
configuration, %s should be greater than or equal to 0 (zero)",
                                                                    
MIN_SSTABLE_SIZE_OPTION));
-                int limit = (int) Math.ceil(targetSSTableSize * 
INVERSE_SQRT_2);
+                long limit = (long) Math.ceil(targetSSTableSize * 
INVERSE_SQRT_2);
                 if (sizeInBytes >= limit)
-                    throw new ConfigurationException(String.format("Invalid 
configuration, %s (%s) should be less than the target size minimum: %s",

Review Comment:
   have made the changes. I modified the log and removed sizeInBytes as it is 
computed internally. Now the log looks like this:
   `Invalid configuration, MIN_SSTABLE_SIZE_OPTION (%s) should be less than 
70%% of the targetSSTableSize (targetSSTableSize)` 
   
   let me know if this is fine.



##########
test/unit/org/apache/cassandra/db/compaction/unified/ControllerTest.java:
##########
@@ -121,6 +121,50 @@ public void testValidateOptionsIntegers()
         testValidateOptions(true);
     }
 
+    @Test
+    public void testValidateOptionsInvalidTargetSSTableSize()
+    {
+        //Test 1: TARGET_SSTABLE_SIZE_OPTION = 12E899, the value reported in 
CASSANDRA-20398 
+        try {

Review Comment:
   done. Thanks



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