From d5b1dfe30c20f697105a89124042ba11ea7e3657 Mon Sep 17 00:00:00 2001 From: Bryan Duxbury Date: Thu, 19 Jun 2008 16:30:24 +0000 Subject: [PATCH] HBASE-615 Region balancer oscillates during cluster startup -Change HServerLoad's getLoad method to ignore the number of requests, thus causing RegionManager to assign based merely on number of regions per server git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@669533 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 1 + src/java/org/apache/hadoop/hbase/HServerLoad.java | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 3a24f1730ae..978f876fd56 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -61,6 +61,7 @@ Hbase Change Log HBASE-683 can not get svn revision # at build time if locale is not english (Rong-En Fan via Stack) HBASE-699 Fix TestMigrate up on Hudson + HBASE-615 Region balancer oscillates during cluster startup IMPROVEMENTS HBASE-559 MR example job to count table rows diff --git a/src/java/org/apache/hadoop/hbase/HServerLoad.java b/src/java/org/apache/hadoop/hbase/HServerLoad.java index bdeca734e4b..bf6ab0dcd3b 100644 --- a/src/java/org/apache/hadoop/hbase/HServerLoad.java +++ b/src/java/org/apache/hadoop/hbase/HServerLoad.java @@ -59,12 +59,19 @@ public class HServerLoad implements WritableComparable { } /** + * Originally, this method factored in the effect of requests going to the + * server as well. However, this does not interact very well with the current + * region rebalancing code, which only factors number of regions. For the + * interim, until we can figure out how to make rebalancing use all the info + * available, we're just going to make load purely the number of regions. + * * @return load factor for this server */ public int getLoad() { - int load = numberOfRequests == 0 ? 1 : numberOfRequests; - load *= numberOfRegions == 0 ? 1 : numberOfRegions; - return load; + // int load = numberOfRequests == 0 ? 1 : numberOfRequests; + // load *= numberOfRegions == 0 ? 1 : numberOfRegions; + // return load; + return numberOfRegions; } /** {@inheritDoc} */