You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/08/03 13:36:41 UTC

[GitHub] [cloudstack] GutoVeronezi commented on a diff in pull request #6587: Updated resource counter to include correct size after volume creation/resize and other improvements

GutoVeronezi commented on code in PR #6587:
URL: https://github.com/apache/cloudstack/pull/6587#discussion_r936657651


##########
server/src/main/java/com/cloud/resourcelimit/ResourceLimitManagerImpl.java:
##########
@@ -1112,22 +1114,21 @@ public ResourceCountCheckTask() {
         protected void runInContext() {
             s_logger.info("Started resource counters recalculation periodic task.");
             List<DomainVO> domains = _domainDao.findImmediateChildrenForParent(Domain.ROOT_DOMAIN);
+            List<AccountVO> accounts = _accountDao.findActiveAccountsForDomain(Domain.ROOT_DOMAIN);
 
-            // recalculateDomainResourceCount will take care of re-calculation of resource counts for sub-domains
-            // and accounts of the sub-domains also. so just loop through immediate children of root domain
-            for (Domain domain : domains) {
-                for (ResourceType type : ResourceCount.ResourceType.values()) {
-                    if (type.supportsOwner(ResourceOwnerType.Domain)) {
+            for (ResourceType type : ResourceCount.ResourceType.values()) {
+                if (type.supportsOwner(ResourceOwnerType.Domain)) {
+                    // recalculateDomainResourceCount will take care of re-calculation of resource counts for root and sub-domains
+                    // and accounts of the sub-domains also. so just loop through immediate children of root domain

Review Comment:
   This comment could be the javadoc of the method.



##########
engine/storage/volume/src/main/java/org/apache/cloudstack/storage/volume/VolumeObject.java:
##########
@@ -678,6 +682,32 @@ protected void updateVolumeInfo(VolumeObjectTO newVolume, VolumeVO volumeVo, boo
         s_logger.debug(String.format("Updated %s from %s to %s ", volumeVo.getVolumeDescription(), previousValues, newValues));
     }
 
+    protected void updateResourceCount(VolumeObjectTO newVolume, VolumeVO volumeVo) {

Review Comment:
   @sureshanaparti, we should rename `volumeVo` to avoid misleading with the class property `volumeVO`.



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

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