Alona Kaplan has posted comments on this change.

Change subject: engine: Remove from host_device table the ids of vms which are 
down
......................................................................


Patch Set 2:

(1 comment)

https://gerrit.ovirt.org/#/c/39894/2/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/hostdev/HostDeviceManager.java
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/hostdev/HostDeviceManager.java:

Line 55: 
Line 56:         for (HostDevice hostDevice : hostDevices) {
Line 57:             Guid vmId = hostDevice.getVmId();
Line 58:             if (vmId != null) {
Line 59:                 VM vm = chachedVms.containsKey(vmId) ? 
chachedVms.get(vmId) : vmDao.get(vmId);
> wouldn't querying all the VMs once be more efficient than multiple queries 
I'm not sure what is more efficient- fetching all the vms in one query or 
having multiple queries to fetch a small set of the vms (in most of the use 
cases it will be just few vfs)...
But if you're sure it is more efficient I will change it.
Line 60: 
Line 61:                 if (vm.isDown()) {
Line 62:                     
hostDeviceDao.setVmIdOnHostDevice(hostDevice.getId(), null);
Line 63:                 }


-- 
To view, visit https://gerrit.ovirt.org/39894
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I728fadd7d9d4c10f905866353e07912cc55d1c9e
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alona Kaplan <alkap...@redhat.com>
Gerrit-Reviewer: Alona Kaplan <alkap...@redhat.com>
Gerrit-Reviewer: Arik Hadas <aha...@redhat.com>
Gerrit-Reviewer: Martin Betak <mbe...@redhat.com>
Gerrit-Reviewer: Moti Asayag <masa...@redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to