Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-7061

region balance algorithm should do "contiue" instead of "break" when calculating the underloaded server

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 0.92.3
    • None
    • None

    Description

      I found this issue when investigating HBASE-7060. Basically, I think the intention of this code below is to find all the underloaded server. By using break, it will exit earlier, depending on where the non-overloaded server show up in the list. "break" should be changed to "continue".

      Map<ServerName, Integer> underloadedServers = new HashMap<ServerName, Integer>();
      for (Map.Entry<ServerAndLoad, List<HRegionInfo>> server:
      serversByLoad.entrySet()) {
      int regionCount = server.getKey().getLoad();
      if (regionCount >= min)

      { break; }

      underloadedServers.put(server.getKey().getServerName(), min - regionCount);
      }

      Attachments

        Activity

          People

            tychang Tianying Chang
            tychang Tianying Chang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: