LoadBalancer ArithmeticException: / by zero
-------------------------------------------

                 Key: HBASE-2974
                 URL: https://issues.apache.org/jira/browse/HBASE-2974
             Project: HBase
          Issue Type: Bug
            Reporter: stack
            Assignee: stack


Having an issue so regionservers are not checking in.  Balancer meantime went 
to run and threw ArithmeticException: / by zero

Committing this:

{code}
Index: src/main/java/org/apache/hadoop/hbase/master/LoadBalancer.java
===================================================================
--- src/main/java/org/apache/hadoop/hbase/master/LoadBalancer.java      
(revision 995307)
+++ src/main/java/org/apache/hadoop/hbase/master/LoadBalancer.java      
(working copy)
@@ -140,6 +140,10 @@
       new TreeMap<HServerInfo,List<HRegionInfo>>(
           new HServerInfo.LoadComparator());
     int numServers = clusterState.size();
+    if (numServers == 0) {
+      LOG.debug("numServers=0 so nothing to balance");
+      return null;
+    }
     int numRegions = 0;
     // Iterate so we can count regions as we build the map
     for(Map.Entry<HServerInfo, List<HRegionInfo>> server :
{code}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to