You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by GitBox <gi...@apache.org> on 2021/03/30 16:44:18 UTC

[GitHub] [hbase] mokai87 commented on a change in pull request #3109: HBASE-25718 Backport HBASE-25705 to branch-2

mokai87 commented on a change in pull request #3109:
URL: https://github.com/apache/hbase/pull/3109#discussion_r604263907



##########
File path: hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
##########
@@ -1773,12 +1775,15 @@ public static ServerName toServerName(final byte [] data) throws Deserialization
 
   public static RSGroupInfo toGroupInfo(RSGroupProtos.RSGroupInfo proto) {
     RSGroupInfo RSGroupInfo = new RSGroupInfo(proto.getName());
-    for(HBaseProtos.ServerName el: proto.getServersList()) {
-      RSGroupInfo.addServer(Address.fromParts(el.getHostName(), el.getPort()));
-    }
-    for(TableProtos.TableName pTableName: proto.getTablesList()) {
-      RSGroupInfo.addTable(ProtobufUtil.toTableName(pTableName));
-    }
+
+    Collection<Address> addresses = proto.getServersList().parallelStream()
+      .map(serverName -> Address.fromParts(serverName.getHostName(), serverName.getPort()))
+      .collect(Collectors.toList());
+    RSGroupInfo.addAllServers(addresses);

Review comment:
       Updated




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org