Change in ovirt-engine[master]: core: refactoring quota
gchaplik at redhat.com
gchaplik at redhat.com
Sun Jul 22 13:20:55 UTC 2012
Gilad Chaplik has submitted this change and it was merged.
Change subject: core: refactoring quota
......................................................................
core: refactoring quota
this patch is a combination of 8 patches, that are pushed together
because there're dependent on each other:
in gerrit they were pushed separately to ease the review process.
Detailed description (original patches)
core: refactoring quota
Currently the quota is handled through static methods, involving
db and cache.
adding an inteface to handle quota only when command implements it.
the quota manager should handle quota validation in cache.
Change-Id: Idc7573082e777370cdf0b88dbe5bfedeb5d02baf
Signed-off-by: Gilad Chaplik <gchaplik at redhat.com>
core: refactoring quota CRUD commands
add, remove & update quota commands should inherit abstract command
class, without the need to use quotaHelper.
Change-Id: I78124bce99bad0d716e711b6dd76e9c763affbc6
Signed-off-by: Gilad Chaplik <gchaplik at redhat.com>
core: quota command implements Quotable iface
in every command that uses quota, we sholud implement Quotable.
validate and rollback according to command & quota parameters.
Change-Id: I9f7a4afa4b5308f96d9281fe3cc9791d9ac438e3
Signed-off-by: Gilad Chaplik <gchaplik at redhat.com>
core: removing quota from backend base class
quota ref will be provided only in need not everywhere (using
quotable interface).
Change-Id: I65974e59b9470c9cc3319aeaaed4d0ed9103cead
Signed-off-by: Gilad Chaplik <gchaplik at redhat.com>
core: removing quota unnecessary code from tests
Change-Id: I8b8ffbcee2ea74c4a88669d26939644dfe680c06
Signed-off-by: Gilad Chaplik <gchaplik at redhat.com>
engine: removing default quota
in db scripts (SP & views)
in backend (DAO and bll layers)
in webamind
In the new quota design there is no need for default quota.
Elements without quota, will have null/no quota.
therefore, the upgrade scripts should not create default quotas
and set the elements with it.
hence removing the column is_default_quota in quota table, and all
column's refs in views and SPs.
Change-Id: I197ebf9aafb3919a17c8b10bd9971ab049f62ef8
Signed-off-by: Gilad Chaplik <gchaplik at redhat.com>
core: check consume quota permission on assignment
Currently there is no checks for permissions, on cosume quota.
added to the quotable interface getPermissionQuotaSubject method,
and all of its implementation must supply the relevent quota
(quota(s) in case disk are involved).
this check will be performed only when the quota mode isn't disabled.
in the commnad base, when the command is quotable we will invoke the method,
and add the permission check the the list.
Change-Id: I6f2812af88eb7130dd3527ace4615b4515043d29
Signed-off-by: Gilad Chaplik <gchaplik at redhat.com>
core: quota - fix tests and checkstyles
Change-Id: I62ab51302c55de82e912e61ba5462297461eb78c
Signed-off-by: Gilad Chaplik <gchaplik at redhat.com>
---
M backend/manager/dbscripts/create_views.sql
M backend/manager/dbscripts/quota_sp.sql
M backend/manager/dbscripts/upgrade/03_01_0460_add_defalut_quota_column.sql
M backend/manager/dbscripts/upgrade/03_01_0520_quota_upgrade_script.sql
M backend/manager/dbscripts/upgrade/03_01_0960_fix_default_quota_name.sql
A backend/manager/dbscripts/upgrade/03_01_1310_remove_default_quota.sql
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AbstractDiskVmCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddDiskCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddQuotaCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmFromSnapshotCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmFromTemplateCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddVmTemplateCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommonVmPoolWithVmsCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CreateAllSnapshotsFromVmCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/ImportVmTemplateCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveOrCopyDiskCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveOrCopyImageGroupCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MoveOrCopyTemplateCommand.java
A backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/QuotaCRUDCommand.java
D backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/QuotaHelper.java
D backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/QuotaManager.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveDiskCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveQuotaCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RemoveVmTemplateCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/StopVmCommandBase.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateQuotaCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmDiskCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmPoolWithVmsCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/UpdateVmTemplateCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VmCommand.java
A backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/QuotaManager.java
A backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/quota/StorageQuotaValidationParameter.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AddEmptyStoragePoolCommand.java
M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/UpdateStoragePoolCommand.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/AddQuotaCommandTest.java
D backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/QuotaHelperTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RemoveQuotaCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RunVmCommandTest.java
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/UpdateQuotaCommandTest.java
D backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/AddEmptyStoragePoolCommandTest.java
A backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/Quotable.java
M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/Quota.java
M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogDirector.java
M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/dbbroker/auditloghandling/AuditLogableBase.java
M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/DiskImageDAODbFacadeImpl.java
M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/QuotaDAO.java
M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/QuotaDAODbFacadeImpl.java
M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmDAODbFacadeImpl.java
M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/VmTemplateDAODbFacadeImpl.java
M backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/QuotaDAOTest.java
M backend/manager/modules/dal/src/test/resources/fixtures.xml
M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/quota/QuotaListModel.java
M frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/templates/TemplateListModel.java
58 files changed, 1,742 insertions(+), 2,841 deletions(-)
Approvals:
Gilad Chaplik: Verified; Looks good to me, approved
--
To view, visit http://gerrit.ovirt.org/6315
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I62ab51302c55de82e912e61ba5462297461eb78c
Gerrit-PatchSet: 9
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Gilad Chaplik <gchaplik at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron at redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchaplik at redhat.com>
Gerrit-Reviewer: Laszlo Hornyak <lhornyak at redhat.com>
Gerrit-Reviewer: Michael Kublin <mkublin at redhat.com>
More information about the Engine-commits
mailing list