Alona Kaplan has posted comments on this change.

Change subject: engine: refreshing host devices on engine startup
......................................................................


Patch Set 5:

(4 comments)

https://gerrit.ovirt.org/#/c/39893/5/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 16: @ApplicationScoped
Line 17: public class HostDeviceManager {
Line 18: 
Line 19:     @Inject
Line 20:     private VdsDAO vdsDao;
> s/vdsDao/hostDao
Done
Line 21: 
Line 22:     @Inject
Line 23:     private BackendInternal backend;
Line 24: 


Line 27:  vdsDao.getAll()
> you don't need the vdsDao.getAll() for the function needs. It is too 'heavy
Done


Line 23:     private BackendInternal backend;
Line 24: 
Line 25:     public void init() {
Line 26:         ArrayList<VdcActionParametersBase> parameters = new 
ArrayList<>();
Line 27:         for (VDS vds : vdsDao.getAll()) {
> s/vds/host
Done
Line 28:             // It is sufficient to refresh only the devices of 'UP' 
hosts since other hosts
Line 29:             // will have their devices refreshed in InitVdsOnUpCommand
Line 30:             if (vds.getStatus().equals(VDSStatus.Up)) {
Line 31:                 parameters.add(new VdsActionParameters(vds.getId()));


Line 26:         ArrayList<VdcActionParametersBase> parameters = new 
ArrayList<>();
Line 27:         for (VDS vds : vdsDao.getAll()) {
Line 28:             // It is sufficient to refresh only the devices of 'UP' 
hosts since other hosts
Line 29:             // will have their devices refreshed in InitVdsOnUpCommand
Line 30:             if (vds.getStatus().equals(VDSStatus.Up)) {
> since deals with enum - please compare using == instead of equals.
Done
Line 31:                 parameters.add(new VdsActionParameters(vds.getId()));
Line 32:             }
Line 33:         }
Line 34:         
backend.runInternalMultipleActions(VdcActionType.RefreshHostDevices, 
parameters);


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I69745e4e4860681252a06a494a5d2c7bd2ce1153
Gerrit-PatchSet: 5
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