Gilad Chaplik has posted comments on this change.

Change subject: core: Introduce sla package
......................................................................


Patch Set 1: (14 inline comments)

Arik, Thanks for the quick review, I really appreciate it.
Will upload a new patch in a few minutes.

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MemoryVdsComparer.java
Line 5: 
Line 6: /**
Line 7:  * This comparer chose Vds with more memory available as best
Line 8:  */
Line 9: public class MemoryVdsComparer extends VdsComparer {
Done
Line 10:     @Override
Line 11:     public boolean IsBetter(VDS x, VDS y, VM vm) {
Line 12:         return ((x.getPhysicalMemMb() - x.getMemCommited()) < 
(y.getPhysicalMemMb() - y.getMemCommited()));
Line 13: 


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/RunVmCommandBase.java
Line 48:  */
Line 49: public abstract class RunVmCommandBase<T extends 
VmOperationParameterBase> extends VmCommand<T> implements
Line 50:         IVdsAsyncCommand, RunVmDelayer {
Line 51: 
Line 52:     public static Log log = LogFactory.getLog(RunVmCommandBase.class);
Done
Line 53:     protected static final HashMap<Guid, Integer> 
_vds_pending_vm_count = new HashMap<Guid, Integer>();
Line 54:     private VdsSelector privateVdsSelector;
Line 55:     protected boolean _isRerun = false;
Line 56:     protected VDS _destinationVds;


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/sla/a.java
Line 1: package org.ovirt.engine.core.bll.sla;
Line 2: 
Line 3: public class a {
just testing the reviewers alertness

GOOD JOB LOL
Line 4: 


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/sla/MigrationHandler.java
Line 4: 
Line 5: import org.ovirt.engine.core.common.utils.Pair;
Line 6: import org.ovirt.engine.core.compat.Guid;
Line 7: 
Line 8: public abstract class MigrationHandler {
Done
Line 9:     /**
Line 10:      * this method holds a list of pairs VM id and Host id. each VM 
should be migrated to the specified Host
Line 11:      * @param list
Line 12:      */


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/sla/NoneComparer.java
Line 1: package org.ovirt.engine.core.bll.sla;
Line 2: 
Line 3: 
Line 4: public class NoneComparer extends EvenlyDistributeComparer {
Done


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/sla/SlaValidator.java
Line 5: import org.ovirt.engine.core.utils.log.Log;
Line 6: import org.ovirt.engine.core.utils.log.LogFactory;
Line 7: 
Line 8: public class SlaValidator {
Line 9:     public static Log log = LogFactory.getLog(SlaValidator.class);
Done
Line 10: 
Line 11:     private static final SlaValidator instance = new SlaValidator();
Line 12: 
Line 13:     public static SlaValidator getInstance() {


Line 13:     public static SlaValidator getInstance() {
Line 14:         return instance;
Line 15:     }
Line 16: 
Line 17:     public boolean hasMemoryToRunVM(VDS curVds, VM vm) {
1) it's not static

2) [personal note] I don't like logic within a BE.

3) This method is going to be deleted, and should be implemented as a host 
filter/validator in VdsSelector.
Line 18:         boolean retVal = false;
Line 19:         if (curVds.getMemCommited() != null && 
curVds.getPhysicalMemMb() != null && curVds.getReservedMem() != null) {
Line 20:             double vdsCurrentMem =
Line 21:                     curVds.getMemCommited() + 
curVds.getPendingVmemSize() + curVds.getGuestOverhead() + curVds


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/sla/VdsComparer.java
Line 6: 
Line 7: /**
Line 8:  * Base class for comparing between Hosts
Line 9:  */
Line 10: public abstract class VdsComparer {
a later patch will remove this.
Line 11:     /**
Line 12:      * Factory method, creates necessary comparer
Line 13:      *
Line 14:      * @return


Line 28:      * Base abstract function for finish best Vds treatment
Line 29:      *
Line 30:      * @param x
Line 31:      */
Line 32:     public abstract void BestVdsProcedure(VDS x);
Done
Line 33: 
Line 34:     /**
Line 35:      * Base abstract function to compare between two VDSs
Line 36:      *


Line 38:      * @param y
Line 39:      * @param vm
Line 40:      * @return
Line 41:      */
Line 42:     public abstract boolean IsBetter(VDS x, VDS y, VM vm);
Done


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/sla/VdsLoadBalancer.java
Line 53:                 log.infoFormat("VdsLoadBalancer: high util: {0}, low 
util: {1}, duration: {2}, threashold: {3}",
Line 54:                         group.gethigh_utilization(), 
group.getlow_utilization(),
Line 55:                         group.getcpu_over_commit_duration_minutes(),
Line 56:                         Config.<Integer> 
GetValue(ConfigValues.UtilizationThresholdInPercent));
Line 57:                 
migrationHandler.migrateVMs(loadBalancingAlgorithm.LoadBalance());
loadBalance always creates a list. nullity check is redundant here.
Line 58:             } else {
Line 59:                 log.debugFormat("VdsLoadBalancer: Cluster {0} skipped 
because no selection algorithm selected.",
Line 60:                         group.getname());
Line 61:             }


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/sla/VdsLoadBalancingAlgorithm.java
Line 105:         // return new VmCountVdsLoadBalancingAlgorithm();
Line 106:         return new VdsCpuVdsLoadBalancingAlgorithm(group);
Line 107:     }
Line 108: 
Line 109:     public List<Pair<Guid, Guid>> LoadBalance() {
Done
Line 110:         List<Pair<Guid, Guid>> migrationList = new 
ArrayList<Pair<Guid, Guid>>();
Line 111:         
setAllRelevantVdss(DbFacade.getInstance().getVdsDao().getAllForVdsGroupWithoutMigrating(getVdsGroup().getId()));
Line 112:         log.infoFormat("VdsLoadBalancer: number of relevant vdss (no 
migration, no pending): {0}.",
Line 113:                 getAllRelevantVdss().size());


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/sla/VdsSelector.java
Line 181:         StringBuilder sb = new StringBuilder();
Line 182:         for (VDS curVds : vdss) {
Line 183:             noVDSs = false;
Line 184: 
Line 185:             VdcBllMessages result = validateHostIsReadyToRun(curVds, 
sb, isMigrate);
Sorry for not mentioning it in the commit msg (will do that now): this patch 
motivation is to split-out the scheduling (host selection) code out of the bll, 
i.e., no bll references at all.
the code will be later re-factored (working on the design which you are more 
than welcome to review :))
For now I'm removing the ValidationResult wrapper, an alternative is to move 
the class to common package, which will make too much noise.
Line 186:             if (result == null) {
Line 187:                 return true;
Line 188:             } else {
Line 189:                 messageToReturn = result;


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/VdsComparer.java
Line 5
Line 6
Line 7
Line 8
Line 9
where is the comment?
is it a gerrit bug?


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Icac8f7bc8a696455134bb90ffc17afd420e18dd3
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Arik Hadas <[email protected]>
Gerrit-Reviewer: Doron Fediuck <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Laszlo Hornyak <[email protected]>
Gerrit-Reviewer: Michael Kublin <[email protected]>
Gerrit-Reviewer: Mike Kolesnik <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Roy Golan <[email protected]>
Gerrit-Reviewer: ofri masad <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to