Claudenw commented on code in PR #4087: URL: https://github.com/apache/cassandra/pull/4087#discussion_r2050160555
########## 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: I agree with dcapwell here as well. The exception string might say something like "Invalid configuration, `MIN_SSTABLE_SIZE_OPTION` (%s) should be less than `sizeInBytes`, which is calculated as 70% of the targetSSTableSize (%s)" ########## 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: I agree with dcapwell. Using a `Double` rather than a `double` will result in unnecessary boxing and unboxing in the code below. -- 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