Gilad Chaplik has posted comments on this change.

Change subject: core: Quota refactor - QuotaManager step 2
......................................................................


Patch Set 9: (4 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaManager.java
Line 763:             return true;
Line 764:         }
Line 765: 
Line 766:         boolean hardEnforcement =
Line 767:                 
QuotaEnforcementTypeEnum.HARD_ENFORCEMENT.equals(parameters.getStorage_pool().getQuotaEnforcementType());
can you find me formal post that suggests to use == instead of equals (in case 
of enums)?
Line 768: 
Line 769:         // for each parameter - check and complete
Line 770:         for (QuotaConsumptionParameter param : 
parameters.getParameters()) {
Line 771:             // check that quota id is valid and fetch the quota from 
db (or cache). add the quota to the param


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;
+1
Line 777:             if (param instanceof QuotaVdsConsumptionParameter) {
Line 778:                 validVdsGroup = checkVdsGroupMatchQuota(parameters, 
param);
Line 779:             } else {
Line 780:                 validVdsGroup = true;


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;
Line 777:             if (param instanceof QuotaVdsConsumptionParameter) {
I would use a indicator in param (base) instead of instanceof.
Line 778:                 validVdsGroup = checkVdsGroupMatchQuota(parameters, 
param);
Line 779:             } else {
Line 780:                 validVdsGroup = true;
Line 781:             }


Line 819:             return false;
Line 820:         } else {
Line 821:             param.setQuota(quota);
Line 822:         }
Line 823:         if 
(!quota.getStoragePoolId().equals(parameters.getStoragePoolGuid())) {
terminology.
please change storagePoolGuid to storagePoolId.
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:     }


--
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

Reply via email to