Omer Frenkel has posted comments on this change.

Change subject: core: Architecture related queries
......................................................................


Patch Set 2:

(2 comments)

cant we replace some of these queries with a simple search in frontend? for 
example instead 
GetCompatibleVmTemplatesByStoragePoolAndArchitectureQuery  just use :
(~)"Templates: DataCenter = <dc> and arc=<arc> or name='blank' "
probably also GetAllCompatibleVdsGroupsQuery -> 
Clusters: arc="" or arc=<arc>

and so on?

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetAllCompatibleServerCpuListQuery.java
Line 18:     @Override
Line 19:     protected void executeQueryCommand() {
Line 20:         VDSGroup cluster = 
getDbFacade().getVdsGroupDao().get(getParameters().getClusterId());
Line 21: 
Line 22:         List<VDS> allVdsForVdsGroup = 
getDbFacade().getVdsDao().getAllForVdsGroup(cluster.getId());
since you get this list only to see if its empty,
it would be better to use VdsStaticDAO as it will only get minimal info from 
the db without unnecessary joins
Line 23: 
Line 24:         List<VM> allVmsForVdsGroup = 
getDbFacade().getVmDao().getAllForVdsGroup(cluster.getId());
Line 25: 
Line 26:         List<ServerCpu> cpuList = 
CpuFlagsManagerHandler.AllServerCpuList(getParameters().getVersion());


Line 20:         VDSGroup cluster = 
getDbFacade().getVdsGroupDao().get(getParameters().getClusterId());
Line 21: 
Line 22:         List<VDS> allVdsForVdsGroup = 
getDbFacade().getVdsDao().getAllForVdsGroup(cluster.getId());
Line 23: 
Line 24:         List<VM> allVmsForVdsGroup = 
getDbFacade().getVmDao().getAllForVdsGroup(cluster.getId());
what this query is used for?
why do we care for vms in the cluster? (i'm assuming vms arc and cpu are 
derived from the cluster)
Line 25: 
Line 26:         List<ServerCpu> cpuList = 
CpuFlagsManagerHandler.AllServerCpuList(getParameters().getVersion());
Line 27: 
Line 28:         if ((allVdsForVdsGroup.isEmpty() && 
allVmsForVdsGroup.isEmpty()) || StringUtils.isEmpty(cluster.getcpu_name()))


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I7ee9cbece6b06893c0101e074e21ca5ab6a8e561
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Vitor de Lima <[email protected]>
Gerrit-Reviewer: Gustavo Frederico Temple Pedrosa 
<[email protected]>
Gerrit-Reviewer: Itamar Heim <[email protected]>
Gerrit-Reviewer: Leonardo Bianconi <[email protected]>
Gerrit-Reviewer: Michal Skrivanek <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
Gerrit-Reviewer: Vitor de Lima <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to