Omer Frenkel has uploaded a new change for review.

Change subject: core: don't load disks for templates on search
......................................................................

core: don't load disks for templates on search

When searching for templates,
the search loads all the disks for each template.
this is not necessary as disks are a different collection that need to
be fetched upon request,
also the disks are not used currently by the search initiators,
and it make the templates search slow for systems with many templates.

this patch removes the disks population on templates search.

Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1070265
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1064907
Change-Id: Ia83a3117f2c65bbb17972095cf3271eb39449cd6
Signed-off-by: Omer Frenkel <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SearchQuery.java
1 file changed, 1 insertion(+), 10 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/38/25138/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SearchQuery.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SearchQuery.java
index d5ecfde..5b7bc1b 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SearchQuery.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/SearchQuery.java
@@ -202,16 +202,7 @@
     }
 
     private List<VmTemplate> searchVMTemplates() {
-        return genericSearch(getDbFacade().getVmTemplateDao(), true, new 
Filter<VmTemplate>() {
-            @Override
-            public List<VmTemplate> filter(final List<VmTemplate> data) {
-                for (IVdcQueryable vmt_helper : data) {
-                    VmTemplate vmt = (VmTemplate) vmt_helper;
-                    VmTemplateHandler.UpdateDisksFromDb(vmt);
-                }
-                return data;
-            }
-        });
+        return genericSearch(getDbFacade().getVmTemplateDao(), true, null);
     }
 
     private final <T extends IVdcQueryable> List<T> genericSearch(final 
SearchDAO<T> dao,


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia83a3117f2c65bbb17972095cf3271eb39449cd6
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Omer Frenkel <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to