You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ch...@apache.org on 2018/01/09 05:04:31 UTC

hbase git commit: HBASE-19702 Improve RSGroupInfo constructors

Repository: hbase
Updated Branches:
  refs/heads/branch-2 9b57fd09e -> bc4e49ffa


HBASE-19702 Improve RSGroupInfo constructors

Signed-off-by: Chia-Ping Tsai <ch...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/bc4e49ff
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/bc4e49ff
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/bc4e49ff

Branch: refs/heads/branch-2
Commit: bc4e49ffaaf1719cd9aea4ea23a349bce1aa398e
Parents: 9b57fd0
Author: Xiang Li <wa...@gmail.com>
Authored: Tue Jan 9 00:42:52 2018 +0800
Committer: Chia-Ping Tsai <ch...@gmail.com>
Committed: Tue Jan 9 12:55:30 2018 +0800

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/rsgroup/RSGroupInfo.java     | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/bc4e49ff/hbase-common/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfo.java
----------------------------------------------------------------------
diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfo.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfo.java
index f87ec71..25e827d 100644
--- a/hbase-common/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfo.java
+++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/rsgroup/RSGroupInfo.java
@@ -47,13 +47,12 @@ public class RSGroupInfo {
 
   RSGroupInfo(String name, SortedSet<Address> servers, SortedSet<TableName> tables) {
     this.name = name;
-    this.servers = servers == null? new TreeSet<>(): servers;
-    this.servers.addAll(servers);
-    this.tables = new TreeSet<>(tables);
+    this.servers = (servers == null) ? new TreeSet<>() : new TreeSet<>(servers);
+    this.tables  = (tables  == null) ? new TreeSet<>() : new TreeSet<>(tables);
   }
 
   public RSGroupInfo(RSGroupInfo src) {
-    this(src.getName(), src.servers, src.tables);
+    this(src.name, src.servers, src.tables);
   }
 
   /**