From bb38e7f4ddbe191e61f29e9dbc464ced4cefa7d6 Mon Sep 17 00:00:00 2001 From: Vlad Ilie Date: Wed, 3 May 2023 15:21:38 +0300 Subject: [PATCH] Refactoring: - fixed typo in comment - changed class field to be final --- .../analyzer/goals/IntraBrokerDiskCapacityGoal.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cruise-control/src/main/java/com/linkedin/kafka/cruisecontrol/analyzer/goals/IntraBrokerDiskCapacityGoal.java b/cruise-control/src/main/java/com/linkedin/kafka/cruisecontrol/analyzer/goals/IntraBrokerDiskCapacityGoal.java index 21b8325a5d..e95d282df8 100644 --- a/cruise-control/src/main/java/com/linkedin/kafka/cruisecontrol/analyzer/goals/IntraBrokerDiskCapacityGoal.java +++ b/cruise-control/src/main/java/com/linkedin/kafka/cruisecontrol/analyzer/goals/IntraBrokerDiskCapacityGoal.java @@ -43,13 +43,13 @@ public class IntraBrokerDiskCapacityGoal extends AbstractGoal { private static final Logger LOG = LoggerFactory.getLogger(IntraBrokerDiskCapacityGoal.class); private static final int MIN_NUM_VALID_WINDOWS = 1; private static final Resource RESOURCE = Resource.DISK; - private boolean _shouldEmptyZeroCapacityDisks = false; + private final boolean _shouldEmptyZeroCapacityDisks; /** * Constructor for Capacity Goal. */ public IntraBrokerDiskCapacityGoal() { - + _shouldEmptyZeroCapacityDisks = false; } /** @@ -66,6 +66,7 @@ public IntraBrokerDiskCapacityGoal(boolean shouldEmptyZeroCapacityDisks) { */ IntraBrokerDiskCapacityGoal(BalancingConstraint constraint) { _balancingConstraint = constraint; + _shouldEmptyZeroCapacityDisks = false; } @Override @@ -257,7 +258,7 @@ public ModelCompletenessRequirements clusterModelCompletenessRequirements() { /** * Check whether the combined replica utilization is above the given disk capacity limits. - * If _shouldEmptyZeroCapacityDisks is true, the disk utilization is over limit only if it greater than 0. + * If _shouldEmptyZeroCapacityDisks is true, the disk utilization is over limit only if it is greater than 0. * * @param disk Disk to be checked for capacity limit violation. * @return {@code true} if utilization is over the limit, {@code false} otherwise.