blambov commented on code in PR #2966:
URL: https://github.com/apache/cassandra/pull/2966#discussion_r1431742070


##########
src/java/org/apache/cassandra/db/compaction/unified/Controller.java:
##########
@@ -596,10 +598,15 @@ public static Map<String, String> 
validateOptions(Map<String, String> options) t
             try
             {
                 long sizeInBytes = FBUtilities.parseHumanReadableBytes(s);
+                // zero is a valid option to disable featue
                 if (sizeInBytes < 0)
-                    throw new ConfigurationException(String.format("Invalid 
configuration, %s should be positive: %s",
-                                                                   
MIN_SSTABLE_SIZE_OPTION,
-                                                                   s));
+                    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);
+                if (sizeInBytes >= limit )
+                    throw new ConfigurationException(String.format("Invalid 
configuration, %s (%sB) should be less than: %sB",

Review Comment:
   Nit: Let's add "the target size minimum" after "less than" to make sure the 
user knows where that number comes from.
   
   Also, make both values human readable, by applying 
`FBUtilities.prettyPrintMemory()` (see e.g. the exception on line 500).



##########
src/java/org/apache/cassandra/db/compaction/unified/Controller.java:
##########
@@ -596,10 +598,15 @@ public static Map<String, String> 
validateOptions(Map<String, String> options) t
             try
             {
                 long sizeInBytes = FBUtilities.parseHumanReadableBytes(s);
+                // zero is a valid option to disable featue

Review Comment:
   Nit: feature



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