You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by xu...@apache.org on 2019/03/19 22:32:42 UTC

[hbase] branch branch-1 updated: Revert "HBASE-22009 Improve RSGroupInfoManagerImpl#getDefaultServers()"

This is an automated email from the ASF dual-hosted git repository.

xucang pushed a commit to branch branch-1
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-1 by this push:
     new 530bd6f  Revert "HBASE-22009 Improve RSGroupInfoManagerImpl#getDefaultServers()"
530bd6f is described below

commit 530bd6f570a67e1ec2b7cca30efcf3f9d046527c
Author: Xu Cang <xu...@apache.org>
AuthorDate: Tue Mar 19 15:32:28 2019 -0700

    Revert "HBASE-22009 Improve RSGroupInfoManagerImpl#getDefaultServers()"
    
    This reverts commit 73f138c30220805dcdbd754162d39958710e7bee.
---
 .../hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java   | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java
index 1711791..2fcaf03 100644
--- a/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java
+++ b/hbase-rsgroup/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfoManagerImpl.java
@@ -479,18 +479,18 @@ public class RSGroupInfoManagerImpl implements RSGroupInfoManager, ServerListene
   }
 
   private List<Address> getDefaultServers() throws IOException {
-    // Build a list of servers in other groups than default group, from rsGroupMap
-    Set<Address> serversInOtherGroup = new HashSet<>();
-    for (RSGroupInfo group : listRSGroups() /* get from rsGroupMap */) {
-      if (!RSGroupInfo.DEFAULT_GROUP.equals(group.getName())) { // not default group
-        serversInOtherGroup.addAll(group.getServers());
-        }
-      }
-    // Get all online servers from Zookeeper and find out servers in default group
     List<Address> defaultServers = new LinkedList<Address>();
     for(ServerName server : getOnlineRS()) {
       Address address = Address.fromParts(server.getHostname(), server.getPort());
-      if (!serversInOtherGroup.contains(server)) { // not in other groups
+      boolean found = false;
+      for(RSGroupInfo info : rsGroupMap.values()) {
+        if(!RSGroupInfo.DEFAULT_GROUP.equals(info.getName()) &&
+            info.containsServer(address)) {
+          found = true;
+          break;
+        }
+      }
+      if(!found) {
         defaultServers.add(address);
       }
     }