Claudenw commented on code in PR #2966:
URL: https://github.com/apache/cassandra/pull/2966#discussion_r1431891251
##########
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:
Pretty printing the number causes problems in that the rounding of the
numbers means that it will, for some values, print an invalid value. I had
this problem in developing the test numbers.
--
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]