[ https://issues.apache.org/jira/browse/HBASE-22124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16804887#comment-16804887 ]
kevin su commented on HBASE-22124: ---------------------------------- Use ConcurrentSkipListMap to save RegionStateNode, and Encodedname as a key. Everytime createRegionStateNode put <Encodedname,RegionStateNode> to ConcurrentSkipListMap. So we can use this map to Optimize the performance, but use more memory. > Optimize the performance for region moving > ------------------------------------------ > > Key: HBASE-22124 > URL: https://issues.apache.org/jira/browse/HBASE-22124 > Project: HBase > Issue Type: Improvement > Reporter: Duo Zhang > Priority: Major > Attachments: HBASE-22124.v0.patch > > > It is an admin operation so we do not care much about the performance in the > past, but it is really important for rolling upgrade. > For AsyncAdmin, if encoded name is present at client side, we will always > scan the whole meta region to find the region record first, which is really > expensive for a large cluster. > And we always send the encoded name to master, so at master side, we still > need the encoded name -> region name converting, and it is still very > expensive > {code} > public RegionState getRegionState(final String encodedRegionName) { > // TODO: Need a map <encodedName, ...> but it is just dispatch merge... > for (RegionStateNode node: regionsMap.values()) { > if (node.getRegionInfo().getEncodedName().equals(encodedRegionName)) { > return node.toRegionState(); > } > } > return null; > } > {code} > Need to fix them both. -- This message was sent by Atlassian JIRA (v7.6.3#76005)