GabrielBrascher commented on a change in pull request #5085:
URL: https://github.com/apache/cloudstack/pull/5085#discussion_r648276765



##########
File path: 
server/src/main/java/com/cloud/api/query/dao/ServiceOfferingJoinDaoImpl.java
##########
@@ -45,6 +45,13 @@
 
     private SearchBuilder<ServiceOfferingJoinVO> sofIdSearch;
 
+    /**
+     * Constant used to convert GB into Bytes (or the other way around).
+     * GB   *  MB  *  KB  = Bytes //
+     * 1024 * 1024 * 1024 = 1073741824
+     */
+    private static final long GB_TO_BYTES = 1073741824;

Review comment:
       @sureshanaparti I totally agree with you. We had many issues in the past 
and it still haunts us. If we simply added a proper name and documentation it 
would help a lot many bugs that we face and also make new features and 
extensions easier on that matter.
   
   Regarding the constant. You have a good point; we could create 
constants/enums for such conversions as many times we store in Bytes but make 
it available to users in GB or MB.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to