Gilad Chaplik has posted comments on this change. Change subject: core: refactoring quota ......................................................................
Patch Set 3: (14 inline comments) .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java Line 308: ((Quotable) this).rollbackQuota(); :( Line 498: returnValue &= ((Quotable) this).validateAndSetQuota(); we talked about it, the action here is like compare&set, validating the quota, and updating the cache to prevent races Line 1129: ((Quotable) this).rollbackQuota(); actually this change is according to Kublin, in failure we should ensure the quota is rolled-back, and I agree. .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaHelper.java Line 401: return Config.<Integer> GetValue(ConfigValues.QuotaThresholdVdsGroup); actually this code isn't used, and be removed later on (in the squash). .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaManager.java Line 26: public class QuotaManager { I did it on purpose, the new QuotaManager is totally new - there is no use in the old code. Line 57: private static Log log = LogFactory.getLog(QuotaManager.class); Done Line 60: new ConcurrentHashMap<Guid, Map<Guid, Quota>>(); Done Line 79: synchronized (storagePoolQuotaMap.get(storagePool.getId())) { we talked about it over the phone, we need to protect removing object from the cache, from the time of the get, till the time of the synchronized. Line 98: if (!validateAndSetStorageQuotaHelper(storagePool, parameters, new ArrayList<String>(), false)) { "" Line 101: storagePoolQuotaMap.remove(storagePool.getId()); Done Line 126: // don't rollback if the storage pool is not in cache (it's already persist) Done Line 344: // don't rollback if the storage pool is not in cache (it's already persist) Done .................................................... File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/StorageQuotaValidationParameter.java Line 11: super(); Done .................................................... File backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/Quotable.java Line 5: public interface Quotable { agreed -- To view, visit http://gerrit.ovirt.org/6301 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idc7573082e777370cdf0b88dbe5bfedeb5d02baf Gerrit-PatchSet: 3 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Gilad Chaplik <gchap...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Ayal Baron <aba...@redhat.com> Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com> Gerrit-Reviewer: Laszlo Hornyak <lhorn...@redhat.com> Gerrit-Reviewer: Michael Kublin <mkub...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches