Gilad Chaplik has posted comments on this change.
Change subject: core: Fast update quota cache
......................................................................
Patch Set 8: (2 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaManager.java
Line 33:
Line 34: // when (cache size/number of quota in DB) ratio is under this
minimum threshold - the calls to
Line 35: // updateQuotaCache() would result in cache update. otherwise
update will be executed.
Line 36: private static final double MINIMUM_CACHE_FACTOR =
Line 37: (double) Config.<Integer>
GetValue(ConfigValues.MinimumPercentageToUpdateQuotaCache) / 100;
move the division by 100 to the actual calc, or rename 'MINIMUM... ' to
'Minimum... inPERCETAGE'; it's confusing.
Line 38:
Line 39: public static QuotaManager getInstance() {
Line 40: return INSTANCE;
Line 41: }
Line 1010: if
(!storagePoolQuotaMap.containsKey(quota.getStoragePoolId())) {
Line 1011:
storagePoolQuotaMap.put(quota.getStoragePoolId(), new HashMap<Guid,Quota>());
Line 1012: }
Line 1013:
storagePoolQuotaMap.get(quota.getStoragePoolId()).put(quota.getId(), quota);
Line 1014: }
ofri is constructing the map within a lock.
he can construct the map outside the lock and only set the map inside the lock
Line 1015: } finally {
Line 1016: lock.writeLock().unlock();
Line 1017: }
Line 1018: long timeEnd = System.currentTimeMillis();
--
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: 8
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: ofri masad <[email protected]>
Gerrit-Reviewer: Doron Fediuck <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Michael Kublin <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: ofri masad <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches