Hello Gilad Chaplik,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/15819

to review the following change.

Change subject: core: VdsSelector: remove method used only once
......................................................................

core: VdsSelector: remove method used only once

Removing method 'canRunOnDestinationVds(List<String>, boolean)'.
To improve code readability.

Gerrit-cntr: 1
Change-Id: Icc59b17b52d655bb603abc0706b6e4e07109124c
Signed-off-by: Gilad Chaplik <gchap...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/VdsSelector.java
1 file changed, 5 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/19/15819/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/VdsSelector.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/VdsSelector.java
index dd4d4c2..d8e629e 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/VdsSelector.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/VdsSelector.java
@@ -88,7 +88,11 @@
     public boolean canFindVdsToRunOn(List<String> messages, boolean isMigrate) 
{
         boolean returnValue = false;
         if (getDestinationVdsId() != null) {
-            returnValue = canRunOnDestinationVds(messages, isMigrate);
+            VDS targetVds = 
DbFacade.getInstance().getVdsDao().get(getDestinationVdsId());
+            log.infoFormat("Checking for a specific VDS only - id:{0}, 
name:{1}, host_name(ip):{2}",
+                    getDestinationVdsId(), targetVds.getName(), 
targetVds.getHostName());
+            returnValue = canFindVdsToRun(messages, isMigrate,
+                    new ArrayList<VDS>(Arrays.asList(targetVds)));
         }
 
         if (!returnValue) {
@@ -113,17 +117,6 @@
         return getVdsToRunOn(DbFacade.getInstance()
                 .getVdsDao()
                 .getAllOfTypes(new VDSType[] { VDSType.VDS, VDSType.oVirtNode 
}), isMigrate);
-    }
-
-    private boolean canRunOnDestinationVds(List<String> messages, boolean 
isMigrate) {
-        boolean returnValue = false;
-        if (getDestinationVdsId() != null) {
-            VDS target_vds = 
DbFacade.getInstance().getVdsDao().get(getDestinationVdsId());
-            log.infoFormat("Checking for a specific VDS only - id:{0}, 
name:{1}, host_name(ip):{2}",
-                    getDestinationVdsId(), target_vds.getName(), 
target_vds.getHostName());
-            returnValue = canFindVdsToRun(messages, isMigrate, 
Arrays.asList(target_vds));
-        }
-        return returnValue;
     }
 
     private boolean canFindAnyVds(List<String> messages, boolean isMigrate) {


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icc59b17b52d655bb603abc0706b6e4e07109124c
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Laszlo Hornyak <lhorn...@redhat.com>
Gerrit-Reviewer: Gilad Chaplik <gchap...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to