maedhroz commented on code in PR #1754:
URL: https://github.com/apache/cassandra/pull/1754#discussion_r931592691
##########
src/java/org/apache/cassandra/config/DatabaseDescriptor.java:
##########
@@ -2016,59 +2055,115 @@ public static int
getStreamThroughputOutboundMegabitsPerSec()
return conf.stream_throughput_outbound.toMegabitsPerSecondAsInt();
}
+ public static double getStreamThroughputOutboundMegabitsPerSecAsDouble()
+ {
+ return conf.stream_throughput_outbound.toMegabitsPerSecond();
+ }
+
public static double getStreamThroughputOutboundMebibytesPerSec()
{
return conf.stream_throughput_outbound.toMebibytesPerSecond();
}
- public static void setStreamThroughputOutboundMegabitsPerSec(int value)
+ public static double getStreamThroughputOutboundBytesPerSec()
{
- conf.stream_throughput_outbound =
DataRateSpec.IntMebibytesPerSecondBound.megabitsPerSecondInMebibytesPerSecond(value);
+ return conf.stream_throughput_outbound.toBytesPerSecond();
}
- public static int
getEntireSSTableStreamThroughputOutboundMebibytesPerSecAsInt()
+ public static int getStreamThroughputOutboundMebibytesPerSecAsInt()
{
- return
conf.entire_sstable_stream_throughput_outbound.toMebibytesPerSecondAsInt();
+ return conf.stream_throughput_outbound.toMebibytesPerSecondAsInt();
+ }
+
+ public static void setStreamThroughputOutboundMebibytesPerSecAsInt(int
value)
+ {
+ if (MEBIBYTES_PER_SECOND.toMegabitsPerSecond(value) >=
Integer.MAX_VALUE)
+ throw new IllegalArgumentException("Invalid value of
stream_throughput_outbound: " + value);
+
+ long valueInBytes = value * 1024L * 1024L;
Review Comment:
Same thing in `setCompactionThroughputMebibytesPerSec`,
`setEntireSSTableStreamThroughputOutboundMebibytesPerSec`, and
`setInterDCStreamThroughputOutboundMebibytesPerSecAsInt`
##########
src/java/org/apache/cassandra/config/DatabaseDescriptor.java:
##########
@@ -2016,59 +2055,115 @@ public static int
getStreamThroughputOutboundMegabitsPerSec()
return conf.stream_throughput_outbound.toMegabitsPerSecondAsInt();
}
+ public static double getStreamThroughputOutboundMegabitsPerSecAsDouble()
+ {
+ return conf.stream_throughput_outbound.toMegabitsPerSecond();
+ }
+
public static double getStreamThroughputOutboundMebibytesPerSec()
{
return conf.stream_throughput_outbound.toMebibytesPerSecond();
}
- public static void setStreamThroughputOutboundMegabitsPerSec(int value)
+ public static double getStreamThroughputOutboundBytesPerSec()
{
- conf.stream_throughput_outbound =
DataRateSpec.IntMebibytesPerSecondBound.megabitsPerSecondInMebibytesPerSecond(value);
+ return conf.stream_throughput_outbound.toBytesPerSecond();
}
- public static int
getEntireSSTableStreamThroughputOutboundMebibytesPerSecAsInt()
+ public static int getStreamThroughputOutboundMebibytesPerSecAsInt()
{
- return
conf.entire_sstable_stream_throughput_outbound.toMebibytesPerSecondAsInt();
+ return conf.stream_throughput_outbound.toMebibytesPerSecondAsInt();
+ }
+
+ public static void setStreamThroughputOutboundMebibytesPerSecAsInt(int
value)
+ {
+ if (MEBIBYTES_PER_SECOND.toMegabitsPerSecond(value) >=
Integer.MAX_VALUE)
+ throw new IllegalArgumentException("Invalid value of
stream_throughput_outbound: " + value);
+
+ long valueInBytes = value * 1024L * 1024L;
Review Comment:
Same thing in `setCompactionThroughputMebibytesPerSec`,
`setEntireSSTableStreamThroughputOutboundMebibytesPerSec`,
`setInterDCStreamThroughputOutboundMebibytesPerSecAsInt`, and
`setEntireSSTableInterDCStreamThroughputOutboundMebibytesPerSec`
--
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]