Allon Mureinik has submitted this change and it was merged.

Change subject: core: Remove VmRunHandler.getPluggedDisks(VM)
......................................................................


core: Remove VmRunHandler.getPluggedDisks(VM)

Removed VmRunHandler.getPluggedDisks(VM) and replaced it with a direct
DAO call DiskDao.getAllForVm(vmId, true).

This approach has better performance (since all the filtering is done in
the database, and there is no roundtrip via Java) and leaves the code
easier to understand (there's just less of it).

This patch includes:
1. A new method in DiskDAO - getAllForVm(Guid vmId, boolean
   onlyPlugged), its filtered counterpart, the underlying stored
   procedure (naturally), and tests for this method.
2. Removing VmRunHandler.getPluggedDisks(VM)
3. Changing all the usages of VmRunHandler (i.e.,
   CreateAllSnapshotsFromVmCommand and VmRunHandler itself).

Change-Id: I55052dad87a552df200039e111fd0dd6658f6ae8
Signed-off-by: Allon Mureinik <[email protected]>
---
M backend/manager/dbscripts/all_disks_sp.sql
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/VmRunHandler.java
M 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/RunVmCommandTest.java
M 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/DiskDao.java
M 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/DiskDaoDbFacadeImpl.java
M 
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/BaseDiskDaoTest.java
M 
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/DiskDaoTest.java
M 
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/DiskLunMapDaoTest.java
M 
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/VmDeviceDAOTest.java
M backend/manager/modules/dal/src/test/resources/fixtures.xml
11 files changed, 132 insertions(+), 88 deletions(-)

Approvals:
  Allon Mureinik: Verified; Looks good to me, approved


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

Gerrit-MessageType: merged
Gerrit-Change-Id: I55052dad87a552df200039e111fd0dd6658f6ae8
Gerrit-PatchSet: 3
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[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