Michael Kublin has posted comments on this change.

Change subject: core: Fast init cache
......................................................................


Patch Set 5: I would prefer that you didn't submit this

(3 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaManager.java
Line 978:                     memUsage);
Line 979:         }
Line 980:         return null;
Line 981:     }
Line 982: 
I don't understand idea of method, by name it should be called only once, so 
the check isNeedToInitializeCache() is unneeded.
Line 983:     public void initializeCache() {
Line 984:         if (!isNeedToInitializeCache()) {
Line 985:             return;
Line 986:         }


Line 985:             return;
Line 986:         }
Line 987: 
Line 988:         List<Quota> allQuotaIncludingConsumption = 
getQuotaDAO().getAllQuotaIncludingConsumption();
Line 989: 
can not be null, if there nothing, it will be empty list
Line 990:         if (allQuotaIncludingConsumption == null) {
Line 991:             return;
Line 992:         }
Line 993: 


Line 1006: 
Line 1007:     public boolean isNeedToInitializeCache() {
Line 1008:         int quotaCount = getQuotaDAO().getQuotaCount();
Line 1009:         int cacheCount = 0;
Line 1010: 
storagePoolQuotaMap. - these variable is shared and not protected for multiple 
thread access.
Line 1011:         for(Map<Guid, Quota> quotaMap : 
storagePoolQuotaMap.values()) {
Line 1012:             cacheCount += quotaMap.size();
Line 1013:         }
Line 1014: 


--
To view, visit http://gerrit.ovirt.org/10159
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id3db08957e413d2f1e0480b764334dd7268c8221
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: ofri masad <oma...@redhat.com>
Gerrit-Reviewer: Eli Mesika <emes...@redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com>
Gerrit-Reviewer: Michael Kublin <mkub...@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