ekaterinadimitrova2 commented on code in PR #1754:
URL: https://github.com/apache/cassandra/pull/1754#discussion_r932727631


##########
src/java/org/apache/cassandra/config/DataRateSpec.java:
##########
@@ -252,6 +253,21 @@ public LongBytesPerSecondBound(long bytesPerSecond)
         {
             this(bytesPerSecond, BYTES_PER_SECOND);
         }
+
+        // this one should be used only for backward compatibility for 
stream_throughput_outbound and inter_dc_stream_throughput_outbound
+        // which were in megabits per second in 4.0. Do not start using it for 
any new properties
+        public static LongBytesPerSecondBound 
megabitsPerSecondInBytesPerSecond(long megabitsPerSecond)
+        {
+            final double BYTES_PER_MEGABIT = 125_000;
+            double bytesPerSecond = (double) megabitsPerSecond * 
BYTES_PER_MEGABIT;
+
+            if (megabitsPerSecond >= Integer.MAX_VALUE)

Review Comment:
   Nope, that is correct, in 4.1 we explicitly made Integer.MAX_VALUE and 
Long.MAX_VALUE illegal. This was done as they are anyway too big probably to be 
used and to differentiate from the overload handling in the units classes where 
in case of overflow we assign the MAX_VALUE anyway and we warned people that if 
they see it this will mean there is somewhere a bug and they need to raise a 
ticket



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