ofri masad has posted comments on this change. Change subject: core: Quota refactor - QuotaManager step 2 ......................................................................
Patch Set 9: (7 inline comments) .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaManager.java Line 772: boolean validQuotaId = checkAndFetchQuota(parameters, param); Line 773: Line 774: // In case this param is a QuotaVdsConsumptionParameter - check that it has a valid Line 775: // vds group id which is handled by this quota Line 776: boolean validVdsGroup = false; Done Line 777: if (param instanceof QuotaVdsConsumptionParameter) { Line 778: validVdsGroup = checkVdsGroupMatchQuota(parameters, param); Line 779: } else { Line 780: validVdsGroup = true; Line 780: validVdsGroup = true; Line 781: } Line 782: Line 783: // In case this param is a QuotaStorageConsumptionParameter - check that it has a valid Line 784: // storage domain id which is handled by this quota Done Line 785: boolean validStorageDomain = false; Line 786: if (param instanceof QuotaStorageConsumptionParameter) { Line 787: validStorageDomain = checkStoragePoolMatchQuota(parameters, param); Line 788: } else { Line 812: return false; Line 813: } Line 814: Line 815: Quota quota = fetchQuotaFromDB(param.getQuotaGuid()); Line 816: if (quota == null) { I actually can't. this a method of CommandBase which i cant access. Line 817: parameters.getCanDoActionMessages().add(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IS_NO_LONGER_AVAILABLE_IN_SYSTEM.toString()); Line 818: log.errorFormat("The quota id {0} is not found in backend and DB.", param.getQuotaGuid().toString()); Line 819: return false; Line 820: } else { Line 819: return false; Line 820: } else { Line 821: param.setQuota(quota); Line 822: } Line 823: if (!quota.getStoragePoolId().equals(parameters.getStoragePoolGuid())) { yes. if for some reason the UI filtering of a quota is wrong (or in REST API in the future) Line 824: throw new InvalidQuotaParametersException("The Quota storage pool id does not match the passed storage pool"); Line 825: } Line 826: return true; Line 827: } Line 819: return false; Line 820: } else { Line 821: param.setQuota(quota); Line 822: } Line 823: if (!quota.getStoragePoolId().equals(parameters.getStoragePoolGuid())) { Done Line 824: throw new InvalidQuotaParametersException("The Quota storage pool id does not match the passed storage pool"); Line 825: } Line 826: return true; Line 827: } Line 837: log.errorFormat("Quota Vds parameters from command: {0} are missing vds group id", Line 838: parameters.getAuditLogable().getClass().getName()); Line 839: return false; Line 840: } Line 841: boolean vdsGroupInQuota = false; this would have to be set to false before the for loop Line 842: if(quota.getGlobalQuotaVdsGroup() != null) { Line 843: vdsGroupInQuota = true; Line 844: } else { Line 845: for (QuotaVdsGroup vdsGroup : quota.getQuotaVdsGroups()) { Line 901: // if the id is valid Line 902: if (quotaId != null && quotaId != Guid.Empty) { Line 903: if (!directQuotaMap.contains(quotaId)) { Line 904: // cache in direct quota map Line 905: Quota quota = getQuotaDAO().getById(quotaId); Done Line 906: lock.readLock().lock(); Line 907: Line 908: directQuotaMap.put(quotaId, quota); Line 909: // cache in storage-pool->quota map -- To view, visit http://gerrit.ovirt.org/8777 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I15314d6269d1f5f43de17c36a6ae91ba874c8a58 Gerrit-PatchSet: 9 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: ofri masad <oma...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Doron Fediuck <dfedi...@redhat.com> Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com> Gerrit-Reviewer: Laszlo Hornyak <lhorn...@redhat.com> Gerrit-Reviewer: Liron Aravot <lara...@redhat.com> Gerrit-Reviewer: Michael Kublin <mkub...@redhat.com> Gerrit-Reviewer: Sharad Mishra <snmis...@linux.vnet.ibm.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: ofri masad <oma...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches