You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Clara Xiong (Jira)" <ji...@apache.org> on 2021/08/07 00:06:00 UTC
[jira] [Comment Edited] (HBASE-24643) Replace
Cluster#primariesOfRegionsPerServer from int array to treemap
[ https://issues.apache.org/jira/browse/HBASE-24643?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17394304#comment-17394304 ]
Clara Xiong edited comment on HBASE-24643 at 8/7/21, 12:05 AM:
---------------------------------------------------------------
Replace the following with ArrayList<HashMap<Integer, Integer>> for quick lookup of elements by value.
int[][] primariesOfRegionsPerServer; // serverIndex -> sorted list of regions by primary region
// index
int[][] primariesOfRegionsPerHost; // hostIndex -> sorted list of regions by primary region index
int[][] primariesOfRegionsPerRack; // rackIndex -> sorted list of regions by primary region index
was (Author: claraxiong):
All five need to be updated for better performance for balancer.
int[][] regionsPerHost; // hostIndex -> list of regions
int[][] regionsPerRack; // rackIndex -> region list
int[][] primariesOfRegionsPerServer; // serverIndex -> sorted list of regions by primary region
// index
int[][] primariesOfRegionsPerHost; // hostIndex -> sorted list of regions by primary region index
int[][] primariesOfRegionsPerRack; // rackIndex -> sorted list of regions by primary region index
> Replace Cluster#primariesOfRegionsPerServer from int array to treemap
> ---------------------------------------------------------------------
>
> Key: HBASE-24643
> URL: https://issues.apache.org/jira/browse/HBASE-24643
> Project: HBase
> Issue Type: Improvement
> Components: Balancer
> Affects Versions: 2.3.0
> Reporter: Huaxiang Sun
> Assignee: Huaxiang Sun
> Priority: Major
>
> Currently, primariesOfRegionsPerServer is an int array, moveRegion does heavy work by searching the array (linearly) and insert/remove an element requires allocating/copying the whole array.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)