Allon Mureinik has uploaded a new change for review. Change subject: core: EvenDistributionBalancePolicyUnit's comparators ......................................................................
core: EvenDistributionBalancePolicyUnit's comparators Fixed modifiers in these comparators to increase performance and fix the MS_SHOULD_BE_FINAL FindBugs warnings on these classes. Change-Id: Ice42566f82dccfb66624d7054b52948220ced3ea Signed-off-by: Allon Mureinik <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/EvenDistributionBalancePolicyUnit.java 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/47/22147/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/EvenDistributionBalancePolicyUnit.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/EvenDistributionBalancePolicyUnit.java index fdf0edc..1e42831 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/EvenDistributionBalancePolicyUnit.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/EvenDistributionBalancePolicyUnit.java @@ -165,13 +165,13 @@ * Comparator that compares the CPU usage of two hosts, with regard to the number of CPUs each host has and it's * strength. */ - protected final class VdsCpuUsageComparator implements Comparator<VDS> { + protected static final class VdsCpuUsageComparator implements Comparator<VDS> { @Override public int compare(VDS o1, VDS o2) { return Integer.valueOf(calculateCpuUsage(o1)).compareTo(calculateCpuUsage(o2)); } - private int calculateCpuUsage(VDS o1) { + private static int calculateCpuUsage(VDS o1) { return o1.getUsageCpuPercent() * SlaValidator.getEffectiveCpuCores(o1) / o1.getVdsStrength(); } } @@ -179,13 +179,13 @@ /** * Comparator that compares the CPU usage of two VMs, with regard to the number of CPUs each VM has. */ - private final class VmCpuUsageComparator implements Comparator<VM> { + private static final class VmCpuUsageComparator implements Comparator<VM> { @Override public int compare(VM o1, VM o2) { return Integer.valueOf(calculateCpuUsage(o1)).compareTo(calculateCpuUsage(o2)); } - private int calculateCpuUsage(VM o1) { + private static int calculateCpuUsage(VM o1) { return o1.getUsageCpuPercent() * o1.getNumOfCpus(); } } -- To view, visit http://gerrit.ovirt.org/22147 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ice42566f82dccfb66624d7054b52948220ced3ea Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Allon Mureinik <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
