Maor Lipchuk has posted comments on this change.

Change subject: engine: Add quota manager
......................................................................


Patch Set 1: (5 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/QuotaManager.java
Line 38:      * concurrent map of quota locks, for each lock we preserve a 
lock, to avoid full synchronization in each operation.
Yes, will change.

Line 57:     public static void removeStorageDeltaQuotaCommand(Guid quotaId, 
Guid storageDomainId, Guid commandId) {
I will add a java doc for this one.
 The method removes the delta for storage quota per command.
 It should be called after the command ends.
 The id that we get here is the quota id, after that I fetch the quotaStorage 
and get the quota limitation id to remove from the delta map.

Line 74:         List<QuotaStorage> listQuotaStorage = 
getQuotaDAO().getQuotaStorageByStorageGuid(storageDomainId, quotaId);
Since storage can be limited by specific limitation or global limitation.
The quotaId which is sent to the method, is actually the global quota id (The 
quota which is specified in the quota table).
 The quota which returns can be or the specific quota for the storage domain, 
with id of quota limitation,
 or the global quota which, in this case, is the quota with the same id which 
was sended to the method.

Line 287:             // global (On
Done

Line 289:             // For specific quota the quota which will be returned 
will be the same one (quotaID parameter).
Yes, I'm aware of it, the initial design was to manage the delta quota in the 
DB and in the memory, but it was decided that for avoiding integrity reasons 
and avoiding multiple I/O calls to the DB, its better to manage this in the 
memory, you can read the discussion in the following patch:
http://gerrit.ovirt.org/#patch,sidebyside,654,2,backend/manager/dbscripts/upgrade/03_01_0060_add_quota_tables.sql

Regarding the fetch from the DB, I will move it before the lock as you 
suggested.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia64ca54a53a3eab46b757bc67731077bc6d3a983
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Michael Kublin <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to