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

Improve the update of destination rsgroup of RSGroupInfoManagerImpl#moveTables()

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0.0, 1.5.0, 2.3.1
    • Component/s: rsgroup
    • Labels:
      None

      Description

      RSGroupInfoManagerImpl#moveTables() has the following code:

      for (TableName tableName : tableNames) {
        ....
        if (groupName != null) {
          RSGroupInfo dst = new RSGroupInfo(newGroupMap.get(groupName));
          dst.addTable(tableName);
          newGroupMap.put(dst.getName(), dst);
        }
      }
      

      It is to add the tables to "dst" (the destination rsgroup) and put it back to newGroupMap to replace the old RSGroupInfo instance in the map.
      The current logic allocates a new RSGroupInfo instance and calls put operation of map for each table to move, which is not needed and causes a lot of objects to be allocated (the constructor of RSGroupInfo allocates 2 TreeSets).
      The logic could be improved as: allocate a new RSGroupInfo only once, add all tables, and put it into the map.

        Attachments

        1. HBASE-21969.master.000.patch
          2 kB
          Xiang Li
        2. HBASE-21969.master.001.patch
          2 kB
          Xiang Li
        3. HBASE-21969.branch-1.000.patch
          2 kB
          Xiang Li
        4. HBASE-21969.branch-2.000.patch
          2 kB
          Xiang Li

          Activity

            People

            • Assignee:
              water Xiang Li
              Reporter:
              water Xiang Li
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: