maedhroz commented on code in PR #1754:
URL: https://github.com/apache/cassandra/pull/1754#discussion_r931589772
##########
src/java/org/apache/cassandra/config/DatabaseDescriptor.java:
##########
@@ -1953,14 +1975,31 @@ public static int
getCompactionThroughputMebibytesPerSecAsInt()
return conf.compaction_throughput.toMebibytesPerSecondAsInt();
}
+ public static double getCompactionThroughputBytesPerSec()
+ {
+ return conf.compaction_throughput.toBytesPerSecond();
+ }
+
public static double getCompactionThroughputMebibytesPerSec()
{
return conf.compaction_throughput.toMebibytesPerSecond();
}
+ @VisibleForTesting // only for testing!
+ public static void setCompactionThroughputBytesPerSec(int value)
+ {
+ if (MEBIBYTES_PER_SECOND.toMebibytesPerSecond(value) >=
Integer.MAX_VALUE)
+ throw new IllegalArgumentException("Invalid value of
compaction_throughput: " + value);
+
+ conf.compaction_throughput = new
DataRateSpec.LongBytesPerSecondBound(value);
+ }
+
public static void setCompactionThroughputMebibytesPerSec(int value)
{
- conf.compaction_throughput = new
DataRateSpec.IntMebibytesPerSecondBound(value);
+ if (MEBIBYTES_PER_SECOND.toMebibytesPerSecond(value) >=
Integer.MAX_VALUE)
Review Comment:
Isn't this a no-op? Like we could just say `value >= Integer.MAX_VALUE`?
--
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]