hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ecl...@apache.org
Subject svn commit: r1517002 - in /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer: BaseLoadBalancer.java StochasticLoadBalancer.java
Date Fri, 23 Aug 2013 19:44:13 GMT
Author: eclark
Date: Fri Aug 23 19:44:12 2013
New Revision: 1517002

URL: http://svn.apache.org/r1517002
Log:
HBASE-9310 Remove slop for Stochastic load balancer

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java?rev=1517002&r1=1517001&r2=1517002&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/BaseLoadBalancer.java
Fri Aug 23 19:44:12 2013
@@ -342,7 +342,7 @@ public abstract class BaseLoadBalancer i
   }
 
   // slop for regions
-  private float slop;
+  protected float slop;
   private Configuration config;
   private static final Random RANDOM = new Random(System.currentTimeMillis());
   private static final Log LOG = LogFactory.getLog(BaseLoadBalancer.class);
@@ -352,12 +352,17 @@ public abstract class BaseLoadBalancer i
 
   @Override
   public void setConf(Configuration conf) {
-    this.slop = conf.getFloat("hbase.regions.slop", (float) 0.2);
+    setSlop(conf);
     if (slop < 0) slop = 0;
     else if (slop > 1) slop = 1;
+
     this.config = conf;
   }
 
+  protected void setSlop(Configuration conf) {
+    this.slop = conf.getFloat("hbase.regions.slop", (float) 0.2);
+  }
+
   @Override
   public Configuration getConf() {
     return this.config;

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java?rev=1517002&r1=1517001&r2=1517002&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/StochasticLoadBalancer.java
Fri Aug 23 19:44:12 2013
@@ -122,6 +122,7 @@ public class StochasticLoadBalancer exte
   @Override
   public void setConf(Configuration conf) {
     super.setConf(conf);
+
     regionFinder.setConf(conf);
 
     maxSteps = conf.getInt(MAX_STEPS_KEY, maxSteps);
@@ -160,6 +161,11 @@ public class StochasticLoadBalancer exte
   }
 
   @Override
+  protected void setSlop(Configuration conf) {
+    this.slop = conf.getFloat("hbase.regions.slop", 0.001F);
+  }
+
+  @Override
   public void setClusterStatus(ClusterStatus st) {
     super.setClusterStatus(st);
     regionFinder.setClusterStatus(st);



Mime
View raw message