Omer Frenkel has uploaded a new change for review.

Change subject: core: use single thread on update sla policies
......................................................................

core: use single thread on update sla policies

when vms monitoring cycle finish, it is calling update sla policies in a
new thread.
the new vms monitoring changed the call to be per-vm instead of one call
for all vms that succeeded to run.

in this patch the previous approach restored, calling once with list of
vms, resulting only one thread for all the vms.

Change-Id: Id7f92bf64d771e351f2aab46874515eb70a713fa
Signed-off-by: Omer Frenkel <ofren...@redhat.com>
---
M 
backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VmsMonitoring.java
1 file changed, 4 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/24/39424/1

diff --git 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VmsMonitoring.java
 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VmsMonitoring.java
index 95bbdbb..6ad9dc2 100644
--- 
a/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VmsMonitoring.java
+++ 
b/backend/manager/modules/vdsbroker/src/main/java/org/ovirt/engine/core/vdsbroker/VmsMonitoring.java
@@ -195,6 +195,7 @@
 
     private void afterVMsRefreshTreatment() {
         Collection<Guid> movedToDownVms = new ArrayList<>();
+        List<Guid> succeededToRunVms = new ArrayList<>();
 
         // now loop over the result and act
         for (VmAnalyzer vmUpdater : vmAnalyzers) {
@@ -207,12 +208,7 @@
 
             if (vmUpdater.isSuccededToRun()) {
                 vdsManager.succeededToRunVm(vmUpdater.getDbVm().getId());
-                //TODO change {@IVdsEventListener.updateSlaPolicies}
-                // to varargs version to avoid creating the list
-                // over and over again - updateSlaPolicies(Guid vdsId, Guid... 
vmIds)
-                getVdsEventListener().updateSlaPolicies(
-                        Arrays.asList(new Guid[] 
{vmUpdater.getDbVm().getId()}),
-                        vdsManager.getVdsId());
+                succeededToRunVms.add(vmUpdater.getDbVm().getId());
             }
 
             // Refrain from auto-start HA VM during its re-run attempts.
@@ -242,6 +238,8 @@
 
         }
 
+        getVdsEventListener().updateSlaPolicies(succeededToRunVms, 
vdsManager.getVdsId());
+
         // run all vms that crashed that marked with auto startup
         getVdsEventListener().runFailedAutoStartVMs(autoVmsToRun);
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id7f92bf64d771e351f2aab46874515eb70a713fa
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Omer Frenkel <ofren...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to