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



##########
File path: usage/src/main/java/com/cloud/usage/parser/BackupUsageParser.java
##########
@@ -100,6 +89,32 @@ 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 ? -1 : 
vmOfferingIndex.get(vmId);
+            boolean isVmOfferingEqualsToPrevious = vmOffering.get(vmId) != 
null && vmOffering.get(vmId) == offeringId;

Review comment:
       @DaanHoogland thanks. 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: [email protected]

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


Reply via email to