Gilad Chaplik has posted comments on this change.
Change subject: engine: Fix storage quota distribution bug
......................................................................
Patch Set 1: I would prefer that you didn't submit this
(2 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetQuotasConsumptionForCurrentUserQuery.java
Line 22: List<Quota> quotaList = new ArrayList<Quota>();
Line 23: for (Guid id : ids) {
Line 24: quotaList.addAll(getDbFacade()
Line 25: .getQuotaDao()
Line 26: .getQuotaByAdElementId(id, null));
not a fan of a db query within a foreach. please consider replacing it with a
single SP that gets a user_id
Line 27: }
Line 28:
getQueryReturnValue().setReturnValue(QuotaManager.getInstance().generatePerUserUsageReport(quotaList));
Line 29: }
....................................................
File
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/resources/ResourcesModel.java
Line 339: +
vm.getCpuPerSocket() * vm.getNumOfSockets());
Line 340: }
Line 341: }
Line 342: // for each image of each disk of
the vm - if it has a quota
Line 343: for (DiskImage image :
vm.getDiskList()) {
quota can be owned by several people (consume_quota), each of them will be
accounted for the disk?
Line 344: QuotaUsagePerUser
quotaUsagePerUser =
Line 345:
quotaPerUserUsageEntityMap.get(image.getQuotaId());
Line 346: double imageSize =
Line 347:
image.getImage().isActive() ? image.getSizeInGigabytes()
--
To view, visit http://gerrit.ovirt.org/10370
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I9190fa6768af035384299e64f6d1b15891dd5514
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: ofri masad <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches