You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by GitBox <gi...@apache.org> on 2022/06/24 20:04:39 UTC

[GitHub] [cassandra] yifan-c commented on a diff in pull request #1701: CASSANDRA-17677: Fix BulkLoader to load entireSSTableThrottle and entireSSTableInterDcThrottle

yifan-c commented on code in PR #1701:
URL: https://github.com/apache/cassandra/pull/1701#discussion_r906372158


##########
src/java/org/apache/cassandra/config/DataRateSpec.java:
##########
@@ -296,7 +296,7 @@ public IntMebibytesPerSecondBound(long mebibytesPerSecond)
         // which were in megabits per second in 4.0. Do not start using it for any new properties
         public static IntMebibytesPerSecondBound megabitsPerSecondInMebibytesPerSecond(long megabitsPerSecond)
         {
-            final double MEBIBYTES_PER_MEGABIT = 0.119209289550781;
+            final double MEBIBYTES_PER_MEGABIT = 15625D / 131072D;

Review Comment:
   It is hard to see the reasoning behind the equations.
   
   How about define the constants for MEGABIT, MEBIBYTES, etc. in bits and derive the conversion from the constants? For example,
   
   ```java
   static final double MEBIBYTES_IN_BITS = Math.pow(2, 20) * 8;
   static final double MEGABIT_IN_BITS = Math.pow(10, 6); 
   static final double MEBIBYTES_PER_MEGABIT = MEGABIT_IN_BITS / MEBIBYTES_IN_BITS;
   ... more for the other size units...
   ```
   



-- 
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-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org