weizhouapache commented on a change in pull request #5259:
URL: https://github.com/apache/cloudstack/pull/5259#discussion_r690946101



##########
File path: usage/src/main/java/com/cloud/usage/parser/BackupUsageParser.java
##########
@@ -100,6 +89,33 @@ public static boolean parse(AccountVO account, Date 
startDate, Date endDate) {
         return true;
     }
 
+    protected static final Map<String, BackupInfo> getVmUsageMap(final 
List<UsageBackupVO> usageBackups) {
+        final Map<Long, Long> vmOffering = new HashMap<Long, Long>();
+        final Map<Long, Integer> vmOfferingIndex = new HashMap<Long, 
Integer>();
+        final Map<String, BackupInfo> vmUsageMap = new HashMap<>();
+        for (final UsageBackupVO usageBackup : usageBackups) {
+            final Long vmId = usageBackup.getVmId();
+            final Long zoneId = usageBackup.getZoneId();
+            final Long offeringId = usageBackup.getBackupOfferingId();
+            Integer index = vmOfferingIndex.get(vmId) == null ? 0 : 
vmOfferingIndex.get(vmId);
+            if (vmOffering.get(vmId) == null || vmOffering.get(vmId) != 
offeringId)  {
+                if (vmOffering.get(vmId) != null) {

Review comment:
       @GutoVeronezi  done.




-- 
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: commits-unsubscr...@cloudstack.apache.org

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


Reply via email to