Roy Golan has posted comments on this change. Change subject: WIP Update balancers and add memory based load balancing ......................................................................
Patch Set 4: (3 comments) https://gerrit.ovirt.org/#/c/38189/4/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/utils/VdsCpuUsageComparator.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/utils/VdsCpuUsageComparator.java: Line 13: INSTANCE; Line 14: Line 15: @Override Line 16: public int compare(VDS o1, VDS o2) { Line 17: return Integer.valueOf(calculateCpuUsage(o1)).compareTo(calculateCpuUsage(o2)); Integer.compare is a static method Line 18: } Line 19: Line 20: private static int calculateCpuUsage(VDS o1) { Line 21: return o1.getUsageCpuPercent() * SlaValidator.getEffectiveCpuCores(o1) / o1.getVdsStrength(); https://gerrit.ovirt.org/#/c/38189/4/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/utils/VmCpuUsageComparator.java File backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/utils/VmCpuUsageComparator.java: Line 10: public enum VmCpuUsageComparator implements Comparator<VM> { Line 11: INSTANCE; Line 12: Line 13: @Override Line 14: public int compare(VM o1, VM o2) { pls change o1 to vm1 and so on. Line 15: return Integer.valueOf(calculateCpuUsage(o1)).compareTo(calculateCpuUsage(o2)); Line 16: } Line 17: Line 18: private static int calculateCpuUsage(VM o1) { Line 11: INSTANCE; Line 12: Line 13: @Override Line 14: public int compare(VM o1, VM o2) { Line 15: return Integer.valueOf(calculateCpuUsage(o1)).compareTo(calculateCpuUsage(o2)); just use the static version of it - Integer.compare(x,y) Line 16: } Line 17: Line 18: private static int calculateCpuUsage(VM o1) { Line 19: return o1.getUsageCpuPercent() * o1.getNumOfCpus(); -- To view, visit https://gerrit.ovirt.org/38189 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1fe13267feca89ab6c8fb9d85656f05930d0b333 Gerrit-PatchSet: 4 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Martin Sivák <msi...@redhat.com> Gerrit-Reviewer: Martin Sivák <msi...@redhat.com> Gerrit-Reviewer: Roy Golan <rgo...@redhat.com> Gerrit-Reviewer: Tomer Saban <tsa...@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