petersomogyi commented on code in PR #8221:
URL: https://github.com/apache/hbase/pull/8221#discussion_r3248576963


##########
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/CacheAwareLoadBalancer.java:
##########
@@ -88,10 +90,11 @@ public class CacheAwareLoadBalancer extends 
StochasticLoadBalancer {
   private Long sleepTime;
   private Configuration configuration;
 
-  public enum GeneratorFunctionType {
-    LOAD,
-    CACHE_RATIO
-  }
+  private float lowCacheRatioThreshold;
+  private float potentialCacheRatioAfterMove;
+  private float minFreeCacheSpaceFactor;
+
+  private BigDecimal simulatedRatio = new BigDecimal(0);

Review Comment:
   In other places you used `BigDecimal.ZERO` for initialization.



##########
hbase-balancer/src/main/java/org/apache/hadoop/hbase/master/balancer/CacheAwareLoadBalancer.java:
##########
@@ -88,10 +90,11 @@ public class CacheAwareLoadBalancer extends 
StochasticLoadBalancer {
   private Long sleepTime;
   private Configuration configuration;
 
-  public enum GeneratorFunctionType {
-    LOAD,
-    CACHE_RATIO
-  }
+  private float lowCacheRatioThreshold;
+  private float potentialCacheRatioAfterMove;
+  private float minFreeCacheSpaceFactor;
+
+  private BigDecimal simulatedRatio = new BigDecimal(0);

Review Comment:
   This `simulatedRatio` field is accessed from multiple places. Can it cause a 
race issue?
   * CacheAwareCandidateGenerator.generate()
   * CacheAwareSkewnessCandidateGenerator.pickRandomRegions()
   * CacheAwareCostFunction.regionMoved()



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to