Details
-
Task
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
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.