You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Xiang Li (JIRA)" <ji...@apache.org> on 2019/02/27 16:14:00 UTC

[jira] [Issue Comment Deleted] (HBASE-21969) Improve the update of destination rsgroup of RSGroupInfoManagerImpl#moveTables()

     [ https://issues.apache.org/jira/browse/HBASE-21969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Xiang Li updated HBASE-21969:
-----------------------------
    Comment: was deleted

(was: RSGroupInfoManagerImpl#moveTables() has the following code:
{code}
for (TableName tableName : tableNames) {
  ....
  if (groupName != null) {
    RSGroupInfo dst = new RSGroupInfo(newGroupMap.get(groupName));
    dst.addTable(tableName);
    newGroupMap.put(dst.getName(), dst);
  }
}
{code}
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.)

> Improve the update of destination rsgroup of RSGroupInfoManagerImpl#moveTables() 
> ---------------------------------------------------------------------------------
>
>                 Key: HBASE-21969
>                 URL: https://issues.apache.org/jira/browse/HBASE-21969
>             Project: HBase
>          Issue Type: Improvement
>          Components: rsgroup
>            Reporter: Xiang Li
>            Assignee: Xiang Li
>            Priority: Minor
>
> RSGroupInfoManagerImpl#moveTables() has the following code:
> {code}
> for (TableName tableName : tableNames) {
>   ....
>   if (groupName != null) {
>     RSGroupInfo dst = new RSGroupInfo(newGroupMap.get(groupName));
>     dst.addTable(tableName);
>     newGroupMap.put(dst.getName(), dst);
>   }
> }
> {code}
> 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.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)