Hello Gilad Chaplik,

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

    http://gerrit.ovirt.org/15818

to review the following change.

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

core: VdsSelector: remove method used only once

Removing the method 'getVdsRunOnDestination(bool)'.
To improve code readability.

Gerrit-cntr: 1
Change-Id: Iecedcd6b9b754dbd853304d58083a556dab51cfb
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, 4 insertions(+), 17 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/18/15818/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 600cc90..dd4d4c2 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
@@ -71,7 +71,10 @@
     public Guid getVdsToRunOn(boolean isMigrate) {
         Guid result = Guid.Empty;
         if (getDestinationVdsId() != null) {
-            result = getVdsRunOnDestination(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());
+            result = getVdsToRunOn(new ArrayList<VDS>(Arrays.asList(new VDS[] 
{ targetVds })), isMigrate);
             if (result.equals(Guid.Empty) && privateVm.getMigrationSupport() 
!= MigrationSupport.PINNED_TO_HOST) {
                 result = getAnyVdsToRunOn(isMigrate);
             }
@@ -104,22 +107,6 @@
         }
 
         return returnValue;
-    }
-
-    /**
-     * Get the ID of the VDS.
-     * getDestinationVdsId() must not be null.
-     * @return
-     */
-    private Guid getVdsRunOnDestination(boolean isMigrate) {
-        Guid result = Guid.Empty;
-        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());
-            result = getVdsToRunOn(Arrays.asList(target_vds), isMigrate);
-        }
-        return result;
     }
 
     private Guid getAnyVdsToRunOn(boolean isMigrate) {


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iecedcd6b9b754dbd853304d58083a556dab51cfb
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