hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wang, Xinglong (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HBASE-18602) rsgroup cleanup unassign code
Date Tue, 15 Aug 2017 12:34:00 GMT
Wang, Xinglong created HBASE-18602:

             Summary: rsgroup cleanup unassign code
                 Key: HBASE-18602
                 URL: https://issues.apache.org/jira/browse/HBASE-18602
             Project: HBase
          Issue Type: Improvement
          Components: rsgroup
    Affects Versions: 2.0.0-alpha-1
            Reporter: Wang, Xinglong
            Priority: Minor

While walking through rsgroup code, I found that variable misplacedRegions has never been
added any element into. This makes the unassign region code is not functional. And according
to my test, it is actually unnecessary to do that.

private Map<ServerName, List<HRegionInfo>> correctAssignments(
       Map<ServerName, List<HRegionInfo>> existingAssignments)
  throws HBaseIOException{
    Map<ServerName, List<HRegionInfo>> correctAssignments = new TreeMap<>();
    List<HRegionInfo> misplacedRegions = new LinkedList<>();
    correctAssignments.put(LoadBalancer.BOGUS_SERVER_NAME, new LinkedList<>());
    for (Map.Entry<ServerName, List<HRegionInfo>> assignments : existingAssignments.entrySet()){
      ServerName sName = assignments.getKey();
      correctAssignments.put(sName, new LinkedList<>());
      List<HRegionInfo> regions = assignments.getValue();
      for (HRegionInfo region : regions) {
        RSGroupInfo info = null;
        try {
          info = rsGroupInfoManager.getRSGroup(
        } catch (IOException exp) {
          LOG.debug("RSGroup information null for region of table " + region.getTable(),
        if ((info == null) || (!info.containsServer(sName.getAddress()))) {
        } else {

    //TODO bulk unassign?
    //unassign misplaced regions, so that they are assigned to correct groups.
    for(HRegionInfo info: misplacedRegions) {
      try {
      } catch (IOException e) {
        throw new HBaseIOException(e);
    return correctAssignments;

This message was sent by Atlassian JIRA

View raw message