[ https://issues.apache.org/jira/browse/HBASE-22009?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16796811#comment-16796811 ]
Hudson commented on HBASE-22009: -------------------------------- Results for branch branch-1 [build #729 on builds.a.o|https://builds.apache.org/job/HBase%20Nightly/job/branch-1/729/]: (x) *{color:red}-1 overall{color}* ---- details (if available): (x) {color:red}-1 general checks{color} -- For more information [see general report|https://builds.apache.org/job/HBase%20Nightly/job/branch-1/729//General_Nightly_Build_Report/] (x) {color:red}-1 jdk7 checks{color} -- For more information [see jdk7 report|https://builds.apache.org/job/HBase%20Nightly/job/branch-1/729//JDK7_Nightly_Build_Report/] (x) {color:red}-1 jdk8 hadoop2 checks{color} -- For more information [see jdk8 (hadoop2) report|https://builds.apache.org/job/HBase%20Nightly/job/branch-1/729//JDK8_Nightly_Build_Report_(Hadoop2)/] (x) {color:red}-1 source release artifact{color} -- See build output for details. > Improve RSGroupInfoManagerImpl#getDefaultServers() > -------------------------------------------------- > > Key: HBASE-22009 > URL: https://issues.apache.org/jira/browse/HBASE-22009 > Project: HBase > Issue Type: Improvement > Components: rsgroup > Reporter: Xiang Li > Assignee: Xiang Li > Priority: Minor > Fix For: 3.0.0, 2.2.0, 1.5.1, 2.2.1 > > Attachments: HBASE-22009.master.000.patch, > call_stack_getDefaultServers.png > > > {code:title=RSGroupInfoManagerImpl.java|borderStyle=solid} > private SortedSet<Address> getDefaultServers() throws IOException { > SortedSet<Address> defaultServers = Sets.newTreeSet(); > for (ServerName serverName : getOnlineRS()) { > Address server = Address.fromParts(serverName.getHostname(), > serverName.getPort()); > boolean found = false; > for (RSGroupInfo rsgi : listRSGroups()) { > if (!RSGroupInfo.DEFAULT_GROUP.equals(rsgi.getName()) && > rsgi.containsServer(server)) { > found = true; > break; > } > } > if (!found) { > defaultServers.add(server); > } > } > return defaultServers; > } > {code} > That is a logic of 2 nest loops. And for each server, listRSGroups() > allocates a new LinkedList and calls Map#values(), both of which are very > heavy operations. > Maybe the inner loop could be moved out, that is > # Build a list of servers of other groups than default group > # Iterate each online servers and check if it is in the list above. If it is > not, then it belongs to default group. -- This message was sent by Atlassian JIRA (v7.6.3#76005)